-
Notifications
You must be signed in to change notification settings - Fork 666
Add Pirate Go2 vision-guided object interaction hackathon submission #2290
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -163,14 +163,23 @@ def stop(self) -> None: | |||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| class pSHMTransport(PubSubTransport[T]): | ||||||||||||||||||||||||||||||||||||||||||||||||||
| """Pickled shared-memory transport for local Python object streams.""" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| _started: bool = False | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __init__(self, topic: str, **kwargs) -> None: # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| super().__init__(topic) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self._kwargs = kwargs | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.shm = PickleSharedMemory(**kwargs) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __reduce__(self): # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return (pSHMTransport, (self.topic,)) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Preserve sizing options such as default_capacity when the coordinator | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # sends this transport to workers or to Rerun. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return (pSHMTransport, (self.topic,), self._kwargs) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __setstate__(self, state: dict[str, Any]) -> None: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self._kwargs = state | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.shm = PickleSharedMemory(**state) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
175
to
+182
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def broadcast(self, _, msg) -> None: # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if not self._started: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -193,14 +202,23 @@ def stop(self) -> None: | |||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| class SHMTransport(PubSubTransport[T]): | ||||||||||||||||||||||||||||||||||||||||||||||||||
| """Raw bytes shared-memory transport for local fixed-size payloads.""" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| _started: bool = False | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __init__(self, topic: str, **kwargs) -> None: # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| super().__init__(topic) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self._kwargs = kwargs | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.shm = BytesSharedMemory(**kwargs) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __reduce__(self): # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return (SHMTransport, (self.topic,)) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Preserve sizing options such as default_capacity when the coordinator | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # sends this transport to workers or to Rerun. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return (SHMTransport, (self.topic,), self._kwargs) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __setstate__(self, state: dict[str, Any]) -> None: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self._kwargs = state | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.shm = BytesSharedMemory(**state) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def broadcast(self, _, msg) -> None: # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if not self._started: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -223,6 +241,8 @@ def stop(self) -> None: | |||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| class JpegShmTransport(PubSubTransport[T]): | ||||||||||||||||||||||||||||||||||||||||||||||||||
| """JPEG-compressed shared-memory transport for local image streams.""" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| _started: bool = False | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __init__(self, topic: str, quality: int = 75, **kwargs) -> None: # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -233,9 +253,19 @@ def __init__(self, topic: str, quality: int = 75, **kwargs) -> None: # type: ig | |||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| self.shm = JpegSharedMemory(quality=quality, **kwargs) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.quality = quality | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self._kwargs = kwargs | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __reduce__(self): # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return (JpegShmTransport, (self.topic, self.quality)) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Preserve quality and sizing options when crossing worker boundaries. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return (JpegShmTransport, (self.topic, self.quality), self._kwargs) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def __setstate__(self, state: dict[str, Any]) -> None: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| from dimos.protocol.pubsub.impl.jpeg_shm import ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| JpegSharedMemory, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) # deferred to avoid pulling in Image/cv2/rerun | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| self._kwargs = state | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.shm = JpegSharedMemory(quality=self.quality, **state) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+262
to
+268
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def broadcast(self, _, msg) -> None: # type: ignore[no-untyped-def] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if not self._started: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
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.
_configure_rerun_bridge_visual_transportsdoes a deferredfrom dimos.visualization.rerun.bridge import RerunBridgeModuleinside the core coordinator module. This creates a layering dependency: the coordination layer now has knowledge of—and a runtime dependency on—the visualization layer. The runtime guard (if RerunBridgeModule not in coordinator._deployed_modules) keeps headless deployments safe, but the right long-term home for this wiring is likely a post-wire hook registered by the bridge itself, keeping core coordination decoupled from visualization concerns.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!