Skip to content

fix(foundationpose): fix tf_to_center sign inversion in pose decoder#93

Open
HRXWEB wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
HRXWEB:fix/tf-to-center-sign
Open

fix(foundationpose): fix tf_to_center sign inversion in pose decoder#93
HRXWEB wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
HRXWEB:fix/tf-to-center-sign

Conversation

@HRXWEB
Copy link
Copy Markdown

@HRXWEB HRXWEB commented Apr 11, 2026

Summary

  • Fix inverted sign of mesh_model_center in foundationpose_decoder.cpp when composing tf_to_center
  • The decoder used +mesh_model_center but should use -mesh_model_center, matching the original Python implementation (estimater.py:get_tf_to_centered_mesh())
  • This caused a systematic translation error of 2 * R * mesh_model_center in the output pose

Details

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, requiring tf_to_center = [I | -c].

The bug used +c, producing t_api = t + R*c — a 2*R*c offset. 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.

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>
@HRXWEB
Copy link
Copy Markdown
Author

HRXWEB commented Apr 11, 2026

@chengronglai Could you please take a look at this fix? Thanks!

@jaiveersinghNV jaiveersinghNV requested a review from yuanknv April 13, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FoundationPose decoder: tf_to_center sign is inverted, causing 2*R*c translation error

1 participant