This accessor subscribes to a pre-established ROS topic.
It communicates to ROS through the rosbridge web socket, and extends the
WebSocketClient accessor to do so.
It has a 'topic' parameter, that must be prefixed with a '/' eg: '/noise'.
.
The other parameters configure how the data is to be received according
to the rosbridge specification:
https://github.com/RobotWebTools/rosbridge_suite/blob/develop/ROSBRIDGE_PROTOCOL.md#344-subscribe
- Version:
- $$Id$$
- Source:
Outputs:
Name | Type | Description |
---|---|---|
connected |
boolean | The status of the web socket connection. |
received |
JSON | The data received from the web socket server. |
Parameters:
Name | Type | Description |
---|---|---|
topic |
string | The ROS topic to subscribe to. |
throttleRate |
int | The minimum amount of time (in ms) that must elapse between messages sent. Defaults to 0. |
queueLength |
int | The ROS size of the queue to buffer messages. Messages are buffered as a result of the throttleRate. Defaults to 1. |
fragment_size |
int | The maximum size that a message can take before it is to be fragmented. Defaults to 1000. Ptolemy will close the model if fragment size is too large (not sure what the maximum is). |
compression |
string | A string to specify the compression scheme to be used on messages. Options are "none" (default) and "png". |
outputCompleteResponseOnly |
boolean | A flag which if set to true will cause the accessor to delay in sending messages on the "received" port until it has concatenated the data fields from message fragments back into the original unfragmented message. Otherwise it will send the message fragments as they come in. |
Methods
(static) initialize()
Inherits initialize from webSocketClient. Sends a message to rosbridge to start subscribing to the topic on input 'topic'.
(static) setup()
Sets up by accessor by inheriting inputs, outputs and parameters from setup() in WebSocketClient.
Adds a 'topic' input which is the ROS topic to subscribe to.
(static) toSendInputHandler()
Overrides the toSendInputHandler to throw an error if called. A subscriber should not be publishing inputs.
(static) wrapup()
Unsubscribe from the topic. Close websocket connections by calling wrapup of WebSocketClient