Ask Your Question
0

amcl not publishing map -> odom

asked 2014-09-24 21:15:19 -0500

Mehdi. gravatar image

After trying to simulate turtlebot navigation on STDR instead of Stage, I always run into missing transforms problems and navigation cant start. I ran view_frames and put a link to the resulting pdf. pdf file of TF tree

The particularity of STDR is that it is publishing its own map and doesnt need map_server (from what I could understand). I also had to manually add some transforms to avoid a lot of remapping,

odom -> base_footprint which is just a copy of map_static -> robot0

and

base_link -> base_laser_link which is a copy of robot0 -> robot0_laser_0

When I run everything, I get the following error:

Waiting on transform from base_footprint to map to become available before running costmap, tf error: Could not find a connection between 'map' and 'base_footprint' because they are not part of the same tree.Tf has two or more unconnected trees.

As you can see in the pdf map is also supposed to be connected to odom, which is actually the task of AMCL. But in my case it is not. And i couldnt find out the source of the problem. I would be very thankful for your help.

edit retag flag offensive close merge delete

Comments

I could temporarily bypass this problem by publishing my own map -> odom as a identity transform but this would simulate a perfect odometry?

Mehdi. gravatar imageMehdi. ( 2014-09-24 22:25:10 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
4

answered 2014-09-25 11:24:36 -0500

paulbovbel gravatar image

updated 2014-09-25 11:28:03 -0500

amcl generally needs 4 things at a minimum: a published map (default topic map), a laserscan source (default topic scan), valid odometry tf (default base_link->odom, and the freedom to create the transform odom->map. The last part is important because a frame can only have one parent.

This is outside all the internal algorithm parameters. It looks like you have all the essentials setup tf wise.

  • Can you verify that scan and map topics are published properly?
  • If topics from STDR are being pushed down into namespaces, make sure to change the appropriate topics in amcl (post the output of rostopic list, and check rosnode info amcl to make sure it's subscribing correctly).
  • Have you tried turning on debug messages for amcl?

For the costmap error, are you also running move_base? You should disable it for now and see if you can get localization (amcl) working properly first.

edit flag offensive delete link more

Comments

a very clear answer, thanks :). It turned out that the published laser data had robot0_laser0 as frame_id where amcl was expecting base_laser_link. Digging through the stdr code and changing it manually solved my problem.

Mehdi. gravatar imageMehdi. ( 2014-09-25 21:08:58 -0500 )edit

what do you mean by "the freedom to create the transform odom->map". I have a similar problem, and seems that first 3 things are there, but what is the fourth one?

gavran gravatar imagegavran ( 2016-02-28 12:26:34 -0500 )edit

@gavran the transform between odom and map in the ROS framework generally starts as an identity matrix with both odom and map frames being overlapped. While the robot moves, it will start drifting due to the imperfection of its odometry and that can be compensated by changing odom->map

Mehdi. gravatar imageMehdi. ( 2016-03-03 07:36:48 -0500 )edit

@Mehdi - so your solution was to keep this transform identity (and thus simulating perfect odometry)? However, I am wondering about the expression freedom to create transform. So in case I don't want to make it identity, how do I let amcl do it?

gavran gravatar imagegavran ( 2016-03-03 08:49:40 -0500 )edit

Well when you start amcl and everything else is available (laser scans, map etc), it should start publishing that transform for you, as said in my first comment, my problem was just that the frame_ids of the laser data was were wrong.

Mehdi. gravatar imageMehdi. ( 2016-03-04 06:31:16 -0500 )edit
0

answered 2019-06-19 11:42:19 -0500

sajal gravatar image

You add this line in you amcl_diff/omni.launch file = " ". This is set to false by default in amcl_node.cpp. You can also add global_fame_id to /map and your odom_frame_id to your odometry topic (I think /odom) in the launch file. amcl_node.cpp has a inbuilt function to publish map to odom tf. It worked for me.

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

1 follower

Stats

Asked: 2014-09-24 21:15:19 -0500

Seen: 4,131 times

Last updated: Jun 19