[ros-users] pr2 odometry tf relationship backwards?

Ross Knepper rak at csail.mit.edu
Fri Dec 2 01:07:23 UTC 2011


Hi all,

I am using the controller Pr2Odometry from the pr2_mechanism_controllers 
package to do simulated odometry for the KUKA YouBot in Gazebo.  I am 
seeing an oddity in the tf tree, and I'd like to find out whether it's 
something I'm doing.  It seems to me that there is a reversed 
parent/child relationship in the tf links published by Pr2Odometry.  The 
documentation for it at

     http://www.ros.org/wiki/pr2_mechanism_controllers/Pr2Odometry#ROS_API

says

     /tf (tf/tfMessage)
     Two transforms are published to tf, a constant transform from the 
base_footprint frame to the base_link frame and the transform from the 
odom frame to the base footprint frame.

This conforms to my expectation, which is that /odom is the parent of 
/base_footprint.  Thus, if global localization drops out, you can still 
continue on odometry alone for as long as your dead reckoning will 
allow.  This expected behavior is also compatible with 
fake_localization, which publishes a transform from /map to /odom.

By contrast, examining tf on the running system shows me a tree in which 
/base_footprint is at the root.  /odom is a leaf and a sibling of 
/base_link, which connects to the rest of the tree.  The code at

     
/opt/ros/electric/stacks/pr2_controllers/pr2_mechanism_controllers/src/pr2_odometry.cpp

is clear:

       out.header.frame_id =  tf::resolve(tf_prefix_,base_footprint_frame_);
       out.child_frame_id = tf::resolve(tf_prefix_,odom_frame_);

So /odom is the child here.  This behavior seems to contradict intuition 
and the (admittedly terse) documentation online.  However, since I am 
using this pr2 code on the YouBot, I wonder if there is something 
different about how the PR2 operates?

Thanks!

  -ross



More information about the ros-users mailing list