RobustFieldAutonomyLab / LeGO-LOAM

LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain
BSD 3-Clause "New" or "Revised" License
2.32k stars 1.11k forks source link

mapOptimization crashes when robot starts moving #280

Open astef3 opened 5 months ago

astef3 commented 5 months ago

Hi, first of all I want to say that you did amazing job with the algorithm and its really nice work. However I have experienced some issue that I was not able to fix.

I have integrated LeGO-LOAM in my ROS workspace on Noetic, Ubuntu 20.04 by following the tutorial at https://www.reddit.com/r/ROS/comments/13tqq7a/3d_slam_with_lego_loam_ros_noetic/.

At first, when I was running it everything was working perfectly, the estimated odometry was extremely good and also the mapping was really detailed, which was amazing. However, currently when I run the algorithm I get some weird behaviour. So I am running the command: roslaunch lego_loam run.launch And everything seems to set up nicely, as shown on the image delow: Screenshot from 2024-01-17 14-19-55

Then I run the following command in order to play my Point Cloud from rosbag file: rosbag play velodyne_points.bag --clock --topic /velodyne_points And when the robot starts moving (point cloud message is being played), the algorithm crashed with the exception displayed in the image bellow:

Screenshot from 2024-01-17 14-23-57

Now I did a little debugging and as far as I have understood, the algorithm crashes, when it comes to this part of the code in mapOptimatization.cpp:

isam->update(gtSAMgraph, initialEstimate);
isam->update();
gtSAMgraph.resize(0);
initialEstimate.clear();

More specifically in the : isam->update(gtSAMgraph, initialEstimate); line.

I would really appreciate if anyone can help me with this issue! Thank you in advance and in case anyone needs more information or data in order to recreate the issue I will deliver it right away!!!