99sys .path .insert (0 , str (REPO_ROOT / "python" ))
1010sys .path .insert (0 , str (REPO_ROOT / "extensions/rcs_zed/src" ))
1111
12+ from rcs .camera .hw import DummyCalibrationStrategy # noqa: E402
1213from rcs_zed .camera import ZEDCameraSet , ZEDDeviceInfo , ZEDFrameBundle # noqa: E402
14+ from rcs_zed .utils import default_zed , default_zed_dummy_calibration # noqa: E402
1315
1416from rcs import common # noqa: E402
1517
@@ -36,6 +38,14 @@ class PatchZedState(TypedDict):
3638 open_calls : list [tuple [str , bool , bool , bool ]]
3739
3840
41+ class FakeCalibrationStrategy :
42+ def calibrate (self , samples , intrinsics , lock ):
43+ return True
44+
45+ def get_extrinsics (self ):
46+ return np .eye (4 )
47+
48+
3949@pytest .fixture ()
4050def patch_zed (monkeypatch ) -> PatchZedState :
4151 state : PatchZedState = {"devices" : {}, "opened" : {}, "open_calls" : []}
@@ -163,3 +173,28 @@ def test_zed_include_right_adds_logical_right_camera_without_double_grab(patch_z
163173 assert left_frame .avg_timestamp == right_frame .avg_timestamp == 12.5
164174 assert left_frame .camera .depth is None
165175 assert right_frame .camera .depth is None
176+
177+
178+ def test_default_zed_uses_builtin_dummy_calibration ():
179+ camera_set = default_zed ({"wrist" : "123" })
180+
181+ assert camera_set is not None
182+ assert isinstance (camera_set .calibration_strategy ["wrist" ], DummyCalibrationStrategy )
183+
184+
185+ def test_default_zed_accepts_explicit_calibration_strategy ():
186+ calibration = FakeCalibrationStrategy ()
187+ camera_set = default_zed (
188+ {"wrist" : "123" },
189+ calibration_strategy = {"wrist" : calibration },
190+ )
191+
192+ assert camera_set is not None
193+ assert camera_set .calibration_strategy == {"wrist" : calibration }
194+
195+
196+ def test_default_zed_dummy_calibration_remains_compatible ():
197+ camera_set = default_zed_dummy_calibration ({"wrist" : "123" })
198+
199+ assert camera_set is not None
200+ assert isinstance (camera_set .calibration_strategy ["wrist" ], DummyCalibrationStrategy )
0 commit comments