vectr-ucla / direct_lidar_inertial_odometry

[IEEE ICRA'23] A new lightweight LiDAR-inertial odometry algorithm with a novel coarse-to-fine approach in constructing continuous-time trajectories for precise motion correction.
MIT License
530 stars 103 forks source link

Issue with submap generation #10

Closed YWL0720 closed 1 year ago

YWL0720 commented 1 year ago

Great work! While studying your code, I noticed that the submap generated by performing ICP with each frame of point cloud seems to be generated based on the estimated state from the previous frame, rather than being generated based on the predicted state of the current frame. Specifically, it appears that the "getNextPose" function is executed before the "buildKeyframesAndSubmap" function. This seems to deviate from what is described in the paper. I would like to kindly ask if my understanding is correct. If so, what are the advantages of doing it this way? Thank you very much in advance for any response you can provide.

kennyjchen commented 1 year ago

Hi @YWL0720 -- thanks for the question. The function getNextPose() uses the current frame to update the state, so we are using the predicted state of the current frame when building the next submap. That's in case the current frame is determined to be a keyframe, so that that keyframe can be used in the subsequent iteration of scan-matching.

In any case though, buildKeyframesAndSubmap() is in a separate asynchronous thread that is only executed when resources are available and a submap isn't already currently being built, so the order of operations is not strictly guaranteed. This is to reduce potential "spikings" in computation time, as building a submap is quite expensive and can bottleneck the algorithm for real-time use. Doing it this way ensures that the callback executes in a timely manner, and scan-matching with an older submap is rarely an issue since we do keyframe-based submapping (so it changes at a lot slower rate).

YWL0720 commented 1 year ago

Thank you for your response, it has cleared up my confusion.