Skip to content

Jiwenc nv/robot viz - #995

Draft
jiwenc-nv wants to merge 1 commit into
mainfrom
jiwenc-nv/robot-viz
Draft

Jiwenc nv/robot viz#995
jiwenc-nv wants to merge 1 commit into
mainfrom
jiwenc-nv/robot-viz

Conversation

@jiwenc-nv

@jiwenc-nv jiwenc-nv commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Description

The MuJoCo-backed digital twin was buried in examples/mujoco_xr — compiled as part of that example, reachable only by installing it, and gated on the developer having a matching mujoco wheel. It is a Televiz capability, not an example. The backend moves to src/viz/robot_twin and its Python surface to isaacteleop.viz.robot, both shipping in the wheel; the app that is left behind is renamed examples/robot_viz.

deps/third_party now fetches MuJoCo and builds it under a private name, reached through dlopen/dlsym so the extension carries no undefined mj* for a foreign libmujoco to answer. Mujoco.cmake beside it states that contract. Users may pip install mujoco at any version, or none.

Two calls for a reviewer: the wheel now redistributes MuJoCo binaries, and every BUILD_VIZ build compiles it with no opt-out (~40 s, needs libegl-dev).

No tests here — they are #999, one commit on top of this branch. This alone drops six test files that exist on main, so the two should land together.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

isaacteleop_examples.mujoco_xr is gone; the docs that referenced it are updated.

Testing

ctest on Linux aarch64 (Jetson AGX Orin), Release, CUDA, Python 3.12: 316 passed, 0 failed. #999 on the same machine is 330 / 0.

readelf on the built artifacts confirms the isolation: one export, no libmujoco or EGL NEEDED, private SONAME, SYMBOLIC set.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the linter and formatter with SKIP=check-copyright-year pre-commit run --all-files
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix/feature works (or explained why not)
  • I have signed off all my commits (git commit -s) per the DCO

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

Comment thread src/python/isaacteleop/retargeters/__init__.py Fixed
Comment thread src/python/isaacteleop/retargeters/__init__.py Fixed
Comment thread src/python/isaacteleop/retargeters/__init__.py Fixed
Comment thread src/python/isaacteleop/retargeters/__init__.py Fixed
Comment thread src/python/isaacteleop/viz/robot/__init__.py Fixed
Comment thread src/python/isaacteleop/teleop_session_manager/twin_runner.py Dismissed
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/robot-viz branch 2 times, most recently from 7e638fd to f5de61f Compare August 21, 2026 23:51
Comment thread src/python/isaacteleop/viz/robot/__init__.py Dismissed
@jiwenc-nv jiwenc-nv mentioned this pull request Aug 23, 2026
6 tasks
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/robot-viz branch from 124b2f0 to bce10b7 Compare August 23, 2026 22:10
jiwenc-nv added a commit that referenced this pull request Aug 23, 2026
The follow-up half of #995, which carries the twin with every test stripped out.
All 20 files land here: src/viz/robot_twin_tests, examples/robot_viz/tests, the
four src/viz/python_tests/test_robot_*.py, test_engage_gate.py and
test_robot_twin_session.py, plus the CMake that registers them and the example
README's Tests section.

test_symbol_isolation.py runs against the shipped _robot_twin rather than a
test-only extension carrying a second private MuJoCo. Review asked why the tests
reached MuJoCo directly, and they should not have: that probe's two unique
assertions exercised its own reimplemented longjmp handler rather than
mj_guard.cpp, and its ELF assertions were the weaker copy of ones the shipped
module already gets -- --version-script has nothing to hide in a module linking
no static archive, and the shipped one links cudart_static. Two replacements do
cover shipped code: that install_mujoco_handlers() wrote the twin's own
mju_user_error and not the wheel's, and that an unguarded mju_error reaches
mj_guard.cpp's abort rather than MuJoCo's exit(1).

The example's tests are keyed on TARGET robot_twin_py, which says the actual
dependency instead of restating where the twin gets built.

Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
Comment thread src/viz/CMakeLists.txt Outdated
Comment thread .gitignore
Comment thread CMakeLists.txt Outdated
Comment thread deps/third_party/CMakeLists.txt Outdated
Comment thread deps/third_party/CMakeLists.txt Outdated
Comment thread deps/third_party/CMakeLists.txt Outdated
Comment thread docs/source/getting_started/build_from_source/index.rst Outdated
Comment thread docs/source/getting_started/build_from_source/index.rst Outdated
jiwenc-nv added a commit that referenced this pull request Aug 24, 2026
Review feedback on #995.

Scene::forward called mj_forward -- full forward dynamics, including collision,
constraint solve, CRB inertia, actuation and sensors -- once per rendered frame,
and nothing read any of it. It is now mj_kinematics + mj_camlight, the position
stage mjv_updateScene actually needs. A scene using tendons or rangefinder
sensors would render those wrong under this; ours has neither, and the joint map
already rejects anything but hinges.

The build cannot shed the rest: upstream ships one libmujoco with no
renderer-only target, so the ~40 s is the whole library either way.

Also drops ISAACTELEOP_MUJOCO_VERSION and the Mujoco.cmake references to
robot_twin_tests -- the tests read the isolation off the built artifact, not off
a CMake variable -- the GIT_SHALLOW essay, the two build-doc paragraphs, and the
robot_twin/CMakeLists.txt stub whose whole body was add_subdirectory(cpp).

Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
The MuJoCo-backed digital twin was buried in examples/mujoco_xr -- compiled as
part of that example, reachable only by installing it, and gated on the
developer having a matching mujoco wheel. It is a Televiz capability, not an
example. The backend moves to src/viz/robot_twin and its Python surface to
isaacteleop.viz.robot, both shipping in the wheel; the app left behind is
renamed examples/robot_viz and is pure Python.

deps/third_party fetches MuJoCo and builds it under a private name, reached
through dlopen/dlsym so the extension carries no undefined mj* for a foreign
libmujoco to answer. Mujoco.cmake states that contract. Users may pip install
mujoco at any version, or none.

The twin poses and renders and never integrates, so it runs mj_kinematics +
mj_camlight rather than mj_forward. EngageGate ships in viz.robot beside it:
its reference operand is measured off the SceneTwin, and the affordance needs
something drawing the arm.

Two calls for a reviewer: the wheel now redistributes MuJoCo binaries, and
every BUILD_VIZ build compiles it with no opt-out (~40 s, needs libegl-dev).

Tests are #999, one commit on top of this.

BREAKING: isaacteleop_examples.mujoco_xr is gone.
Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/robot-viz branch from 2166718 to 641d331 Compare August 24, 2026 18: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.

1 participant