-
Notifications
You must be signed in to change notification settings - Fork 0
Add metaquest module #685
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
base: dev
Are you sure you want to change the base?
Add metaquest module #685
Conversation
ab00cd7 to
80a2cc5
Compare
|
Looks amazing! we can keep special ControllerData model for full quest info, but for easy integration to robots would be helpful to emit PoseStamped also I see you have position: tuple[float, float, float] = Field(description="Position (x, y, z) in meters")
rotation: tuple[float, float, float, float]you can do from dimos.msgs.geometry_msgs import PoseStamped
pose = PoseStamped(
ts=time.time(),
position=(1.0, 2.0, 3.0),
orientation=(0.1, 0.2, 0.3, 0.9),
)so you can add 2 more outputs, left_pose and right_pose or something after this we can try hooking up directly to unitree or an arm |
dimos/vr/modules/metaquest.py
Outdated
|
|
||
| return generate | ||
|
|
||
| def _close_module(self): |
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.
I added ModuleBase._close_module to cleanup things before we had start/stop. It's now called in ModuleBase.stop so you don't need to call _close_module anymore.
I think you should move this code to def stop() above and also add super().stop() at the end (to clean up all the module stuff, including _close_module).
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.
PoseStamped added and moved camera cleanup to under stop()
dimos/vr/run_vr_server.py
Outdated
| from fastapi.staticfiles import StaticFiles | ||
| from pydantic import ValidationError | ||
|
|
||
| sys.path.insert(0, str(Path(__file__).parent.parent.parent)) |
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.
What is this for?
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.
Removed.
dimos/vr/modules/metaquest.py
Outdated
| self._running = False | ||
|
|
||
| self._server_thread = threading.Thread(target=run_server, daemon=True) | ||
| self._server_thread.start() | ||
|
|
||
| protocol = "https" if ssl_config else "http" | ||
| logger.info(f"VR server started at {protocol}://{self.host}:{self.port}") | ||
|
|
||
| except Exception as e: | ||
| self._running = False | ||
| logger.error(f"Failed to start VR server: {e}", exc_info=True) | ||
| raise | ||
|
|
||
| @rpc | ||
| def stop(self): | ||
| """Stop the VR teleoperation server.""" | ||
| if not self._running: | ||
| logger.info("VR server not running") | ||
| return |
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.
If there's an exception in the thread self._running gets set to false. That means that module.stop() cannot run fully because of the if not self._running condition.
I think you need to replace self._running = False with self.stop() in these two try-excepts
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.
fixed now. using self.stop()
dimos/vr/modules/metaquest.py
Outdated
| } | ||
|
|
||
| @rpc | ||
| def generate_certificate(self, cert_dir: str = "dimos/vr/certificates"): |
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.
I think dimos is for source code. You should probably place certificates in assets/vr/certificates. You can get it with:
from dimos.constants import DIMOS_PROJECT_ROOT
_CERTIFICATES_DIR = DIMOS_PROJECT_ROOT / "assets" / "vr" / "certificates"
_CERTIFICATES_DIR.mkdir(parents=True, exist_ok=True)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.
switched to using constants
|
@oliver-sommer Rebase on dev to fix all of the issues and conflicts |
f8ef817 to
52f5ea8
Compare
|
Too many files changed for review. |
2 similar comments
|
Too many files changed for review. |
|
Too many files changed for review. |
52f5ea8 to
27f5ad5
Compare
|
Too many files changed for review. |
27f5ad5 to
811d2d3
Compare
|
Too many files changed for review. |
Add VR Teleoperation Module for Quest 3/3S Controllers
Adds native Quest 3/3S controller support for robot teleoperation via WebXR.
What's New:
Usage:
How it works: Quest browser connects to HTTPS server, streams controller data via WebSocket to dimos streams.
Files:
dimos/vr/module, test server, SSL cert generator, WebXR interface