SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.5k stars 497 forks source link

Map overlapping problem #681

Open anasderkaoui opened 3 months ago

anasderkaoui commented 3 months ago

Hello ! -> My setup:

-> The problem:

I can successfully generate a map, but when I move the robot or when odometry data changes, I get a new scan of the map but overlapping the previous one ! (Fixed Frame is set to "map" and sometimes to "base_footprint" but still got the same behavior) I want the map to stay put in place (static, not moving with the robot) while the robot is moving to scan the reaminning blank spaces. I have also tried this with gmapping and got the same problem. Is there a parameter to change in order to fix that ?

Thanks in advance!

RoboCrafty commented 3 months ago

Could be some issue with your tf. Triple check the laser to base link tf in your urdf.

anasderkaoui commented 3 months ago

I am not using a URDF, only tf from the drivers' packages. I checked running: ros2 run tf2_tools view_frames and I got the required tf tree: map -> odom -> base_link -> lidar_frame. I think that if the tf was not set properly, the SLAM algorithm wouldn't even wanna start ! Also on RVIZ, when I add the TF display, I get "Status Ok" with all the Transforms mentionned above! From some other sources, I found that this maybe due to the LiDAR moving very quickly and jerking. I think this may be the case, I still have to test that!

RoboCrafty commented 3 months ago

Nah I mean the tf needs to be correct. An incorrect TF can cause this as far as I know since I had a very similar issue. An Incorrect tf would also look completely normal on the tree.

anasderkaoui commented 3 months ago

Okay, thank you. How do I know if my tf is correct then ?