-
Notifications
You must be signed in to change notification settings - Fork 10
Feat/Quest VR teleoperation stack #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ruthwikdasyam
wants to merge
32
commits into
dev
Choose a base branch
from
ruthwik_teleop
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
ba4edaa
Initial Commit
ruthwikdasyam 4cea4e9
CI code cleanup
ruthwikdasyam 877e1e8
Feat: adding unit32
ruthwikdasyam bfe72d5
Feat: webXR and deno bridge
ruthwikdasyam 179e809
Introducing base teleop protocol
ruthwikdasyam 0824157
Feat: quest module and its subclasses
ruthwikdasyam 5844c89
Feat: nice API for data from quest controllers
ruthwikdasyam 737a1b1
Feat: Quest utils - visualization and transforms
ruthwikdasyam 584dfbc
Docs: Readme added
ruthwikdasyam 2cd8b8a
Feat: pose sub method
ruthwikdasyam 4e2e3da
Misc: init updates
ruthwikdasyam 9538e28
updating teleop blueprints
ruthwikdasyam 2f3fabd
Feat: subclass for arm teleop
ruthwikdasyam 19d4e0c
Fix: Bugs and cleanup
ruthwikdasyam 8bc29f3
Misc: readme updates
ruthwikdasyam a7fcc50
Fix: pre-commit errors
ruthwikdasyam 520a87c
Merge origin/dev into ruthwik_teleop
ruthwikdasyam 9e46122
Feat: added locks, engage feat changes
ruthwikdasyam db8a4df
Misc: renaming methods and docstrings
ruthwikdasyam e2cb985
ignore teleop server certs
ruthwikdasyam 13fffe3
Feat: trigger and grip sent through axes to preserve floats
ruthwikdasyam 7c61378
Fix: disposable wrapper
ruthwikdasyam 459cfad
Fix: deleted file
ruthwikdasyam 1b0ecab
Merge branch 'dev' into ruthwik_teleop
ruthwikdasyam a16e712
Misc: docstrings, comments and mypy fixes
ruthwikdasyam 3401d11
Misc: readme changes + added Constants
ruthwikdasyam e94574e
Feat: lock in control loop - monitor-style locking
ruthwikdasyam 12f036f
Fix: resolve re-entrant lock in control loop and LCM init order
ruthwikdasyam 92147a6
Fix: logging malperformed joy msgs
ruthwikdasyam 84315c4
Fix: stream logging
ruthwikdasyam 1ae2d7e
Fix: teleop certs path
ruthwikdasyam eac7ed1
Fix: server run cmd
ruthwikdasyam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,3 +65,5 @@ yolo11n.pt | |
|
|
||
| *mobileclip* | ||
| /results | ||
|
|
||
| dimos/assets/teleop_certs/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """UInt32 message type.""" | ||
|
|
||
| from typing import ClassVar | ||
|
|
||
| from dimos_lcm.std_msgs import UInt32 as LCMUInt32 | ||
|
|
||
|
|
||
| class UInt32(LCMUInt32): # type: ignore[misc] | ||
| """ROS-compatible UInt32 message.""" | ||
|
|
||
| msg_name: ClassVar[str] = "std_msgs.UInt32" | ||
|
|
||
| def __init__(self, data: int = 0) -> None: | ||
| """Initialize UInt32 with data value.""" | ||
| self.data = data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Teleop Stack | ||
|
|
||
| Teleoperation modules for DimOS. Currently supports Meta Quest 3 VR controllers. | ||
|
|
||
| ## Architecture | ||
|
|
||
| ``` | ||
| Quest Browser (WebXR) | ||
| │ | ||
| │ PoseStamped + Joy via WebSocket | ||
| ▼ | ||
| Deno Bridge (teleop_server.ts) | ||
| │ | ||
| │ LCM topics | ||
| ▼ | ||
| QuestTeleopModule | ||
| │ WebXR → robot frame transform | ||
| │ Pose computation + button state packing | ||
| ▼ | ||
| PoseStamped / TwistStamped / QuestButtons outputs | ||
| ``` | ||
|
|
||
| ## Modules | ||
|
|
||
| ### QuestTeleopModule | ||
| Base teleop module. Gets controller data, computes output poses, and publishes them. Default engage: hold primary button (X/A). Subclass to customize. | ||
|
|
||
| ### ArmTeleopModule | ||
| Toggle-based engage — press primary button once to engage, press again to disengage. | ||
|
|
||
| ### TwistTeleopModule | ||
| Outputs TwistStamped (linear + angular velocity) instead of PoseStamped. | ||
|
|
||
| ### VisualizingTeleopModule | ||
| Adds Rerun visualization for debugging. Extends ArmTeleopModule (toggle engage). | ||
|
|
||
| ## Subclassing | ||
|
|
||
| `QuestTeleopModule` is designed for extension. Override these methods: | ||
|
|
||
| | Method | Purpose | | ||
| |--------|---------| | ||
| | `_handle_engage()` | Customize engage/disengage logic | | ||
| | `_should_publish()` | Add conditions for when to publish | | ||
| | `_get_output_pose()` | Customize pose computation | | ||
| | `_publish_msg()` | Change output format | | ||
| | `_publish_button_state()` | Change button output | | ||
|
|
||
| ### Rules for subclasses | ||
|
|
||
| - **Do not acquire `self._lock` in overrides.** The control loop already holds it. | ||
| Access `self._controllers`, `self._current_poses`, `self._is_engaged`, etc. directly. | ||
| - **Keep overrides fast** — they run inside the control loop at `control_loop_hz`. | ||
|
|
||
| ## File Structure | ||
|
|
||
| ``` | ||
| teleop/ | ||
| ├── base/ | ||
| │ └── teleop_protocol.py # TeleopProtocol interface | ||
| ├── quest/ | ||
| │ ├── quest_teleop_module.py # Base Quest teleop module | ||
| │ ├── quest_extensions.py # ArmTeleop, TwistTeleop, VisualizingTeleop | ||
| │ ├── quest_types.py # QuestControllerState, QuestButtons | ||
| │ └── web/ # Deno bridge + WebXR client | ||
| │ ├── teleop_server.ts | ||
| │ └── static/index.html | ||
| ├── utils/ | ||
| │ ├── teleop_transforms.py # WebXR → robot frame math | ||
| │ └── teleop_visualization.py # Rerun visualization helpers | ||
| └── blueprints.py # Module blueprints for easy instantiation | ||
| ``` | ||
|
|
||
| ## Quick Start | ||
|
|
||
| See [Quest Web README](quest/web/README.md) for running the Deno bridge and connecting the Quest headset. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Teleoperation modules for DimOS.""" | ||
|
|
||
| from dimos.teleop.base import TeleopProtocol | ||
|
|
||
| __all__ = ["TeleopProtocol"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Teleoperation protocol.""" | ||
|
|
||
| from dimos.teleop.base.teleop_protocol import TeleopProtocol | ||
|
|
||
| __all__ = ["TeleopProtocol"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Teleoperation specifications: Protocol. | ||
|
|
||
| Defines the interface that all teleoperation modules must implement. | ||
| No implementation - just method signatures. | ||
| """ | ||
|
|
||
| from typing import Any, Protocol, runtime_checkable | ||
|
|
||
| # ============================================================================ | ||
| # TELEOP PROTOCOL | ||
| # ============================================================================ | ||
|
|
||
|
|
||
| @runtime_checkable | ||
| class TeleopProtocol(Protocol): | ||
| """Protocol defining the teleoperation interface. | ||
|
|
||
| All teleop modules (Quest, keyboard, joystick, etc.) should implement these methods. | ||
| No state or implementation here - just the contract. | ||
| """ | ||
|
|
||
| # --- Lifecycle --- | ||
|
|
||
| def start(self) -> None: | ||
| """Start the teleoperation module.""" | ||
| ... | ||
|
|
||
| def stop(self) -> None: | ||
| """Stop the teleoperation module.""" | ||
| ... | ||
|
|
||
| # --- Engage / Disengage --- | ||
|
|
||
| def engage(self, hand: Any = None) -> bool: | ||
| """Engage teleoperation. Hand type is device-specific (e.g., Hand enum for Quest).""" | ||
| ... | ||
|
|
||
| def disengage(self, hand: Any = None) -> None: | ||
| """Disengage teleoperation. Hand type is device-specific.""" | ||
| ... | ||
|
|
||
|
|
||
| __all__ = ["TeleopProtocol"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Teleop blueprints for testing and deployment.""" | ||
|
|
||
| from dimos.core.blueprints import autoconnect | ||
| from dimos.core.transport import LCMTransport | ||
| from dimos.msgs.geometry_msgs import PoseStamped | ||
| from dimos.teleop.quest.quest_extensions import arm_teleop_module, visualizing_teleop_module | ||
| from dimos.teleop.quest.quest_types import QuestButtons | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Quest Teleop Blueprints | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
| # Arm teleop with toggle-based engage | ||
| arm_teleop = autoconnect( | ||
| arm_teleop_module(), | ||
| ).transports( | ||
| { | ||
| ("left_controller_output", PoseStamped): LCMTransport("/teleop/left_delta", PoseStamped), | ||
| ("right_controller_output", PoseStamped): LCMTransport("/teleop/right_delta", PoseStamped), | ||
| ("buttons", QuestButtons): LCMTransport("/teleop/buttons", QuestButtons), | ||
| } | ||
| ) | ||
|
|
||
| # Arm teleop with Rerun visualization | ||
| arm_teleop_visualizing = autoconnect( | ||
| visualizing_teleop_module(), | ||
| ).transports( | ||
| { | ||
| ("left_controller_output", PoseStamped): LCMTransport("/teleop/left_delta", PoseStamped), | ||
| ("right_controller_output", PoseStamped): LCMTransport("/teleop/right_delta", PoseStamped), | ||
| ("buttons", QuestButtons): LCMTransport("/teleop/buttons", QuestButtons), | ||
| } | ||
| ) | ||
|
|
||
|
|
||
| __all__ = ["arm_teleop", "arm_teleop_visualizing"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Quest teleoperation module.""" | ||
|
|
||
| from dimos.teleop.quest.quest_extensions import ( | ||
| ArmTeleopModule, | ||
| TwistTeleopModule, | ||
| VisualizingTeleopModule, | ||
| arm_teleop_module, | ||
| twist_teleop_module, | ||
| visualizing_teleop_module, | ||
| ) | ||
| from dimos.teleop.quest.quest_teleop_module import ( | ||
| Hand, | ||
| QuestTeleopConfig, | ||
| QuestTeleopModule, | ||
| QuestTeleopStatus, | ||
| quest_teleop_module, | ||
| ) | ||
| from dimos.teleop.quest.quest_types import ( | ||
| QuestButtons, | ||
| QuestControllerState, | ||
| ThumbstickState, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "ArmTeleopModule", | ||
| "Hand", | ||
| "QuestButtons", | ||
| "QuestControllerState", | ||
| "QuestTeleopConfig", | ||
| "QuestTeleopModule", | ||
| "QuestTeleopStatus", | ||
| "ThumbstickState", | ||
| "TwistTeleopModule", | ||
| "VisualizingTeleopModule", | ||
| # Blueprints | ||
| "arm_teleop_module", | ||
| "quest_teleop_module", | ||
| "twist_teleop_module", | ||
| "visualizing_teleop_module", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dimos/is only for code. Should this have beenassets/teleop_certs/?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed this
server path + .gitignore are updated to
/assets/teleop_certs/