Use same ip for cameras

This commit is contained in:
glannuzel
2025-08-06 13:52:39 +02:00
parent 346d4950c5
commit f9b8be5730
@@ -32,9 +32,38 @@ class Reachy2RobotConfig(RobotConfig):
use_external_commands: bool = False use_external_commands: bool = False
with_mobile_base: bool = True with_mobile_base: bool = True
mock: bool = False
def __post_init__(self):
# cameras # cameras
cameras: dict[str, CameraConfig] = field( self.cameras: dict[str, CameraConfig] = {
default_factory=lambda: { "teleop_left": Reachy2CameraConfig(
name="teleop",
image_type="left",
ip_address=self.ip_address,
fps=30,
width=640,
height=480,
color_mode=ColorMode.RGB,
rotation=Cv2Rotation.NO_ROTATION
),
"teleop_right": Reachy2CameraConfig(
name="teleop",
image_type="right",
ip_address=self.ip_address,
fps=30,
width=640,
height=480,
color_mode=ColorMode.RGB,
rotation=Cv2Rotation.NO_ROTATION
),
}
super().__post_init__()
# # cameras
# cameras: dict[str, CameraConfig] = field(
# default_factory=lambda: {
# "teleop_left": Reachy2CameraConfig( # "teleop_left": Reachy2CameraConfig(
# name="teleop", # name="teleop",
# image_type="left", # image_type="left",
@@ -108,26 +137,26 @@ class Reachy2RobotConfig(RobotConfig):
# ), # ),
# # REAL ROBOT REDUCED IMAGE SIZE # # REAL ROBOT REDUCED IMAGE SIZE
"teleop_left": Reachy2CameraConfig( # "teleop_left": Reachy2CameraConfig(
name="teleop", # name="teleop",
image_type="left", # image_type="left",
ip_address="192.168.0.199", # ip_address="192.168.0.199",
fps=30, # fps=30,
width=640, # width=640,
height=480, # height=480,
color_mode=ColorMode.RGB, # color_mode=ColorMode.RGB,
rotation=Cv2Rotation.NO_ROTATION # rotation=Cv2Rotation.NO_ROTATION
), # ),
"teleop_right": Reachy2CameraConfig( # "teleop_right": Reachy2CameraConfig(
name="teleop", # name="teleop",
image_type="right", # image_type="right",
ip_address="192.168.0.199", # ip_address="192.168.0.199",
fps=30, # fps=30,
width=640, # width=640,
height=480, # height=480,
color_mode=ColorMode.RGB, # color_mode=ColorMode.RGB,
rotation=Cv2Rotation.NO_ROTATION # rotation=Cv2Rotation.NO_ROTATION
), # ),
# # Reduced size for testing # # Reduced size for testing
# "teleop_left": Reachy2CameraConfig( # "teleop_left": Reachy2CameraConfig(
@@ -150,7 +179,5 @@ class Reachy2RobotConfig(RobotConfig):
# color_mode=ColorMode.RGB, # color_mode=ColorMode.RGB,
# rotation=Cv2Rotation.NO_ROTATION # rotation=Cv2Rotation.NO_ROTATION
# ), # ),
} # }
) # )
mock: bool = False