Fix example demos: tensor handling, keyboard teleop #1952
Fix example demos: tensor handling, keyboard teleop #1952kmy17518 wants to merge 7 commits intoStanfordVL:mainfrom
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull request overview
Fixes multiple example demo issues related to camera image / video recording, keyboard teleoperation behavior, and JoyLo dependency compatibility with Isaac Sim.
Changes:
- Add pip constraints when installing JoyLo to avoid incompatible
numpy/opencv-contrib-pythonversions. - Fix
CameraMoverrecording paths by converting torch tensors to CPU numpy arrays, and make spline-derived values explicitly numeric. - Adjust keyboard teleop release handling and correct printed key mapping for differential-drive control.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
setup.sh |
Adds constrained dependency installation for JoyLo to maintain OmniGibson/Isaac Sim compatibility. |
OmniGibson/omnigibson/utils/ui_utils.py |
Fixes CameraMover tensor-to-numpy conversions for image/video recording and updates keyboard teleop behavior + printed key mappings. |
OmniGibson/omnigibson/examples/scenes/scene_tour_demo.py |
Updates waypoint tensor creation for camera trajectory recording in the scene tour demo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Constrain deps to keep OmniGibson / Isaac Sim compatible | ||
| JOYLO_CONSTRAINTS_FILE="/tmp/joylo-constraints.txt" | ||
| cat > "$JOYLO_CONSTRAINTS_FILE" << 'EOF' | ||
| opencv-contrib-python<=4.11.0.86 | ||
| numpy<2 | ||
| EOF | ||
| pip install -e "$WORKDIR/joylo" -c "$JOYLO_CONSTRAINTS_FILE" |
There was a problem hiding this comment.
Using a fixed constraints file path in /tmp can collide when multiple installs run concurrently (and leaves a stale file behind). Prefer creating the constraints file with mktemp and removing it afterwards (e.g., via a trap) so the install is race-free and self-cleaning.
There was a problem hiding this comment.
Can you directly add numpy<2 and opencv-contrib-python<=4.11.0.86 to the joylo setup.py file? I think this should work so we don't have to modify the main setup.sh file.
Also what's the reason for constraining opencv-contrib-python<=4.11.0.86?
… keys pending release
for more information, see https://pre-commit.ci
wensi-ai
left a comment
There was a problem hiding this comment.
lgtm overall, please see comments above
Summary
Addresses issues in the following example demos:
BEHAVIOR Task Demo
python -m omnigibson.examples.environments.behavior_env_demoScene Tour Demo
python -m omnigibson.examples.scenes.scene_tour_demoRobot Control Demo
python -m omnigibson.examples.robots.robot_control_exampleChanges
Constrain JoyLo dependencies
numpyopencv-contrib-pythonFix tensor conversions in
CameraMoverFix keyboard teleop event handling
Fix typo in
print_keyboard_teleop_infoi/kandj/lkey mappings