0
$\begingroup$

Rosanswers logo

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


Originally posted by Fahad on ROS Answers with karma: 111 on 2013-11-26

Post score: 8

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by Stefan Kohlbrecher with karma: 24361 on 2014-01-23

This answer was ACCEPTED on the original site

Post score: 8


Original comments

Comment by musiqsoulchild on 2015-03-16:
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 in the launch file?

Comment by Stefan Kohlbrecher on 2015-03-18:
yes, that should work.

Comment by parzival on 2020-12-12:
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!

Comment by zlg9 on 2021-08-04:
I am applying the same config (https://github.com/tu-darmstadt-ros-pkg/hector_slam/blob/correct_odometry_publisher/hector_slam_launch/launch/odom_test.launch), 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.

Comment by jacob_lee on 2021-11-01:
hi @zlg9, It is true that hector does not publish base_link --> odom, according to gmapping roswiki, this transformation is "usually provided by the odometry system (e.g., the driver for the mobile base)". Have are u able to get amcl worked on hector if this TF is absent?

$\endgroup$

Your Answer

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