fix the coordinate transformation with odometry #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the same problem with request #55
There are several issue in the use of coordinate system in the original pose. At #55 @siega-k tries to fix the issue. Generally, he's correct if you follow the comment on the code. I've came to the same conclusion at my first attempt
Despite the problem is much more complicated than I've thought, the solution is actually very simple and elegant. Please see this visualization
Explaination: The ICP matcher requires the scan from the keyframe and the current scan. It will output the pose of current scan in the keyframe scan, namely "corr_ch_l". So, if we have odometry, we would need to provide a prediction of the "corr_ch_l". Since "corr_ch_l" is attached to the laser_frame, we would need a vector pointing from the laser_frame@keyframe to laser_frame@now.
The original code mistakenly think tf1 * tf_something * tf1.inverse() would be the transformation of coordinate system, i.e. switch of basis. However, this actually accidentally gives the proper transition of the output "corr_ch_l". ( step3 of my visualization ). But is in fact incorrect.
P.s. All my calculation process is recorded here