Repository navigation
examples(vehicle_teleop): package under isaaccapture_examples - #1375
Conversation
Move the example to the layout in examples/README.md: pyproject.toml at the example root (dist isaaccapture-examples-vehicle-teleop), sources under python/isaaccapture_examples/vehicle_teleop/ with no __init__.py at the namespace level, hatchling only-include + sources, and relative sibling imports. - The scripts run python -m isaaccapture_examples.vehicle_teleop.<module> and keep putting python/ on PYTHONPATH, so a venv set up before this change still works through them. - The README setup installs the example (uv sync without --no-install-project) from the example root and lists the module each script runs. - example_root() goes one level further up, so the default config/steering_wheel_config.yaml and steering_wheel_plugin paths resolve as before in the source and install trees. - CMake installs the example at examples/vehicle_teleop; README, config/ and scripts/ are still installed, since the scripts run from the install tree and the plugin default looks for <prefix>/plugins there. - The worker tests stay in examples/vehicle_teleop/tests/ and import through the package; their pythonpath already points at python/. Part of #985. Signed-off-by: Ivan Yang <yifanyang@nvidia.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
With pyproject.toml at the example root, uv run in tests/ picked up its [[tool.uv.index]] and queried pypi.nvidia.com first for every test dependency. An empty [tool.uv] in tests/pyproject.toml stops uv's settings lookup there, so the tests resolve from PyPI as before. README: - Move the direct python -m commands out of Setup into their own section after the thirdparty clone, as full commands: drop the --rate-hz 50 the workers already default to, and give the Panda worker its PYTHONPATH. - Say in Troubleshooting that a non-editable install must pass --config and --plugin-binary, since both defaults resolve relative to the example directory. Part of #985. Signed-off-by: Ivan Yang <yifanyang@nvidia.com>
Signed-off-by: Ivan Yang <yifanyang@nvidia.com>
…nonical way The Setup block installed isaaccapture unpinned from build/wheels. With no wheel there for the venv's Python, that silently resolved a published isaaccapture instead of failing, and after a rebuild rerunning it left the old wheel installed. - Use the install from Build from source step 4: a venv on the build's Python with --seed, isaaccapture[cloudxr]==X.Y+local from install/wheels/ (what the README's cmake --install step produces) with --reinstall-package isaaccapture, then uv pip install -e . for the example instead of uv sync, which locked isaaccapture against the index. - Say that the venv stays in this directory because the scripts call .venv/bin/python, and to rerun the isaaccapture line after every rebuild. - The scripts' missing-venv hint points at the README's Setup instead of a hard-coded uv venv --python 3.11 command. Part of #985. Signed-off-by: Ivan Yang <yifanyang@nvidia.com>
Description
Part of #985.
vehicle_teleop moves to the layout in
examples/README.md:pyproject.tomlat the example root (distisaaccapture-examples-vehicle-teleop), sources underpython/isaaccapture_examples/vehicle_teleop/(a PEP 420 namespace with no__init__.pyat that level), hatchlingonly-include+sources, and relative sibling imports. The example has four co-equal entry points, so it has no__main__.py; the README gives the directpython -mcommand for each module, with thePYTHONPATHthe Panda worker needs.The scripts keep their names and arguments. They now run
python -m isaaccapture_examples.vehicle_teleop.<module>and still putpython/onPYTHONPATH, so a.venvset up before this change keeps working through them. Direct module invocations change:The README setup now uses the local-build install from step 4 of Build from source, keeping the venv in the example directory because the scripts call
.venv/bin/python. It pinsisaaccaptureto the local build and reinstalls it after a rebuild, then installs the example editable. The old unpinned line silently resolved a publishedisaaccapturewhen there was no wheel for the venv's Python, and rerunning it after a rebuild kept the old build. The scripts' missing-venv hint now points at the README's Setup instead ofuv venv --python 3.11 .venv.Behaviour is otherwise unchanged:
example_root()goes one level further up, so the default--config(config/steering_wheel_config.yaml) and--plugin-binary(build/src/plugins/...in a checkout,<prefix>/plugins/...in an install tree) resolve to the same files as before. Both defaults are relative to the example's tree, so a plain wheel install of the example needs both flags passed explicitly. The README's Troubleshooting says so.vehicle_teleop.VehicleControlCommandRecordis unchanged, so logs recorded before this change still replay.examples/vehicle_teleop/tests/, wheretests/AGENTS.mdputs them, and import through the package. Theirpythonpath = ["../python"]already points at the namespace root, and theirCMakeLists.txtis unchanged.tests/pyproject.tomlgains an empty[tool.uv]: with the example'spyproject.tomlnow one directory up,uvwould otherwise take its settings from there and trypypi.nvidia.comfirst for every test dependency.CMake install, kept.
install_python_example()now takesDESTINATION examples/vehicle_teleop, which keepspython/and putspyproject.tomlat<prefix>/examples/vehicle_teleop/. The README,config/andscripts/are still installed: the scripts run from the install tree (they find.venvandpython/next to themselves), and the steering worker's plugin default looks for<prefix>/plugins/steering_wheel/steering_wheel_pluginrelative to it. This matchesteleop_ros2, which installs itsconfigs/beside its packaged sources and finds them the same way.Type of change
Breaks direct
python -m vehicle_teleop.<module>invocations (migration above). The scripts, their arguments, the config, the install-tree layout of README/config/scripts and theisaaccapturelibrary are unchanged.Testing
x86_64/ Ubuntu 24.04, Python 3.12, against a localisaaccapture1.7 build of this branch.SKIP=check-copyright-year pre-commit run --all-filespasses.ctest -R vehicle_teleop_test_workersfrom a build of this branch configured withBUILD_TESTING=ON: 15 passed.uv build --wheel examples/vehicle_teleop: every file sits underisaaccapture_examples/vehicle_teleop/, and the wheel has noisaaccapture_examples/__init__.py.env -i, no profile) with3.12and1.7filled in:isaaccapture 1.7+localinstalls frominstall/wheels/anduv pip install -e .adds the example without touching it. All four scripts run with--help, andpython -m isaaccapture_examples.vehicle_teleop.<module> --helpworks for all four modules from/with noPYTHONPATH.--configand--plugin-binarydefault toexamples/vehicle_teleop/config/steering_wheel_config.yamlandbuild/src/plugins/steering_wheel/steering_wheel_plugin, as onmain.cmake --installto a scratch prefix): a.venvset up there from the generatedpyproject.toml(isaaccapture[cloudxr]==1.7+local,find-links = ["../../wheels"]) runs all four scripts with--help, and the defaults resolve to<prefix>/examples/vehicle_teleop/config/steering_wheel_config.yamland<prefix>/plugins/steering_wheel/steering_wheel_plugin.websockets>=14.0). After rebuilding at the branch head andcmake --install build, rerunning the install line without--reinstall-packageleft that build in place ("Checked 1 package"). The README's line replaced it:websockets>=17.3, andcloudxr/wss.pymatches the branch's source. The example stayed installed and its four modules still ran from/.isaaccapture(v1.7+local) with ...cp312". The old unpinned line resolves the publishedisaaccapture==1.7.79a1without an error.bash -n; with no.venv, they print the README path to set it up.--helpfrom/.McapCommandLoggerreplays throughreplay_command_mcap.sh, with and without--realtime, andrun_panda_worker.sh --dry-runprints the commands a local ZMQ publisher sends in the workers' wire format.git grepover all ofdocs/(pages,_data/*.yaml, toctrees), every README andAGENTS.md,src/,tests/,scripts/,.github/,deps/,cmake/,.pre-commit-config.yamlandexamples/, forvehicle_teleop, each module name, each launcher script,steering_wheel_config, the MCAP schema name,examples/vehicle_teleop/pythonand the old--no-install-projectsetup. No docs page mentions the example; the live site's search index formainagrees, so this PR has no docs preview to check (the docs build runs only fordocs/**changes). The remaining hits name paths this PR does not move, so they stay: the flow-diagram SVG exclude in.pre-commit-config.yaml, theexamples/vehicle_teleop/tests/line intests/AGENTS.md,add_subdirectory(vehicle_teleop)inexamples/CMakeLists.txt, andconfig/steering_wheel_config.yamlinsrc/plugins/steering_wheel/README.md.tests/:uv lock -vreads its settings fromtests/pyproject.tomland makes nopypi.nvidia.comrequest; without the empty[tool.uv]it readsexamples/vehicle_teleop/pyproject.tomland queries that index first. The worker tests pass the way CTest runs them (uv run --extra dev pytest, 15 passed).--help. In a non-editable install the default--configpoints inside the venv, and an explicit--config config/steering_wheel_config.yamlloads the shipped mapping.Not covered yet: runs that need a steering wheel, Isaac Sim, a headset or a Panda.
./scripts/run_isaac_remote_steering_worker.sh --verbosewith a G920/G923 on/dev/input/js0, CloudXR running and a client connected; the default config and plugin binary resolve from the checkout.<prefix>/examples/vehicle_teleop), where the plugin default is<prefix>/plugins/steering_wheel/steering_wheel_plugin../scripts/run_isaac_keyboard_control_worker.sh --verbosedriving the vehicle in Isaac Sim../scripts/run_panda_worker.sh --connect "tcp://<remote-ip>:5555"on the vehicle machine with a Panda,thirdparty/opendbcandthirdparty/pandacloned../scripts/replay_command_mcap.shon a log recorded with--log-mcapbefore this change.Checklist
SKIP=check-copyright-year pre-commit run --all-filesgit commit -s) per the DCOSummary by CodeRabbit
PYTHONPATH.