examples(mcap_record_replay): package under isaacteleop_examples - #1038
Conversation
|
Important Review skippedThe saved review history does not include the base for the last reviewed commit. This saved history cannot establish the base for an incremental review. Comment You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe MCAP record/replay example now installs as a Hatchling package and runs through Python module commands. Recording and replay default to the current working directory’s Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PythonModule
participant setup_scene
participant GroundGrid
participant FullBodyViz
PythonModule->>setup_scene: initialize the Viser scene
setup_scene->>GroundGrid: create the ground-grid controller
PythonModule->>FullBodyViz: pass the GroundGrid
FullBodyViz->>GroundGrid: forward body positions and validity
GroundGrid->>GroundGrid: smooth floor height and reframe cameras
Merge Risk: 🟡 Moderate · up to The examples can unintentionally expose tracking data, stage generated recordings, select incompatible replay files, and direct users to failing commands. These issues should be corrected before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 13 files. (8 skipped: 8 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
a205995 to
d1bd5c8
Compare
d1bd5c8 to
560ec3b
Compare
560ec3b to
b136d28
Compare
b136d28 to
601070f
Compare
601070f to
6ecf63e
Compare
|
Two things riding along with the move. The output directory is no longer gitignored. The README tells you to run from the repo root ( Seven more |
6ecf63e to
77e8b36
Compare
77e8b36 to
e7bf116
Compare
e7bf116 to
171b99c
Compare
171b99c to
ce025d1
Compare
ce025d1 to
3b96b07
Compare
common.py's GroundGrid (mcap_record_replay) and deviceio_viser.py's (deviceio_live_view, landed on main via #1034) are byte-identical. Not deduping: each example package is self-contained by design (see examples/README.md), and a shared helper would make one example depend on another. Leave a pointer in each copy instead of letting the duplication look accidental. Flagged by ivany-nv's verification pass on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
|
Verified this at 5faf201 with a clean build and install tree (not the source tree), plus a headless replay run driven by fixtures from User-facing text defects, both in files this PR already touches: ** Sphinx does not catch this and it ships in the rendered HTML. It also contradicts 887db46's own rationale ("its README has you run from the repo root") — if the rst heading is right, that Unrelated to this PR, for whoever picks it up: #1039–#1047 are still stacked on the pre-rewrite 091b91c, so the |
'Live preview' and 'Recording' both said 'From the example directory:' but gave uv pip install -e ./examples/mcap_record_replay, which is repo-root-relative -- run from the example directory it resolves to a nonexistent nested path. Say what the commands actually assume; it also matches 887db46's rationale for the root .gitignore rule. Also drops a stale .py suffix on a replay_full_body module reference a few lines above. Flagged by ivany-nv on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
good catch. fixed. |
…ng type resolve_mcap() picked the newest .mcap in the shared ./recordings/ directory regardless of source. If a replay's own recorder hasn't produced a file yet, a newer recording from a different recorder can be selected and fail with a missing-channel error. Prefer a type-prefixed match, falling back to the newest .mcap of any kind -- matching replay_se3_vive.py's existing pattern. Flagged by CodeRabbit on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
84ddcd1 to
d9ee810
Compare
…po root The recorders default to Path.cwd() / "recordings", and the README has you run from the repo root, so the existing examples/mcap_record_replay/.gitignore rule (scoped to that directory) never covers the output. Add a root-level /recordings/ rule. Flagged in review on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
…invocation Usage lines, --help text (argparse reads it from the module docstring), and error messages still told users to run these as scripts (python replay_full_body.py ...) after the move to package/module layout. Switch them to python -m isaacteleop_examples.mcap_record_replay.<name>, matching the README and rst; fix the same in the rst's Replaying section, which was the one block left in script form. Also updates the 'newest file' wording (docstrings, README, rst) for the type-prefixed auto-discovery from the prior commit, warns instead of silently degrading when resolve_mcap falls back to a wrong-type recording, and documents the --python 3.11 requirement for uv run. Flagged by ivany-nv's verification pass on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
common.py's GroundGrid (mcap_record_replay) and deviceio_viser.py's (deviceio_live_view, landed on main via #1034) are byte-identical. Not deduping: each example package is self-contained by design (see examples/README.md), and a shared helper would make one example depend on another. Leave a pointer in each copy instead of letting the duplication look accidental. Flagged by ivany-nv's verification pass on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
'Live preview' and 'Recording' both said 'From the example directory:' but gave uv pip install -e ./examples/mcap_record_replay, which is repo-root-relative -- run from the example directory it resolves to a nonexistent nested path. Say what the commands actually assume; it also matches 887db46's rationale for the root .gitignore rule. Also drops a stale .py suffix on a replay_full_body module reference a few lines above. Flagged by ivany-nv on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
…_mcap The fallback to the newest .mcap of any kind (added to fix picking the wrong type outright) traded a hard failure for a silent one: a missed log line still means the wrong recording plays. Fail instead -- point at the recorder or an explicit path. Flagged by aristarkhovNV on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
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>
…ng type resolve_mcap() picked the newest .mcap in the shared ./recordings/ directory regardless of source. If a replay's own recorder hasn't produced a file yet, a newer recording from a different recorder can be selected and fail with a missing-channel error. Prefer a type-prefixed match, falling back to the newest .mcap of any kind -- matching replay_se3_vive.py's existing pattern. Flagged by CodeRabbit on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
…po root The recorders default to Path.cwd() / "recordings", and the README has you run from the repo root, so the existing examples/mcap_record_replay/.gitignore rule (scoped to that directory) never covers the output. Add a root-level /recordings/ rule. Flagged in review on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
…invocation Usage lines, --help text (argparse reads it from the module docstring), and error messages still told users to run these as scripts (python replay_full_body.py ...) after the move to package/module layout. Switch them to python -m isaacteleop_examples.mcap_record_replay.<name>, matching the README and rst; fix the same in the rst's Replaying section, which was the one block left in script form. Also updates the 'newest file' wording (docstrings, README, rst) for the type-prefixed auto-discovery from the prior commit, warns instead of silently degrading when resolve_mcap falls back to a wrong-type recording, and documents the --python 3.11 requirement for uv run. Flagged by ivany-nv's verification pass on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
common.py's GroundGrid (mcap_record_replay) and deviceio_viser.py's (deviceio_live_view, landed on main via #1034) are byte-identical. Not deduping: each example package is self-contained by design (see examples/README.md), and a shared helper would make one example depend on another. Leave a pointer in each copy instead of letting the duplication look accidental. Flagged by ivany-nv's verification pass on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
'Live preview' and 'Recording' both said 'From the example directory:' but gave uv pip install -e ./examples/mcap_record_replay, which is repo-root-relative -- run from the example directory it resolves to a nonexistent nested path. Say what the commands actually assume; it also matches 887db46's rationale for the root .gitignore rule. Also drops a stale .py suffix on a replay_full_body module reference a few lines above. Flagged by ivany-nv on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
…_mcap The fallback to the newest .mcap of any kind (added to fix picking the wrong type outright) traded a hard failure for a silent one: a missed log line still means the wrong recording plays. Fail instead -- point at the recorder or an explicit path. Flagged by aristarkhovNV on #1038. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
8dc80b6 to
857aa2d
Compare
Description
Part of #985. Stacked on #1037.
Nine modules imported
commonas a top-level module, which resolved only because the invoked script's own directory landed onsys.path. They broke underpython -m, broke when copied into another project, and claimed the very generic bare namecommon. This moves the tree to the layout inexamples/README.md.Twelve co-equal scripts, so no
__main__.py; the new README maps each channel to its live/record/replay module.One behaviour change, forced by the move. Recordings defaulted to
Path(__file__).resolve().parent.parent / "recordings", which resolved to the example directory. Three levels deeper that expression points inside the package, and for a pip-installed copy it would write intosite-packages. Recordings now default to./recordings/relative to the working directory, and the replay scripts look in the same place. The old path only ever made sense from a source checkout.References updated beyond
docs/:rigs/full_body.yaml,src/plugins/noitom_mocap/README.md,src/plugins/vive_se3_tracker/README.md.A second, deliberate behaviour change: all seven viser viewers bind
0.0.0.0rather than127.0.0.1, for the same reason — these run on a robot or workstation and get opened from a laptop.--host 127.0.0.1restores the old behaviour. Each startup line now reports the bind address instead of always printinglocalhost.The viser grid was a wall, not a floor.
add_griddefaults toplane="xy", but the scene setsset_up_direction("+y")— so the grid stood vertical in every viewer. It is now anxzground plane, 6 m with 0.25 m cells, and the camera starts centred on the origin at eye height so a tracked person fills the view on connect. That setup is a singlesetup_scene()helper incommon.pyrather than seven copies.Type of change
Testing
x86_64/ Ubuntu, Python 3.12. Wheel shipsisaacteleop_examples/mcap_record_replay/with no namespace__init__.py.uv pip install -e ./examples/mcap_record_replayinto a clean venv, then all 12 modules import with the CWD outside the repo;import commonfails, so the flat name is gone rather than relocated.pre-commitclean.Not covered: recording needs a live OpenXR runtime. Replay against an existing
.mcapis the cheapest check that the new./recordings/default behaves.Checklist
SKIP=check-copyright-year pre-commit run --all-filesgit commit -s) per the DCONo tests: this is a move, and this example has no automated coverage.
Summary by CodeRabbit
Documentation
New Features
./recordings/in the current working directory.