koide3 / hdl_graph_slam

3D LIDAR-based Graph SLAM
BSD 2-Clause "Simplified" License
1.94k stars 723 forks source link

Why use prev.inverse to calculate the delta transformation between the previous keyframe and new frame? #154

Closed FishInWave closed 3 years ago

FishInWave commented 3 years ago

hi, @krisklau, @koide3 https://github.com/koide3/hdl_graph_slam/blob/master/include/hdl_graph_slam/keyframe_updater.hpp In keyframe_updater.hpp: 43-45,( prev_keypose.inverse() * pose).translation().norm() is used to calculate the delta transformation between the previous keyframe and new frame. Eigen::Isometry3d delta = prev_keypose.inverse() * pose; double dx = delta.translation().norm(); double da = std::acos(Eigen::Quaterniond(delta.linear()).w()); But why not just use (pose - prev_keypose.inverse()).translation().norm()to calculate the dx? Did I miss anything?

FishInWave commented 3 years ago

Maybe I have got the difference between this two method. Yours represents delta_translation in base_link frame, and mine represents delta_translation in map frame. Sorry to disturb you.