engcang / FAST-LIO-SAM

a SLAM implementation combining FAST-LIO2 with pose graph optimization and loop closing based on LIO-SAM paper
Other
159 stars 17 forks source link

Question about keyframes #2

Closed juliangaal closed 1 year ago

juliangaal commented 1 year ago

Thanks for creating this great resource.

I have a question regarding keyframes: You add keyframes after a certain threshold here

https://github.com/engcang/FAST-LIO-SAM/blob/dd52362a49d3421834df223362d959703d59e9e7/fast_lio_sam/src/methods.cpp#L41-L44

and update the poses here:

https://github.com/engcang/FAST-LIO-SAM/blob/dd52362a49d3421834df223362d959703d59e9e7/fast_lio_sam/src/callbacks.cpp#L184-L189

Yet, the visualization looks like every single pose has been added as an OdomFactor (like in i.e. LIO-SAM). How is every single pose corrected, when the pose graph only includes keyframes? Thanks for your help

engcang commented 1 year ago

Hi @juliangaal. Thank you for your interests in my work.

If you look into here, https://github.com/engcang/FAST-LIO-SAM/blob/dd52362a49d3421834df223362d959703d59e9e7/fast_lio_sam/src/callbacks.cpp#L38

the nav_msgs/Path (trajectory) and sensor_msgs/PointCloud2 (odometries) are updated and added here only if it is keyframe.

https://github.com/engcang/FAST-LIO-SAM/blob/dd52362a49d3421834df223362d959703d59e9e7/fast_lio_sam/src/callbacks.cpp#L61

So the answer is, visualization does not add every single poses but only keyframes.

Similarly, I only corrected the keyframes in the code block where you already attached in your comment.

juliangaal commented 1 year ago

Then how were you able to produce this image where the keyframes (big dots?) and the trajectory (way more points?) are matched?

engcang commented 1 year ago

That is the just visualization of the trajectory (nav_msgs/Path) and odometries (sensor_msgs/PointCloud2) with only keyframes... Did you try to run the code? You will see how it works...

juliangaal commented 1 year ago

Ah, ok, I misunderstood what you were doing. Thanks!