Ask Your Question

gmapping without robot_pose_ekf [closed]

asked 2012-06-26 14:23:07 -0500

ChickenSoup gravatar image

updated 2016-05-17 02:31:52 -0500

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


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Martin Günther
close date 2016-05-17 03:29:18.145817

1 Answer

Sort by » oldest newest most voted

answered 2012-06-26 23:11:38 -0500

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?

edit flag offensive delete link more


@Martin Günther Thank you very much for the wonderful explanation.

ChickenSoup gravatar image ChickenSoup  ( 2012-06-26 23:41:22 -0500 )edit

@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 ( So i just unplugged it.

ChickenSoup gravatar image ChickenSoup  ( 2012-06-26 23:45:22 -0500 )edit

@Martin Günther gmapping cannot be used for 3D as well; that I am aware of by the way :)

ChickenSoup gravatar image ChickenSoup  ( 2012-06-26 23:46:28 -0500 )edit

Question Tools


Asked: 2012-06-26 14:23:07 -0500

Seen: 3,066 times

Last updated: May 17 '16