ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Map and Laser error

asked 2022-06-18 09:27:34 -0500

Os7 gravatar image

Hello all I am facing an issue when trying to navigate, the laser and the saved map data don't match causing some problems when giving a goal location and even when i give a pose there is still a big miss match between them .. how could solve this issue and what might by the cause for it ?
I am using RPlidar that is mounted on top of the robot with a differential drive robot that is getting odom data from two incremental encoders. Here is the map and laser And here is the Rqt graph

edit retag flag offensive close merge delete


Over time, the odometry pose from your wheel encoders will slowly accumulate error. How are you correcting for this?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-19 07:29:15 -0500 )edit

I don't know, the problem happens when the robot is rotating when the navigation goal is a straight line it work well

Os7 gravatar image Os7  ( 2022-06-19 07:54:33 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2022-06-19 09:38:57 -0500

Mike Scheutzow gravatar image

updated 2022-06-19 09:42:48 -0500

You need to add a new ros node that corrects for the odometry drift. Some people use the ros amcl package for this.

amcl is a Global Localizer. It takes the laser scan and the map as input, and aligns multiple lidar scans to the map to determine the robot's current map pose. Then it publishes a new map->odom transform, which has the effect of correcting any drift in the odom->base_link transform. If I remember correctly, the standard ros amcl node does this calculation only once, so you'll need code to re-trigger the calculation after it finishes.

The reason you need both amcl and wheel-encoder-odom for robot pose is that amcl is slow - it can take more than 1 second for it to decide where the robot is currently.

edit flag offensive delete link more


I have amcl node running, but from what i have understood from what you said i need to keep re-triggering it like every X seconds? Any idea how i can do this or an example you can refer me to Thanks alot

Os7 gravatar image Os7  ( 2022-06-19 10:14:31 -0500 )edit

The amcl node provides a ros service to do this. Here's how it's used from the command line:

rosservice call /global_localization "{}"

I wouldn't try to do this too often; keep at least a few seconds between calls.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-19 11:30:12 -0500 )edit

Alright will test this and see how things go thanks for the help

Os7 gravatar image Os7  ( 2022-06-19 11:35:00 -0500 )edit

Instead of amcl, the laser_scan_matcher can also be used to correct odom drift. It's much faster. Just be aware this is a Tracker, not a Global Localizer.

It's harder to use because it doesn't publish map->odom for you.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-19 11:39:58 -0500 )edit

Question Tools

1 follower


Asked: 2022-06-18 09:27:34 -0500

Seen: 383 times

Last updated: Jun 19 '22