fix(foundationpose): fix tf_to_center sign inversion in pose decoder#93
Open
HRXWEB wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
Open
fix(foundationpose): fix tf_to_center sign inversion in pose decoder#93HRXWEB wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
HRXWEB wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
Conversation
The mesh vertices are centered by subtracting mesh_model_center during loading. To convert the internal pose back to original mesh coordinates, the decoder should use -mesh_model_center. The current code uses +mesh_model_center, producing t_api = t + R*c instead of t - R*c, which introduces a systematic 2*R*c translation error. The original Python implementation (estimater.py) correctly uses the negative sign in get_tf_to_centered_mesh(). Fixes NVIDIA-ISAAC-ROS#92 Signed-off-by: Ruixin Huang <ruixin.huang@novauto.com.cn>
Author
|
@chengronglai Could you please take a look at this fix? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
mesh_model_centerinfoundationpose_decoder.cppwhen composingtf_to_center+mesh_model_centerbut should use-mesh_model_center, matching the original Python implementation (estimater.py:get_tf_to_centered_mesh())2 * R * mesh_model_centerin the output poseDetails
Mesh vertices are centered during loading:
v_stored = v_original - center. The internal pose maps centered vertices to camera:p_cam = R * (v - c) + t. The API pose should map original vertices:t_api = t - R*c, requiringtf_to_center = [I | -c].The bug used
+c, producingt_api = t + R*c— a2*R*coffset. For a mesh with bbox center ~22mm from origin, this results in ~44mm systematic translation error.Fixes #92
Test
Tested on QR0008 industrial part (20 scenes): translation error dropped from ~44mm to ~2mm after fix, matching the Python implementation's accuracy.