Skip to content

examples(teleop_ros2): package under isaacteleop_examples - #1039

Open
jiwenc-nv wants to merge 2 commits into
jiwenc-nv/examples-mcap-record-replayfrom
jiwenc-nv/examples-teleop-ros2
Open

examples(teleop_ros2): package under isaacteleop_examples#1039
jiwenc-nv wants to merge 2 commits into
jiwenc-nv/examples-mcap-record-replayfrom
jiwenc-nv/examples-teleop-ros2

Conversation

@jiwenc-nv

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

Copy link
Copy Markdown
Collaborator

Description

Part of #985. Stacked on #1038.

Fifteen modules imported their siblings as top-level modules — constants, messages, geometry, assets, session_config and the rest — which resolved only because the invoked script's own directory landed on sys.path. That broke under python -m, broke when copied into another project, and claimed an unusually generic set of names. This moves the tree to the layout in examples/README.md.

Two workarounds propping this up are deleted, which is the evidence the packaging is real rather than relocated:

  • pythonpath = ["."] in the pyproject
  • the example source directory on the ctest PYTHONPATH

The tests reach the in-tree source through a conftest.py instead, mirroring mujoco_xr's, so a bare pytest in that directory works for the first time. Six test import lines change; no assertion does.

The node keeps its filename and gains a __main__.py, so the container entry point becomes python -m isaacteleop_examples.teleop_ros2 and still forwards --ros-args. The install tree drops a level, so the Dockerfile WORKDIR follows, as do the three invocations in build-ubuntu.yml.

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

Testing

x86_64 / Ubuntu, Python 3.12. Wheel ships 15 modules under isaacteleop_examples/teleop_ros2/ with no namespace __init__.py. Editable-installed into a clean venv, the ROS-free modules (constants, tensor_group_helpers) import with the CWD outside the repo; import constants fails, so the flat names are gone rather than relocated. The new conftest.py was checked to resolve to examples/teleop_ros2/python with the package present and no namespace __init__.py. All test files compile. pre-commit clean.

Not run: ctest -L teleop_ros2 — no ROS 2 on this host, so geometry_msgs and rclpy are unavailable. That suite and the container entry point are what CI should be trusted for here; please treat the CI run as the gate rather than my local checks.

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

No new tests: this is a move. The existing suite is the check — it exercises every moved module and passes with only its import lines changed.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: Enterprise

Run ID: d58e75e3-b5cc-4acc-a175-a979325602f1

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

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

@jiwenc-nv
jiwenc-nv requested a review from sgrizan-nv August 28, 2026 04:59
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch from 9b577b0 to 008c2a4 Compare August 28, 2026 05:00
@jiwenc-nv
jiwenc-nv changed the base branch from jiwenc-nv/examples-deviceio-live-view to jiwenc-nv/examples-mcap-record-replay August 28, 2026 05:01
@jiwenc-nv
jiwenc-nv requested a review from ivany-nv August 28, 2026 05:11
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch from 008c2a4 to b71f0e1 Compare August 28, 2026 05:22
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch from b71f0e1 to a212d0a Compare August 28, 2026 05:32
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch from a212d0a to 56ba82a Compare August 28, 2026 05:44
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch 2 times, most recently from ae449ca to 8d2a267 Compare August 28, 2026 14:46
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch from 8d2a267 to d5b5fee Compare August 28, 2026 16:10
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch 2 times, most recently from 1d6e024 to 9c120d4 Compare August 29, 2026 00:21
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch 2 times, most recently from 24146a4 to bc00f31 Compare August 30, 2026 16:23
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch 2 times, most recently from cfef590 to 17ca7d8 Compare September 2, 2026 16:13
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch from 17ca7d8 to 31f589b Compare September 3, 2026 15:54
Nine modules imported `common` as a top-level module, which resolved only
because the invoked script's own directory landed on sys.path -- so they broke
under `python -m`, broke when copied into another project, and claimed the very
generic bare name `common`. Move the tree to the layout in examples/README.md.
Twelve co-equal scripts, so no __main__.py; the README maps channel to
live/record/replay.

Behaviour change forced by the move: recordings default to ./recordings/
relative to the working directory rather than a path derived from __file__,
which after the move points inside the package and for an installed copy would
have written into site-packages. Replay searches the same directory.

Three deliberate viewer fixes. The seven viser viewers bind 0.0.0.0 rather than
127.0.0.1, since they run where the hardware is and get opened from a laptop;
--host 127.0.0.1 restores it. Each startup line reports the bind instead of
always printing "localhost". And the grid lay in viser's default XY plane,
which stands up as a wall once the up direction is +y: it is now an xz ground
plane with the camera centred on it, as one helper in common.py rather than
seven copies.

Part of #985.

Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
Fifteen modules imported their siblings as top-level modules -- constants,
messages, geometry, assets, session_config and the rest -- which resolved only
because the invoked script's own directory landed on sys.path. That broke under
`python -m`, broke when copied into another project, and claimed a set of
unusually generic names. Move the tree to the layout in examples/README.md.

Two workarounds propping this up are now gone, which is the evidence the
packaging is real rather than relocated: `pythonpath = ["."]` in the pyproject,
and the example source directory on the ctest PYTHONPATH. The tests reach the
in-tree source through a conftest.py instead, mirroring mujoco_xr's, so a bare
`pytest` in that directory works for the first time.

The node keeps its filename and gains a __main__.py, so the container entry
point becomes `python -m isaacteleop_examples.teleop_ros2` and still forwards
--ros-args. The install tree drops a level, so the Dockerfile WORKDIR follows.

Part of #985.

Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc-nv/examples-teleop-ros2 branch from 31f589b to 774a9f0 Compare September 3, 2026 22:13
@ivany-nv

ivany-nv commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

A heads-up about this PR's base rather than its own content: the branch is still
built on the pre-rebase copy of the mcap_record_replay packaging commit, so it
carries versions of files that #1038 has since fixed.

This head (774a9f0f4) sits on 091b91cb2 examples(mcap_record_replay): package under isaacteleop_examples and does not contain #1038's current head
887db467. The same holds all the way up the stack — #1047 also resolves to
091b91cb2.

So the three commits #1038 picked up on 2026-09-08 are absent here:

  • 681bc222b — bind viser viewers to every interface by default
  • 0981f53ff — filter replay auto-discovery by recording type
  • 887db467f — ignore /recordings/ written from the repo root

Checkable on the two heads:

$ git show 774a9f0f4:examples/mcap_record_replay/python/isaacteleop_examples/mcap_record_replay/replay_full_body.py | sed -n 66p
    candidates = list(recordings.glob("*.mcap"))

$ git show 887db467f:examples/mcap_record_replay/python/isaacteleop_examples/mcap_record_replay/replay_full_body.py | sed -n 66p
    candidates = list(recordings.glob("full_body_*.mcap")) or list(

$ git show 774a9f0f4:.gitignore | grep -c '^/recordings/'
0

Two consequences:

  1. Merging up the stack without a rebase would revert those fixes — the
    type-prefixed auto-discovery in particular, which is the one that stops
    replay_full_body from picking a controllers_*.mcap.
  2. Because the merge-base is old, this PR's diff currently renders as 50 files
    / +310 −137, most of which is the stale mcap_record_replay content rather
    than the teleop_ros2 change actually under review.

A rebase of #1039..#1047 onto the current #1038 head would clear both. I held
off reviewing the teleop_ros2 change itself for now, since the diff as shown
is not what would land — happy to pick it up once the base is current.

@ivany-nv

ivany-nv commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Verdict: a rebase onto #1038's current head looks unavoidable. #1038 was rebased after this stack branched, and both merge orders now conflict on the same three files — including on the very fix #1038 added, where a careless resolution would quietly undo it.

Concrete evidence for the baseline point raised earlier. The stack's 091b91cb2 is not an ancestor of #1038's current head 887db467. It was replaced by f7b37f939, followed by three more commits — one of which, 0981f53ff "filter replay auto-discovery by recording type", is the fix for the defect reported in the #1038 review.

Both merge orders conflict, on the same three files (replay_controller.py, replay_full_body.py, replay_hand.py):

order result
#1038 then stack #1038 clean, stack 3 conflicts
stack then #1038 stack clean, #1038 3 conflicts

So sequencing alone will not avoid it. The part worth flagging: the conflict sits on the fix itself — a merged file holds both glob("full_body_*.mcap") or glob("*.mcap") and the older bare glob("*.mcap"), so whoever resolves it could revert the fix without noticing.

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.

3 participants