Skip to content

G1 - local zed via webcam module - 2d detection spatial localization#627

Closed
leshy wants to merge 74 commits intodevfrom
g1-localzed
Closed

G1 - local zed via webcam module - 2d detection spatial localization#627
leshy wants to merge 74 commits intodevfrom
g1-localzed

Conversation

@leshy
Copy link
Contributor

@leshy leshy commented Sep 19, 2025

deps

Implements a camera spec and universal camera hosting module

generic spec for a camera

class CameraHardware(Configurable[CameraConfigT], Generic[CameraConfigT]):
    @abstractmethod
    def image_stream(self) -> Observable[Image]:
        pass

    @abstractproperty
    def camera_info(self) -> CameraInfo:
        pass

Universal camera module can host any hardware implementation and allows you to specify physical relationship of a camera to other components via a transform (provides optical_frame automatically)

        self.camera = self.dimos.deploy(
            CameraModule,
            transform=Transform(
                translation=Vector3(0.05, 0.0, 0.0),
                rotation=Quaternion(0.0, 0.0, 0.0, 1.0),
                frame_id="base_link
                child_frame_id="camera_link",
            ),

            hardware=lambda: Webcam(
                camera_index=1,
                frequency=15,
                stereo_slice="left",
                camera_info=zed.CameraInfo.SingleWebcam,
            ),
        )

uses default config / typed config interface we should use elsewhere also

@dataclass
class WebcamConfig(CameraConfig):
    camera_index: int = 0
    frame_width: int = 640
    frame_height: int = 480
    frequency: int = 10
    camera_info: CameraInfo = field(default_factory=CameraInfo)


class Webcam(CameraHardware[WebcamConfig]):
    default_config = WebcamConfig
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        print(self.config) # **kwargs provided will be overlayed on top of the default config 

@leshy leshy changed the title g1 switched over to webcam module WIP G1 - local zed via webcam module - 2d detection spatial localization Sep 19, 2025
@leshy leshy changed the title WIP G1 - local zed via webcam module - 2d detection spatial localization G1 - local zed via webcam module - 2d detection spatial localization Sep 19, 2025
@leshy leshy closed this Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants