When try to find the feature correspondence, it try to search the second closest corner point in _lastCornerCloud. But the variable cornerPointsSharpNum is not the size of _lastCornerCloud, the real size of _lastCornerCloud is much larger than cornerPointsSharpNum. It is the Less Sharp Points Num, but not Sharp Points Number.
I don't know if it should be a bug, so I post this issue to talk about it.
https://github.com/laboshinl/loam_velodyne/blob/25db5dd5b2c135e779a50a11af0a53434598df7e/src/lib/BasicLaserOdometry.cpp#L262
When try to find the feature correspondence, it try to search the second closest corner point in _lastCornerCloud. But the variable cornerPointsSharpNum is not the size of _lastCornerCloud, the real size of _lastCornerCloud is much larger than cornerPointsSharpNum. It is the Less Sharp Points Num, but not Sharp Points Number.
for (int j = closestPointInd + 1; j < cornerPointsSharpNum; j++)
should change to
for (int j = closestPointInd + 1; j < _lastCornerCloud->points.size(); j++)