Config on Robot

The robot-side configuration is a single YAML file (conventionally named mosaic_config.yaml) that is passed to AutoConfigurer::AutoConfigure() at startup. It has two top-level sections: server and connectors.


Full Structure

server:
  ws_url: 'wss://api-mosaic.your-domain.com'
  auth:
    type: 'simple-token'
    robot_id: '<your-robot-uuid>'
    params:
      token: '<encrypted-token-from-server>'
  webrtc:
    ice_servers:
      - urls:
          - 'turn.your-turn-server.com:3478'
        username: '<turn-username>'
        credential: '<turn-password>'

connectors:
  - type: 'opencv-sender-camera'
    label: 'camera_stream'
    params:
      fps: 30
      camera_id: 0
      width: 640
      height: 480

  - type: 'my-sensor-sender'
    label: 'sensor_data'
    params:
      topic_name: '/my/sensor/topic'

  - type: 'my-command-receiver'
    label: 'cmd_vel'

server Section

ws_url (required)

The base URL of your MOSAIC-Server instance. The robot appends /ws/robot to form the WebSocket signaling endpoint.

server:
  ws_url: 'wss://api-mosaic.your-domain.com'
Value When to use
wss://... Production (TLS)
ws://... Local development only

If you are using the hosted open-use server, set:

server:
  ws_url: 'wss://dev-mosaic.acslgcs.com'

auth (required)

Identifies the robot and authenticates it with the server.

auth:
  type: 'simple-token'
  robot_id: '<robot-uuid>'
  params:
    token: '<encrypted-token>'
Field Description
type Authentication scheme. Use 'simple-token' for the default MOSAIC token auth.
robot_id The UUID of the robot registered on MOSAIC-Server.
params.token The encrypted auth token generated by MOSAIC-Server for this robot.

The robot UUID and token are obtained from the MOSAIC-Server dashboard when you register a new robot.


webrtc (required)

WebRTC ICE server configuration. At minimum a TURN server is required for robots operating behind NAT.

webrtc:
  ice_servers:
    - urls:
        - 'turn.your-domain.com:3478'
      username: 'your-username'
      credential: 'your-password'
Field Description
urls List of TURN/STUN server URIs. Multiple entries are allowed.
username TURN server username.
credential TURN server password.

connectors Section

Each entry in the connectors list declares one connector. Every entry requires type and label. Additional key-value pairs go under params.

connectors:
  - type: '<connector-type>'   # required — matches GetConnectorType() of your configurer
    label: '<channel-name>'    # required — becomes the DataChannel or MediaTrack name
    params:                    # optional — arbitrary key-value pairs
      key: value
Field Required Description
type Yes Identifies which configurer to use. Must match GetConnectorType() return value.
label Yes The DataChannel or MediaTrack name. Must match connectorId on the dashboard side.
params No Free-form key-value map accessible as connector_config_->params inside Configure(). All values are strings.

Built-in Connector Types

type What it does
opencv-sender-camera Captures from a V4L2 camera via cv::VideoCapture and streams video
connection-check Sends periodic heartbeat data; used to verify the connection is alive

Practical Examples

Non-ROS Robot (TurtleBot3 without ROS)

server:
  ws_url: 'wss://api-mosaic.your-domain.com'
  auth:
    type: 'simple-token'
    robot_id: '42082865-34a3-40c1-bea7-e321622d8c39'
    params:
      token: '<encrypted-token>'
  webrtc:
    ice_servers:
      - urls:
          - 'turn.your-domain.com:3478'
        username: 'user'
        credential: 'pass'

connectors:
  - type: 'opencv-sender-camera'
    label: 'camera_stream'
    params:
      fps: 30
      camera_id: 0
      width: 640
      height: 480

  - type: 'turtlebot-sender-laser-scan'
    label: 'laser_scan'

  - type: 'turtlebot-receiver-teleop'
    label: 'teleop'

ROS2 Robot

server:
  ws_url: 'wss://api-mosaic.your-domain.com'
  auth:
    type: 'simple-token'
    robot_id: '<robot-uuid>'
    params:
      token: '<encrypted-token>'
  webrtc:
    ice_servers:
      - urls:
          - 'turn.your-domain.com:3478'
        username: 'user'
        credential: 'pass'

connectors:
  - type: 'ros2-sender-sensor-Image'
    label: 'camera_stream'
    params:
      topic_name: '/camera/color/image_raw'
      recordable: 'true'

  - type: 'ros2-sender-sensor-NavSatFix'
    label: 'gps'
    params:
      topic_name: '/gps/fix'

  - type: 'ros2-sender-geometry-PoseWithCovarianceStamped'
    label: 'map_pose'
    params:
      topic_name: '/amcl_pose'

  - type: 'ros2-receiver-geometry-TwistStamped'
    label: 'cmd_vel'
    params:
      topic_name: '/cmd_vel'

Notes

All params values are parsed as strings. Convert them inside your configurer:

const int fps  = std::stoi(connector_config_->params.at("fps"));
const bool rec = connector_config_->params.at("recordable") == "true";

label must match the connectorId configured on the dashboard side exactly. A mismatch means the dashboard widget never receives data even though the robot is connected. See Key Concept for details.


This site uses Just the Docs, a documentation theme for Jekyll.