laboshinl / loam_velodyne

Laser Odometry and Mapping (Loam) is a realtime method for state estimation and mapping using a 3D lidar.
http://wiki.ros.org/loam_velodyne
Other
1.71k stars 952 forks source link

NaN and INF valued points is not fully checked #132

Closed annt3k closed 5 years ago

annt3k commented 5 years ago

Hi all, I have a dataset which produce some error so I have found where is the problem and would like to fix some code.

https://github.com/laboshinl/loam_velodyne/blob/25db5dd5b2c135e779a50a11af0a53434598df7e/src/lib/MultiScanRegistration.cpp#L165

https://github.com/laboshinl/loam_velodyne/blob/25db5dd5b2c135e779a50a11af0a53434598df7e/src/lib/MultiScanRegistration.cpp#L166

In these code, the first and last point is not NaN checked, which may affect the intensity value of all points in one scan. Offcourse the problem is with the dataset but I found there is some code to check the NaN point and skip it like https://github.com/laboshinl/loam_velodyne/blob/25db5dd5b2c135e779a50a11af0a53434598df7e/src/lib/MultiScanRegistration.cpp#L186 So I think It would be better to do it for the first and last point too.

For the solution, I think we should increase the first point index until startOri is valid and decrease the last point index until endOri is valid.

This is the dataset which you can reproduce the problem https://vision.eng.au.dk/future-cropping/uav_lidar/#RecordedRosbagDatasets

If there is other better solution, please leave a comment.