Method | Details |
---|---|
Constructor
import { Ros } from '@robostack/roslib';
|
Available options:
|
.connect(url: string): void
|
Connect to the specified WebSocket.
|
.close(): void
|
Disconnect from the WebSocket server. |
.authenticate(
mac: string,
client: string,
dest: string,
rand: string,
t: number,
level: string,
end: number,
): void
|
Sends an authorization request to the server.
|
.callOnConnection(message: any): void
|
Sends the message over the WebSocket, but queues the message up if not yet connected. |
setStatusLevel(level, id: number): void
|
Sends a set_level request to the server
|
.getActionServers(callback, failedCallback): void
|
Retrieves Action Servers in ROS as an array of string
Callback will receive an array of action server names failedCallback will receive the error message reported by ROS |
.getTopics(callback, failedCallback): void
|
Retrieves list of topics in ROS as an array.
Callback response
|
.getTopicsForType(topicType, callback, failedCallback): void
|
Retrieves Topics in ROS as an array as specific type.
|
.getServices(callback, failedCallback): void
|
Retrieves list of active service names in ROS.
Callback will receive the array of service names failedCallback will receive the error message reported by ROS |
.getServicesForType(serviceType, callback, failedCallback): void
|
Retrieves services in ROS as an array.
|
.getServiceRequestDetails(type, callback, failedCallback): void
|
Retrieves a detail of ROS service request.
Callback will receive the service type failedCallback will receive the error message reported by ROS |
.getServiceResponseDetails(type, callback, failedCallback): void
|
Retrieves a detail of ROS service response.
Callback will receive the service type failedCallback will receive the error message reported by ROS |
.getNodes(callback, failedCallback): void
|
Retrieves list of active node names in ROS.
Callback will receive an array of node names failedCallback will receive the error message reported by ROS |
.getNodeDetails(nodeName, callback, failedCallback): void
|
Retrieves list of subscribed topics, publishing topics and services of a node with the given name
Callback response
|
.getParams(callback, failedCallback): void
|
Retrieves list of param names from the ROS Parameter Server.
Callback will receive the array of param names failedCallback will receive the error message reported by ROS |
.getTopicType(topicName, callback, failedCallback): void
|
Retrieves a type of ROS topic.
Callback will receive the string for topic type failedCallback will receive the error message reported by ROS |
.getServiceType(serviceName, callback, failedCallback): void
|
Retrieves a type of ROS service.
Callback will receive the string for service type failedCallback will receive the error message reported by ROS |
.getMessageDetails(topicType, callback, failedCallback): void
|
Retrieves a detail of ROS message.
Callback will receive the array of message detail failedCallback will receive the error message reported by ROS |
.decodeTypeDefs(defs): dict
|
Decode a typedefs into a dictionary like `rosmsg show foo/bar`. Calls itself recursively to resolve type definition using hints.
|
.getTopicsAndRawTypes(callback, failedCallback): void
|
Retrieves list of topics and their associated type definitions.
Callback response
|
Method | Details |
---|---|
Constructor
import { Message } from '@robostack/roslib';
|
Message objects are used for publishing and subscribing to and from topics.
`data` - object matching the fields defined in the .msg definition file |
Method | Details |
---|---|
Constructor
import { Param } from '@robostack/roslib';
|
Available options:
|
.get(callback: (value: any) => void): void
|
Fetches the value of the param in ROS.
The callback function will receive the value of the Ros Param |
.set(value, callback: (response: any) => void): void
|
Sets the value of the param in ROS.
The callback function will be called after the value of the Ros Param is set |
.delete(callback: (response: any) => void): void
|
Delete this parameter on the ROS server.
The callback function will be called after the value of the Ros Param is deleted |
Method | Details |
---|---|
Constructor
import { Service } from '@robostack/roslib';
|
Available options:
|
.callService(request: ServiceRequest, callback: (response: any) => void, failedCallback?: (error: any) => void): void
|
Calls the service. Returns the service response in the callback. Does nothing if this service is currently advertised.
|
.advertise(callback: (request: any, response: any) => void): void
|
Advertise the service. This turns the Service object from a client into a server.
The callback will receive every request that's made on this service.
|
.unadvertise(): void
|
Unadvertise the service. |
Method | Details |
---|---|
Constructor
import { Topic } from '@robostack/roslib';
|
Available options:
|
.subscribe(callback: (RosMessage) => void): void
|
Every time a message is published for the given topic, the callback will receive the message object. |
.unsubscribe(callback: (RosMessage) => void): void
|
Unregisters as a subscriber for the topic. Unsubscribing stop remove all subscribe callbacks. To remove a call back, you must explicitly pass the callback function in |
.advertise(): void
|
Registers as a publisher for the topic. |
.unadvertise(): void
|
Unregisters as a publisher for the topic. |
.publish(RosMessage): void
|
Publish the message. The library does not validate the schema of the published message data |