/scan data being all over the place in RViz in a real robot

Hello, good morning!

Recently, I’ve been trying to understand a Neato XV-11 LIDAR that I have with me and get into the navigation stack, trying to learn how to work with laser data, scans, gmapping, amcl, move_base and all that, trying to learn with the Navigation course - though, I’m still fairly new at… everything, so I’ve been stumbling and doing incorrect stuff in a lot of things.

I’ve managed to make, somehow, the data from the /scan appear in rviz and generate a map with it, but when trying to work with the AMCL modules, some strange stuff happens.

One thing that’s striking me as really odd and that I don’t know how to fix is that the scan from the laser data and the map are in completely opposite sides. I’ve seen examples of the laser data following the map as the robot moves, but I can’t do that by any means, and I don’t really know what’s going wrong. When I start up AMCL, what I get is this:

That striked me as odd, but I decided to keep going. I used the 2D Pose Estimate button to estimate where my robot really was - that is, not outside the map -, and when that happened, the reading from the laser sensor decided to go even more wrong, kind of like it was glitching through the map, constantly tilting itself back and forth, like trying to get itself close from the real place where it should be.

I didn’t find a solution for this, but the PoseArray worked as it should when I positioned it with the Pose Estimate - as I moved my robot around, the lots of arrows that were in the RViz slowly disappeared and got together into something my precise. As I drove the robot around, it followed close to where it should be in the map.

I tried to ignore the scan data glitching around and execute the move_base node to generate a global costmap, but then the generated costmap decided to… include the scan data into the map, for some reason. That’s one of the most strange things that has happened between all of this.

I’ve tried to alter some parameters of the AMCL launch, like the max range, max/min particles, kld error, but to no avail - it keeps “glitching” through the map like this. Can anybody give me some light on how to proceed with this?

Thanks in advance!

It looks like you have a problem with the transform of the laser (from the frame of the laser scan to the frame of base_link). Can you please launch everything again, then go to rviz and display only all the TFs? Please post the image here.

1 Like

Oh, I manage to fix it! The problem was in the first launch file, where I tried to set up a link from map to odom myself, while the AMCL node was already trying to do that. When I removed that, it worked.

Thanks for the help, though!

1 Like