Skip to content

Use Teleop Core retargeters instead of custom code in the ROS 2 node#373

Closed
sgrizan-nv wants to merge 1 commit intomainfrom
sgrizan/branch1
Closed

Use Teleop Core retargeters instead of custom code in the ROS 2 node#373
sgrizan-nv wants to merge 1 commit intomainfrom
sgrizan/branch1

Conversation

@sgrizan-nv
Copy link
Copy Markdown
Collaborator

@sgrizan-nv sgrizan-nv commented Apr 8, 2026

Summary by CodeRabbit

  • New Features

    • Teleoperation example now supports unified bimanual control with a single combined finger-joint output.
  • Refactor

    • Moved world-transform handling into the retargeting pipeline.
    • Simplified pose/message construction by removing client-side transform mutations.
    • Streamlined pipeline outputs and runtime flow for controller/hand data.

@sgrizan-nv sgrizan-nv self-assigned this Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1bc0c9ef-bbb4-4c44-993b-0e26016c9afe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change refactors transform handling in the teleop_ros2_publisher by shifting from client-side pose mutation to retargeting-engine pipeline inputs. The TriHandMotionControllerRetargeter is replaced with TriHandBiManualMotionControllerRetargeter, consolidating separate left/right retargeting streams into a single bimanual model. Transform matrices are now wired as ValueInput objects into the pipeline via .transformed() methods, eliminating the need for manual pose-level adjustments in message builders. The run() method is updated to pass external transform inputs to session.step() and consume the unified finger_joints output instead of separate left/right streams.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Key review focuses:

  • Verify correct wiring of TensorGroup(TransformMatrix()) into the pipeline and proper usage of .transformed() on hands/controllers
  • Confirm the bimanual retargeter correctly processes transformed inputs and produces the expected unified finger_joints output
  • Validate that session.step(external_inputs=...) properly receives and applies the world transform matrix
  • Ensure message builders no longer apply transforms redundantly (removed transform parameters)
  • Check that controller teleop logic correctly consumes controller_left_world and controller_right_world outputs
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: migrating from custom pose transformation code to Teleop Core retargeters, which is the primary objective of this refactoring.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sgrizan/branch1

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/teleop_ros2/python/teleop_ros2_publisher.py`:
- Around line 789-800: The block handling result["finger_joints"] should first
guard against None like the other fields (e.g., left_hand/right_hand and
left_ctrl/right_ctrl); update the controller_teleop branch to check
result["finger_joints"].is_none (or truthiness) before calling
_joint_names_from_group or list(finger_joints) and only build/publish the
JointState (finger_joints_msg) when finger_joints is present; reference the
variables/functions self._mode == "controller_teleop", result["finger_joints"],
_joint_names_from_group, and self._pub_finger_joints.publish to locate where to
add the guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 966a451a-3374-4124-85de-b58a5bf2bd02

📥 Commits

Reviewing files that changed from the base of the PR and between f420f71 and 59e6466.

📒 Files selected for processing (1)
  • examples/teleop_ros2/python/teleop_ros2_publisher.py

Comment thread examples/teleop_ros2/python/teleop_ros2_publisher.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: DONE

Development

Successfully merging this pull request may close these issues.

1 participant