From 2246afda3712f5bfe922552b06c1ef20259e5e2d Mon Sep 17 00:00:00 2001 From: Filip Jeretina <59307111+zrezke@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:13:24 +0100 Subject: [PATCH] OAK D SR POE and some reliability improvements (#35) * WIP add support for tof (oak d sr poe) * Accommodate new sdk, make tof stream show up, more or less properly. Still need to fix a few gui bugs. * Fixed gui bugs with which sensors are "AI capable" improved a bit on resolution search stability. did py-lints * install wheel from artifactory * Update rerun_py/depthai_viewer/_backend/device.py * Update rerun_py/depthai_viewer/_backend/device.py --- rerun_py/depthai_viewer/_backend/device.py | 1 + .../depthai_viewer/_backend/device_configuration.py | 10 ++++------ rerun_py/depthai_viewer/_backend/packet_handler.py | 6 ++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/rerun_py/depthai_viewer/_backend/device.py b/rerun_py/depthai_viewer/_backend/device.py index 32cf84b8c1446..13574cd810b33 100644 --- a/rerun_py/depthai_viewer/_backend/device.py +++ b/rerun_py/depthai_viewer/_backend/device.py @@ -50,6 +50,7 @@ ) from depthai_viewer._backend.store import Store from depthai_viewer.install_requirements import model_dir +from numpy.typing import NDArray class XlinkStatistics: diff --git a/rerun_py/depthai_viewer/_backend/device_configuration.py b/rerun_py/depthai_viewer/_backend/device_configuration.py index 0fe023ead6056..d57fafcd09592 100644 --- a/rerun_py/depthai_viewer/_backend/device_configuration.py +++ b/rerun_py/depthai_viewer/_backend/device_configuration.py @@ -56,9 +56,7 @@ def to_runtime_controls(self) -> Dict[str, Any]: "align": ( "RECTIFIED_LEFT" if self.align == dai.CameraBoardSocket.LEFT - else "RECTIFIED_RIGHT" - if self.align == dai.CameraBoardSocket.RIGHT - else "CENTER" + else "RECTIFIED_RIGHT" if self.align == dai.CameraBoardSocket.RIGHT else "CENTER" ), "lr_check": self.lr_check, "lrc_check_threshold": self.lrc_threshold, @@ -335,9 +333,9 @@ class DeviceProperties(BaseModel): # type: ignore[misc] id: str cameras: List[CameraFeatures] = [] imu: Optional[ImuKind] - stereo_pairs: List[ - Tuple[dai.CameraBoardSocket, dai.CameraBoardSocket] - ] = [] # Which cameras can be paired for stereo + stereo_pairs: List[Tuple[dai.CameraBoardSocket, dai.CameraBoardSocket]] = ( + [] + ) # Which cameras can be paired for stereo default_stereo_pair: Optional[Tuple[dai.CameraBoardSocket, dai.CameraBoardSocket]] = None info: DeviceInfo = DeviceInfo() diff --git a/rerun_py/depthai_viewer/_backend/packet_handler.py b/rerun_py/depthai_viewer/_backend/packet_handler.py index 90ff9ddde0ceb..c783fb1cf7c51 100644 --- a/rerun_py/depthai_viewer/_backend/packet_handler.py +++ b/rerun_py/depthai_viewer/_backend/packet_handler.py @@ -2,6 +2,7 @@ import cv2 import depthai as dai +import depthai_viewer as viewer import numpy as np from ahrs.filters import Mahony from depthai_sdk.classes.packets import ( # PointcloudPacket, @@ -22,13 +23,10 @@ StereoComponent, ) from depthai_sdk.components.tof_component import ToFComponent -from numpy.typing import NDArray -from pydantic import BaseModel - -import depthai_viewer as viewer from depthai_viewer._backend.store import Store from depthai_viewer._backend.topic import Topic from depthai_viewer.components.rect2d import RectFormat +from numpy.typing import NDArray class PacketHandlerContext(BaseModel): # type: ignore[misc]