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

Subscribe to /tf for position?

asked 2013-05-31 18:08:29 -0500

Gazer gravatar image

updated 2013-06-06 07:16:34 -0500

hi all

I used the diffDrive_plugin and publish the position data onto the rostopic "\tf". using

           rostopic echo tf

I got:

transforms: 

header: 
  seq: 0
  stamp: 
    secs: 22
    nsecs: 164000000
  frame_id: /odom
child_frame_id: /base_footprint
transform: 
  translation: 
    x: -0.0680770173496
    y: 0.00835326625379
    z: -0.00216662328182
  rotation: 
    x: 0.0
    y: 0.0
    z: -0.172377366036
    w: 0.985030986151

The question is how to use the tf::TransformListener listener to lookup and store such value? thank you very much!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-05-31 21:05:21 -0500

Hey,

Follow this link http://www.ros.org/wiki/tf/Tutorials/Writing%20a%20tf%20listener%20%28C%2B%2B%29 or go through tf_echo source code, copy it in a new file and then use it. To store it u can data type "pose" or "stamped pose" or there are some data types specifically for transforms.

Hope it helps..

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-31 18:08:29 -0500

Seen: 3,500 times

Last updated: Jun 06 '13