Skip to content

Instantly share code, notes, and snippets.

@jhurliman
Created March 7, 2022 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhurliman/0a6dd029dd1261d8ef0b52499e1abd55 to your computer and use it in GitHub Desktop.
Save jhurliman/0a6dd029dd1261d8ef0b52499e1abd55 to your computer and use it in GitHub Desktop.
ros2 topic pub examples
# volatile, no history
ros2 topic pub -r 0.5 --qos-durability volatile --qos-reliability reliable /chatter std_msgs/msg/String '{data: hello}'
# transient_local, history of 5
ros2 topic pub -r 0.5 --qos-durability transient_local --qos-reliability reliable --qos-depth 5 --qos-history keep_last /chatter std_msgs/msg/String '{data: hello}'
# foxy compatible transient_local
ros2 topic pub -r 0.5 --qos-durability transient_local --qos-reliability reliable /chatter std_msgs/msg/String '{data: hello}'
# /tf_static
ros2 topic pub -r 0.5 --qos-durability transient_local --qos-reliability reliable /tf_static tf2_msgs/msg/TFMessage '{transforms: [{child_frame_id: "child", header: {frame_id: "parent", seq: 0}, parent_frame_id: "parent", transform: {rotation: {w: 1, x: 0, y: 0, z: 0}, translation: {x: 0, y: 0, z: 0}}}]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment