feat: ROS2 sensor health monitor (Issue #566) #572

Merged
sl-jetson merged 2 commits from sl-jetson/issue-566-health-monitor into main 2026-03-14 11:49:56 -04:00
Collaborator

Summary

Adds sensor_health_node to the existing saltybot_health_monitor package (Issue #566).

  • Monitors 8 sensor topics for staleness: /camera/color/image_raw, /camera/depth/image_rect_raw, /camera/color/camera_info, /scan, /imu/data, /saltybot/uwb/range, /saltybot/battery, /saltybot/motor_daemon/status
  • Per-sensor OK/WARN/ERROR thresholds (configurable via sensor_health_params.yaml)
  • Publishes DiagnosticArray on /saltybot/diagnostics at configurable rate (default 1 Hz)
  • Publishes JSON summary on /saltybot/sensor_health
  • MQTT to saltybot/health (paho-mqtt, optional — graceful degradation if not installed)
  • Thread-safe SensorWatcher with message rate estimation (rolling 2 s window)
  • Critical sensor escalation: camera, lidar, IMU, motor_daemon drive overall ERROR status
  • 35 unit tests, all passing offline (no ROS2 runtime or hardware required)

Files

  • sensor_health_node.py — SensorWatcher + SensorHealthNode
  • config/sensor_health_params.yaml — per-sensor thresholds
  • launch/sensor_health.launch.py — launch file
  • test/test_sensor_health.py — 35 unit tests
  • setup.py/package.xml — sensor_msgs + diagnostic_msgs deps, new entry point

Test plan

  • colcon build --packages-select saltybot_health_monitor succeeds
  • ros2 launch saltybot_health_monitor sensor_health.launch.py starts
  • /saltybot/diagnostics publishes DiagnosticArray at 1 Hz
  • Stop camera → camera_color ERROR within 3s; restart → OK within 1s
  • mosquitto_sub -t saltybot/health receives JSON updates at 1 Hz
  • mqtt_enabled:=false launches cleanly, no errors
  • pytest test/test_sensor_health.py → 35/35 passed

Closes #566

## Summary Adds **sensor_health_node** to the existing **saltybot_health_monitor** package (Issue #566). - Monitors 8 sensor topics for staleness: /camera/color/image_raw, /camera/depth/image_rect_raw, /camera/color/camera_info, /scan, /imu/data, /saltybot/uwb/range, /saltybot/battery, /saltybot/motor_daemon/status - Per-sensor OK/WARN/ERROR thresholds (configurable via sensor_health_params.yaml) - Publishes DiagnosticArray on /saltybot/diagnostics at configurable rate (default 1 Hz) - Publishes JSON summary on /saltybot/sensor_health - MQTT to saltybot/health (paho-mqtt, optional — graceful degradation if not installed) - Thread-safe SensorWatcher with message rate estimation (rolling 2 s window) - Critical sensor escalation: camera, lidar, IMU, motor_daemon drive overall ERROR status - 35 unit tests, all passing offline (no ROS2 runtime or hardware required) ## Files - sensor_health_node.py — SensorWatcher + SensorHealthNode - config/sensor_health_params.yaml — per-sensor thresholds - launch/sensor_health.launch.py — launch file - test/test_sensor_health.py — 35 unit tests - setup.py/package.xml — sensor_msgs + diagnostic_msgs deps, new entry point ## Test plan - [ ] colcon build --packages-select saltybot_health_monitor succeeds - [ ] ros2 launch saltybot_health_monitor sensor_health.launch.py starts - [ ] /saltybot/diagnostics publishes DiagnosticArray at 1 Hz - [ ] Stop camera → camera_color ERROR within 3s; restart → OK within 1s - [ ] mosquitto_sub -t saltybot/health receives JSON updates at 1 Hz - [ ] mqtt_enabled:=false launches cleanly, no errors - [ ] pytest test/test_sensor_health.py → 35/35 passed Closes #566
sl-jetson added 2 commits 2026-03-14 11:49:02 -04:00
Add sensor_health_node to saltybot_health_monitor package. Monitors 8
sensor topics for staleness, publishing DiagnosticArray on
/saltybot/diagnostics and MQTT JSON on saltybot/health.

Sensors monitored (configurable thresholds):
  /camera/color/image_raw, /camera/depth/image_rect_raw,
  /camera/color/camera_info, /scan, /imu/data,
  /saltybot/uwb/range, /saltybot/battery, /saltybot/motor_daemon/status

Each sensor: OK/WARN/ERROR based on topic age vs warn_s/error_s thresholds.
Critical sensors (camera, lidar, imu, motor_daemon) escalate overall status.

Files added:
  sensor_health_node.py — SensorWatcher + SensorHealthNode
  config/sensor_health_params.yaml — per-sensor thresholds
  launch/sensor_health.launch.py
  test/test_sensor_health.py — 35 tests, all passing

setup.py/package.xml updated: sensor_msgs, diagnostic_msgs deps + new entry point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sl-jetson merged commit 35440b7463 into main 2026-03-14 11:49:56 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#572
No description provided.