Rosanswers logo

Hi all,

I tried running pr2 in gazebo (pr2.launch), but removing the robot_pose_ekf in "pr2_bringup.launch" plus setting the parameter "odom_frame" to "odom" (changing from odom_combined to odom) for slam_gmapping node. Also, to get the tfs from odometry I changed "publish_tf" to true in pr2_odometry.yaml (in /pr2_simulator/pr2_controller_configuration_gazebo/pr2_odometry.yaml). Actually I am changing a custom launch files not the originals.

When I visualize it in rviz, using both the fixed frame and target frame set to /odom I see the pr2 is kind of blinking (Robot Model status changing back and forth between OK and Error).

Also, in the Map field I get a status error saying that "No transform from [map] to [/odom]". Thus, the map is not aligned in the display.

What is happening here? By the way I am running ros-electric in ubuntu 11.04.

Thank you in advance


Originally posted by ChickenSoup on ROS Answers with karma: 387 on 2012-06-26

Post score: 3


1 Answer 1


Rosanswers logo

What you are seeing is a TF problem. I could replicate your error, and roswtf shows:

ERROR TF re-parenting contention:
 * reparenting of [/odom] to [/map] by [/slam_gmapping]
 * reparenting of [/odom] to [/base_footprint] by [/gazebo]

ERROR TF multiple authority contention:
 * node [/slam_gmapping] publishing transform [/odom] with parent [/map] already published by node [/gazebo]
 * node [/gazebo] publishing transform [/odom] with parent [/base_footprint] already published by node [/slam_gmapping]

What this means is that slam_gmapping publishes the TF frame /map as parent of /odom, but the PR2 controllers (which show up as /gazebo) also publish /odom, but this time with /base_footprint as its parent. The trouble is that a TF frame can only have exactly one parent.

When running with robot_pose_ekf enabled (before your changes), the TF tree looks like this:

map ------> odom_combined ------> base_footprint

The first transform is published by gmapping, the second by robot_pose_ekf.

Now, your TF tree looks like this:

           map ---
                     ---> odom
base_footprint ---

... which is illegal. I think the reason why odom is published as a child of base_footprint instead of a parent is so that you can have odom and odom_combined both published at the same time.

The solution would be that somehow you need to make odom a parent of base_footprint. For example, you could switch publish_tf back off, write a small node that listens to the odom topic (not TF transform) and publishes that as a TF transform from odom to base_footprint.

Just for curiosity's sake: why do you want to remove robot_pose_ekf?

Originally posted by Martin Günther with karma: 11816 on 2012-06-26

This answer was ACCEPTED on the original site

Post score: 3

Original comments

Comment by ChickenSoup on 2012-06-26:
@Martin Günther Thank you very much for the wonderful explanation.

Comment by ChickenSoup on 2012-06-26:
@Martin Günther Well, I am working on a rover navigating on 3D terrain. And, after going through the robot_pose_ekf code I realized it cannot be used straightaway for inclined planes (http://answers.ros.org/question/32183/robot_pose_ekf-on-an-inclined-plane/). So i just unplugged it.

Comment by ChickenSoup on 2012-06-26:
@Martin Günther gmapping cannot be used for 3D as well; that I am aware of by the way :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.