ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

How to "Rostopic echo" only the pose in the 'odom' topic

asked 2013-02-10 22:40:32 -0500

Evis gravatar image

I'm a beginner in ROS, and as such I'm struggling with an apparently simple question. I'm using Turtlbot in Gazebo and would like to print in a text file the pose of the robot during its path. What I do now is to "echo" the /odom topic and there I can see the pose. However, it prints a lot of other information I do not need. How can I somehow filter it, to only print the pose of the robot (x, y, z) during the robot's path.

Thank you in advance for considering this.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
8

answered 2013-02-10 23:23:28 -0500

Use slash / for name resolution, i.e. to go deeper into the objects and structures.

In your case it should be something like:

$ rostopic echo /odom/pose/pose/position

It should return x, y and z all of type float64.

That is because Odometry message has field pose which is of type geometry_msgs/PoseWithCovariance, which has another pose of type geometry_msgs/Pose and then there are two fields -- position and orientation.

edit flag offensive delete link more

Comments

1

My typing took too long, didn't see the previous answer.

Boris gravatar image Boris  ( 2013-02-10 23:26:36 -0500 )edit

Thanks, but what about when there is an array structure in the middle, how to go deeper ? I posted my question here : http://answers.ros.org/question/22043...

Cyril Jourdan gravatar image Cyril Jourdan  ( 2015-11-10 10:04:11 -0500 )edit
4

answered 2013-02-10 23:14:38 -0500

dornhege gravatar image

Just try rostopic echo /odom/pose.

edit flag offensive delete link more

Comments

I'm grateful

anonymous userAnonymous ( 2021-07-13 03:31:29 -0500 )edit
0

answered 2013-02-10 23:40:37 -0500

Evis gravatar image

Thanks a lot guys, that was it! :)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-10 22:40:32 -0500

Seen: 9,536 times

Last updated: Feb 10 '13