How to publish a `geometry_msgs/PoseArray` from the command line?

5.2k views Asked by At

Can anybody give me an example of geometry_msgs/PoseArray message using rostopic pub? I keep on getting errors when i try and interpret the syntax from the ROS documentation, a solid example would be really helpful.

1

There are 1 answers

0
José Sánchez On

Do you mean something like this:

rostopic pub /my_topic geometry_msgs/PoseArray "{header: {frame_id: 'base_frame'}, poses: [{position: {x: 1.0, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}, {position: {x: 1.1, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}]}"

This will publish a PoseArray message containing two poses to the topic my_topic. Furthermore, if you are using bash I believe you can auto-complete the message by hitting tab.