Add a ROS topic stream

📘

This page assumes knowledge of ROS.

📘

Configure your catkin workspace for custom messages

Before configuring a custom ROS message, you'll have to provide the Formant agent with the path to your catkin workspace. For more information, see Environment variables for the Formant Agent.

This guide will teach you how to ingest ROS topic data directly into Formant.

Step 1: Create the ROS topic stream

  1. In Formant, in the upper-left corner, open the menu and click Settings.
  2. Click Devices, and then click on the device you want to configure.
  3. Click the Telemetry tab, and then click Add Stream.
  4. Click ROS Topic. This will open the New ROS Topic Stream configuration window:
ROS Topic stream configuration
PropertyUsage
Telemetry stream nameGive the stream a name.
On demandIf ON, this stream will store data locally on your device, and only upload data to Formant when you click Retrieve on-demand data. Rate limit controls the rate at which datapoints are added to the on-device buffer. For more information, see On demand streams.

If OFF, this stream will ingest periodically. Rate limit controls the rate of data ingestion.
Video encodingOnly applicable for sensor_msgs/Image and sensor_msgs/CompressedImage streams. Choose whether you want images ingested on this stream to be encoded as a video.
Validation schemaOnly applicable for JSON and text streams. Choose a configuration schema for this stream.
Ingestion topicEnter the ROS topic name, starting with /. The text field will auto-populate with ROS topics detected on your device.
ROS message path (optional)Path in the ROS message to the data you want to ingest.

For example, suppose you are ingesting a twist message of the format:

{ angular: {x:1, y:2, z:3} }

If you enter a ROS message path of angular.x, you will ingest 1 as a number.

Leaving this parameter blank will ingest the entire message as a JSON.

This property supports complex message structures and array indexing, such as: field.array[x][y].subfield.array2[i].
Add tags (e.g. key: value) (optional)Add tags to each datapoint of this stream. For more information on tags, see Configure access levels.
Rate limit (Hz) (optional)If On demand is ON: Set the rate at which data is added to the on-device buffer. Data in the on-device buffer will be ingested by the agent when you click Retrieve on-demand data. For more information, see On demand streams.

If On demand is OFF: Set the rate at which data is ingested.

The default rate is 0.5 Hz.

📘

Supported formats for streaming video using sensor_msgs/Image messages

For a sensor_msgs/Image topic to be a valid input to Formant's automatic video encoding, it must have a value for the encoding field that matches one of the following exactly:

  • rgb8
  • rgba8
  • bgr8
  • bgra8
  • mono8
  • mono16
  • 8UC1
  • yuv422

If your encoding value is unsupported, you may be able to adjust the encoding field of the sensor_msgs/Image message without changing the underlying data. In some cases, you will need to transform both the data and the encoding property to supported values.

If you have trouble with this, please contact our Customer Success team via the Intercom messenger in the bottom-right corner of this page, or via email at [email protected].

  1. When you're finished configuring your stream, click Done, and then Save. Finally, Save your device settings.

Step 2: Add stream to a view

Once you've added a stream to your device, your next step is to add it to a view in Formant.

Add the streams you want to visualize, and then move on to Viewing data in Formant.

Adding multiple ROS topics to the same module

You can add multiple ROS topics of the same data type to the same module.

In the New ROS Topic Stream window seen above, you can click the Add ROS Topic button multiple times to add multiple streams.

🚧

When adding multiple topics to the same stream, you must provide a unique set of tags for each topic.

Adding multiple ROS topics to the same stream.

Adding multiple ROS topics to the same stream.

ROS topic type vs. Formant data type

The table below shows a mapping from ROS topic type to Formant datapoint type:

ROS message typeFormant datapoint type
std_msgs/String
std_msgs/Char
Text
std_msgs/UInt8
std_msgs/UInt16
std_msgs/UInt32
std_msgs/UInt64
std_msgs/Int8
std_msgs/Int16
std_msgs/Int32
std_msgs/Int64
std_msgs/Float32
std_msgs/Float64
Numeric
std_msgs/BoolBitset
sensor_msgs/NavSatFixLocation
sensor_msgs/BatteryStateBattery
sensor_msgs/Image
sensor_msgs/CompressedImage

(with Video encoding set to OFF)
Image
sensor_msgs/Image
sensor_msgs/CompressedImage

(with Video encoding set to ON)
Video
sensor_msgs/PointCloud2
sensor_msgs/LaserScan
Point cloud
All other ROS types (including custom messages)JSON

👋

If you notice an issue with this page or need help, please reach out to us! Use the 'Did this page help you?' buttons below, or get in contact with our Customer Success team via the Intercom messenger in the bottom-right corner of this page, or at [email protected].