Apply suggestions from code review 3
Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com>
This commit is contained in:
@@ -27,14 +27,12 @@ class RobotConfig(draccus.ChoiceRegistry, abc.ABC):
|
||||
calibration_dir: Path | None = None
|
||||
|
||||
def __post_init__(self):
|
||||
if hasattr(self, "cameras"):
|
||||
cameras = self.cameras
|
||||
if cameras:
|
||||
for cam_name, cam_config in cameras.items():
|
||||
for attr in ["width", "height", "fps"]:
|
||||
if getattr(cam_config, attr) is None:
|
||||
raise ValueError(
|
||||
f"Camera config for '{cam_name}' has None value for required attribute '{attr}'"
|
||||
if hasattr(self, "cameras") and self.cameras:
|
||||
for name, config in self.cameras.items():
|
||||
for attr in ["width", "height", "fps"]:
|
||||
if getattr(config, attr) is None:
|
||||
raise ValueError(
|
||||
f"Specifying '{attr}' is required for the camera to be used in a robot"
|
||||
)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user