Ask Your Question
6

Using hector slam with amcl for localization in a pre-made map

asked 2013-11-26 07:34:06 -0500

Fahad gravatar image

I wanted to exploit the fact that hector_mapping gives pretty accurate position estimate. I used the position estimate to find odometry and now hector_mapping successful publishes the odom message and gives the required tf. But when I run amcl and publish an already created map using map_server everything messes up because now both the hector_mapping and
map_server are publishing maps. Even if I remap the hector mapping map to something else to divert it my tf is disturbed. Please help how to resolve this issue

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
8

answered 2014-01-23 16:39:28 -0500

updated 2014-01-23 16:41:46 -0500

Hi, just stumbled across your question. Might be a little late, but the following should allow to use both at the same time:

  • Remap the map topic of hector_mapping away
  • Set the pub_map_odom_transform parameter to "false"
  • If you want odometry published, set the pub_odometry parameter to "true"

/edit: Duplicate of this Q/A

edit flag offensive delete link more

Comments

1

Just came across this post and I'm trying to do the same thing. I can't find the parameter for where the map topic is being published by hector_mapping. I know its /map but not sure how to remap it somewhere else.

Maybe putting <remap from="map" to="maphector"/> in the launch file?

musiqsoulchild gravatar image musiqsoulchild  ( 2015-03-16 01:43:13 -0500 )edit
1

yes, that should work.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2015-03-18 03:05:01 -0500 )edit

This worked for me, but I have few concerns. First, since the mapping is also active and we're just ignoring it, if the map gets spoiled, due to searchangledir too large kind of error let's say, this would affect the new odometry and would spoil the final localization as well right? Second, is there a way to turn of mapping or map updates, since we don't need it and it wastes the computational resources? Thanks!

parzival gravatar image parzival  ( 2020-12-12 00:17:36 -0500 )edit

I am applying the same config (https://github.com/tu-darmstadt-ros-p...), but it doesn't create a transform between base_link and odom. So AMCL fails to catch the laser scan. It instead, creates a separate transform between odom and map.

zlg9 gravatar image zlg9  ( 2021-08-04 10:05:29 -0500 )edit
0

answered 2020-11-03 04:43:42 -0500

ROSKam gravatar image

After remapping the topics, don' forget to set scan_subscriber_queue_size to 1.

edit flag offensive delete link more

Comments

Why is this necessary?

parzival gravatar image parzival  ( 2020-12-12 00:12:19 -0500 )edit

I think hector slam supplies older data to amcl with default scan_subscriber_queue_size of 5. In my case, amcl did not work with this setting. I changed it to the minimum value of 1 and it worked.

ROSKam gravatar image ROSKam  ( 2020-12-12 11:08:06 -0500 )edit

It actually worked fine for me with the param set to 5. Are you sure you didn't change anything else? Or do you think it would perform even better with your setting?

parzival gravatar image parzival  ( 2020-12-15 00:28:23 -0500 )edit

This might be an issue if the system is slow in processing. Putting the queue size to 1 might be assuring the latest data to amcl.

ROSKam gravatar image ROSKam  ( 2021-04-02 01:41:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

4 followers

Stats

Asked: 2013-11-26 07:34:06 -0500

Seen: 3,511 times

Last updated: Jan 23 '14