Skip to main content

Data Streams

APIs for listing, reading, and writing robot data streams.


List Streams

Returns all data streams available on a robot.

Endpoint

GET /robots/{robotId}/streams

Request Headers

{
"authorization": "bearer <access_token>"
}

Path Parameters

  • robotId (string): The unique identifier of the robot.

Response Fields

FieldTypeDescription
componentNamestringName of the component publishing the stream (may be empty for ROS topics)
streamNamestringFull stream/topic name (e.g., /scan, /cmd_vel)
streamTypestringROS message type (e.g., sensor_msgs/msg/LaserScan)
directionstringStream direction ("input", "output", or empty)
streamSourceTypeintStream source type (e.g., 3 for ROS topics)
displayNamestring|nullOptional human-readable name
sourceUrlstring|nullOptional source URL
sourceEndpointstring|nullOptional source endpoint

Response Example

{
"robotStreams": [
{
"componentName": "",
"streamName": "/scan",
"streamType": "sensor_msgs/msg/LaserScan",
"direction": "",
"streamSourceType": 3,
"displayName": null,
"sourceUrl": null,
"sourceEndpoint": null
},
{
"componentName": "",
"streamName": "/cmd_vel",
"streamType": "geometry_msgs/msg/Twist",
"direction": "",
"streamSourceType": 3,
"displayName": null,
"sourceUrl": null,
"sourceEndpoint": null
}
]
}

Get Stream Data

Retrieves the current data of a specific stream as a JSON string.

Endpoint

GET /robots/{robotId}/stream?componentName={componentName}&streamName={streamName}&source={source}&streamType={streamType}

Request Headers

{
"authorization": "bearer <access_token>"
}

Path Parameters

  • robotId (string): The unique identifier of the robot.

Query Parameters

  • componentName (string): The name of the component publishing the stream (may be empty for ROS topics).
  • streamName (string): The name of the stream (e.g., /scan).
  • source (int): The stream source type from the List Streams response.
  • streamType (string): The ROS message type (e.g., sensor_msgs/msg/LaserScan).

Response Example

{
"robotStream": "{\"header\":{\"stamp\":{\"sec\":1234567890}},\"ranges\":[0.5,1.2,2.3]}"
}
note

Returns 503 Service Unavailable if the device is temporarily unreachable.


Get Empty Message Template

Returns an empty JSON template for a given message type. Useful for constructing upload payloads.

Endpoint

GET /streams/{messageType}/stream

Request Headers

{
"authorization": "bearer <access_token>"
}

Path Parameters

  • messageType (string): The ROS message type (e.g., sensor_msgs/LaserScan).

Response Example

{
"emptyJson": "{\"header\":{\"stamp\":{\"sec\":0,\"nanosec\":0},\"frame_id\":\"\"},\"ranges\":[]}"
}

Upload Stream

Sends a data payload to a robot stream.

Endpoint

POST /robots/{robotId}/upload-stream

Request Headers

{
"authorization": "bearer <access_token>",
"Content-Type": "application/json"
}

Path Parameters

  • robotId (string): The unique identifier of the robot.

Request Body

{
"componentName": "cmd_vel_publisher",
"streamName": "cmd_vel",
"source": "api",
"streamJson": "{\"linear\":{\"x\":0.5,\"y\":0.0,\"z\":0.0},\"angular\":{\"x\":0.0,\"y\":0.0,\"z\":0.1}}",
"dataType": "geometry_msgs/Twist"
}

Response

Returns 200 OK on success with an empty body.