Skip to content

Commit

Permalink
Feature/diagnostics (#117)
Browse files Browse the repository at this point in the history
* Switched class (shared) variables to non-muteable types to prevent unexpected behaviour if they were ever changed

* Remove redundant getters and setters

* Remove duplicate variable definition

* Add topic message type and correct rates so they are not shared muteable variables
  • Loading branch information
hilary-luo authored and luis-camero committed Jan 28, 2025
1 parent 1b6a292 commit ed96653
Show file tree
Hide file tree
Showing 7 changed files with 476 additions and 565 deletions.
12 changes: 6 additions & 6 deletions clearpath_config/sensors/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ def __new__(cls, model: str) -> BaseIMU:


class Camera():
AXIS_CANERA = AxisCamera.SENSOR_MODEL
AXIS_CAMERA = AxisCamera.SENSOR_MODEL
FLIR_BLACKFLY = FlirBlackfly.SENSOR_MODEL
INTEL_REALSENSE = IntelRealsense.SENSOR_MODEL
STEREOLABS_ZED = StereolabsZed.SENSOR_MODEL
LUXONIS_OAKD = LuxonisOAKD.SENSOR_MODEL

MODEL = {
AXIS_CANERA: AxisCamera,
AXIS_CAMERA: AxisCamera,
FLIR_BLACKFLY: FlirBlackfly,
INTEL_REALSENSE: IntelRealsense,
STEREOLABS_ZED: StereolabsZed,
Expand Down Expand Up @@ -672,8 +672,8 @@ def add_camera(
)
if not camera and model:
camera = Camera(model)
camera.set_fps(fps)
camera.set_serial(serial)
camera.fps = fps
camera.serial = serial
camera.set_urdf_enabled(urdf_enabled)
camera.set_launch_enabled(launch_enabled)
camera.set_ros_parameters(ros_parameters)
Expand Down Expand Up @@ -793,11 +793,11 @@ def get_all_cameras_by_model(self, model: str) -> List[BaseCamera]:
all_model_camera.append(camera)
return all_model_camera

# Camera: Get All Objects of Model UST
# Camera: Get All Objects of Model Intel Realsense
def get_all_realsense(self) -> List[IntelRealsense]:
return self.get_all_cameras_by_model(Camera.INTEL_REALSENSE)

# Camera: Get All Objects of Model LMS1XX
# Camera: Get All Objects of Model Flir Blackfly
def get_all_blackfly(self) -> List[FlirBlackfly]:
return self.get_all_cameras_by_model(Camera.FLIR_BLACKFLY)

Expand Down
Loading

0 comments on commit ed96653

Please sign in to comment.