File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,17 @@ class RobotConfig(draccus.ChoiceRegistry, abc.ABC):
1212 # Directory to store calibration file
1313 calibration_dir : Path | None = None
1414
15+ def __post_init__ (self ):
16+ if hasattr (self , "cameras" ):
17+ cameras = self .cameras
18+ if cameras :
19+ for cam_name , cam_config in cameras .items ():
20+ for attr in ["width" , "height" , "fps" ]:
21+ if getattr (cam_config , attr ) is None :
22+ raise ValueError (
23+ f"Camera config for '{ cam_name } ' has None value for required attribute '{ attr } '"
24+ )
25+
1526 @property
1627 def type (self ) -> str :
1728 return self .get_choice_name (self .__class__ )
Original file line number Diff line number Diff line change 2828from lerobot .common .cameras .opencv import OpenCVCamera , OpenCVCameraConfig
2929from lerobot .common .errors import DeviceAlreadyConnectedError , DeviceNotConnectedError
3030
31+ # NOTE(Steven): Consider improving the assert coverage
32+
3133
3234def test_base_class_implementation ():
3335 config = OpenCVCameraConfig (index_or_path = 0 )
You can’t perform that action at this time.
0 commit comments