Class: Ros

Ros

new Ros(options)

Manages connection to the server and all interactions with ROS. Emits the following events: * 'error' - there was an error with ROS * 'connection' - connected to the WebSocket server * 'close' - disconnected to the WebSocket server * - a message came from rosbridge with the given topic name * - a service response came from rosbridge with the given ID
Parameters:
Name Type Description
options possible keys include: * url (optional) - the WebSocket URL for rosbridge (can be specified later with `connect`)
Source:

Methods

authenticate(mac, client, dest, rand, t, level, end)

Sends an authorization request to the server.
Parameters:
Name Type Description
mac MAC (hash) string given by the trusted source.
client IP of the client.
dest IP of the destination.
rand Random string given by the trusted source.
t Time of the authorization request.
level User level as a string given by the client.
end End time of the client's session.
Source:

callOnConnection()

Sends the message over the WebSocket, but queues the message up if not yet connected.
Source:

close()

Disconnect from the WebSocket server.
Source:

connect(url)

Connect to the specified WebSocket.
Parameters:
Name Type Description
url WebSocket URL for Rosbridge
Source:

decodeTypeDefs(defs)

Decode a typedefs into a dictionary like `rosmsg show foo/bar`
Parameters:
Name Type Description
defs array of type_def dictionary
Source:

getMessageDetails(callback, message)

Retrieves a detail of ROS message.
Parameters:
Name Type Description
callback function with params: * details - Array of the message detail
message String of a topic type
Source:

getNodes(callback)

Retrieves list of active node names in ROS.
Parameters:
Name Type Description
callback function with the following params: * nodes - array of node names
Source:

getParams(callback)

Retrieves list of param names from the ROS Parameter Server.
Parameters:
Name Type Description
callback function with params: * params - array of param names.
Source:

getServices(callback)

Retrieves list of active service names in ROS.
Parameters:
Name Type Description
callback function with the following params: * services - array of service names
Source:

getServicesForType(serviceType, callback)

Retrieves list of services in ROS as an array as specific type
Parameters:
Name Type Description
serviceType service type to find:
callback function with params: * topics - Array of service names
Source:

getServiceType(service, callback)

Retrieves a type of ROS service.
Parameters:
Name Type Description
service name of service:
callback function with params: * type - String of the service type
Source:

getTopics(callback)

Retrieves list of topics in ROS as an array.
Parameters:
Name Type Description
callback function with params: * topics - Array of topic names
Source:

getTopicsForType(topicType, callback)

Retrieves Topics in ROS as an array as specific type
Parameters:
Name Type Description
topicType topic type to find:
callback function with params: * topics - Array of topic names
Source:

getTopicType(topic, callback)

Retrieves a type of ROS topic.
Parameters:
Name Type Description
topic name of the topic:
callback function with params: * type - String of the topic type
Source: