Robobot MQTT topics

From Rsewiki
Revision as of 09:23, 15 February 2025 by Jca (talk | contribs) (→‎Robobot)

Back to Robobot

MQTT

MQTT (Message Queuing Telemetry Transport) is a lightweight protocol that transports messages between processes and networks.

The used MQTT server is Mosquitto from https://mosquitto.org/

The interface library used in both the Teensy_interface and the MQTT_client is paho-mqtt: https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html

Robobot

Robobot uses MQTT

The MQTT server connects the Teensy_interface with the behaviour part of the robot.

Data topics (from firmware)

Data messages mainly originate from the Teensy firmware, where data can be subscribed.

  • topic: robobot/#

All used topics start with the keyword robobot/. The # is a wildcard that matches all sub-topics.

  • topic: robobot/drive/T0/#

The sub-topic robobot/drive/ is used for all data messages sourced by the teensy_interface (data from the drive function and generated by the first (and only) Teensy T0).

Data messages

Data types described in Help page Teensy_8 generate messages starting with a keyword and some parameters. The keyword is used as subtopic, e.g.:

  • robobot/drive/T0/pose is a pose message

The parameters are then the MQTT message "payload", examples of a pose messages are:

  • robobot/drive/T0/pose 1738930269.8039 2232.5911 0.583 0.702 2.5420 3.1241

After the topic robobot/drive/T0/pose are the payload.

The payload is always pure text (7-bit ASCII), and the first data is always a timestamp in seconds (since 1 Jan 1970).

In this case, the remaining data are Teensy time (sec), x and y position, heading (radians), and tilt (radians).

Examples:

robobot/drive/T0/gyro2   1738930269.7980 -0.448853 0.816986 -4.012695 2232.585
robobot/drive/T0/vel     1738930269.7992 2232.5859 -0.003 -0.008 -0.0200 -0.003 3
robobot/drive/T0/pose    1738930269.7992 2232.5859 0.583 0.702 2.5420 3.1239
robobot/drive/T0/mvel    1738930269.7999 -0.003 -0.008
robobot/drive/T0/acc2    1738930269.8004 0.018066 -0.026367 0.984863 2232.587
robobot/drive/T0/current 1738930269.8004 0.000 0.000
robobot/drive/T0/dist    1738930269.8027 0.623 0.469
robobot/drive/T0/livn    1738930269.8061 203 195 193 202 197 200 209 217 195
robobot/drive/T0/vel     1738930269.8062 2232.5930 -0.003 -0.008 -0.0200 -0.003 4
robobot/drive/T0/mvel    1738930269.8073 -0.003 -0.008
robobot/drive/T0/pose    1738930269.8096 2232.5959 0.583 0.702 2.5420 3.1241
robobot/drive/T0/gyro2   1738930269.8107 -0.815063 -1.807526 -4.348389 2232.597
robobot/drive/T0/info    1738918215.7251 # got confw: r1=0.075, r2=0.075, G=19, PPR=68, WB=0.23

Most parameters are numeric but could contain text like the last message.

At times, the Teensy sends a comment or a debug message. Such messages are sent with the info topic. The data is always preceded with a #.