ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
![]() | 1 | initial version |
I had a similar problem some time ago and end up with a recompose.py script. Please have a look at this question.
Basically the script allows you to convert any message to any just from a command line. For your case it will be something like:
$ rostopic echo /gazebo/model_states | ./recompose.py "{pose: 'pose[1]'}" | rostopic pub -r 100 /pelican/pose geometry_msgs/Pose
Although this is convenient for prototyping, for a production code it might be better to write a small node as @gary-servin suggests.