Class: Ros

Ros

Constructor

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) - (can be specified later with `connect`) the WebSocket URL for rosbridge or the node server url to connect using socket.io (if socket.io exists in the page)
* groovyCompatibility - don't use interfaces that changed after the last groovy release or rosbridge_suite and related tools (defaults to true)
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:

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:

getTopicType(callback)

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