Ask Your Question
2

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

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

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
6

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

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 imageBoris ( 2013-02-10 23:26:36 -0600 )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_J gravatar imageCyril_J ( 2015-11-10 10:04:11 -0600 )edit
4

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

dornhege gravatar image

Just try rostopic echo /odom/pose.

edit flag offensive delete link more
0

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

Evis gravatar image

Thanks a lot guys, that was it! :)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 4,285 times

Last updated: Feb 10 '13