test(cameras): add minimal realsense test

This commit is contained in:
Steven Palma
2025-05-05 18:36:41 +02:00
parent 15b5d28f45
commit b089c6db3a
5 changed files with 188 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ class RealSenseCamera(Camera):
def _configure_realsense_settings(self) -> rs.config:
"""Creates and configures the RealSense pipeline configuration object."""
rs_config = rs.config()
rs_config.enable_device(self.serial_number)
rs.config.enable_device(rs_config, self.serial_number)
if self.capture_width and self.capture_height and self.fps:
logger.debug(
@@ -300,6 +300,7 @@ class RealSenseCamera(Camera):
self.width, self.height = self.capture_width, self.capture_height
logger.debug(f"Final image dimensions set to: {self.width}x{self.height} (after rotation if any)")
# NOTE(Steven): Add a wamr-up period time config
def connect(self):
"""
Connects to the RealSense camera specified in the configuration.

View File

@@ -36,7 +36,7 @@ class RealSenseCameraConfig(CameraConfig):
name: str | None = None
serial_number: int | None = None
fps: int | None = None
width: int | None = None
width: int | None = None # NOTE(Steven): Make this not None allowed!
height: int | None = None
color_mode: ColorMode = ColorMode.RGB
channels: int | None = 3