LED status indicators for balance states #685

Closed
opened 2026-03-17 22:38:52 -04:00 by seb · 0 comments
Owner

Feature

Use Mamba onboard LEDs (PC15=LED1, PC14=LED2, active low) for state feedback AND as a ROS2-controllable actuator over CAN.

Two modes

1. Auto mode (default)

Firmware drives LEDs based on internal state:

State LED1 (PC15) LED2 (PC14)
Boot / init Fast alternating Fast alternating
Calibrating IMU Slow blink 500ms OFF
Disarmed OFF Pulse 1Hz
Armed / balancing Solid ON Solid ON
Rolling (motor_cmd > 50) Solid ON Fast blink 5Hz
Parked Both sync blink 1Hz Both sync blink 1Hz
E-Stop / fault Both fast blink 10Hz Both fast blink 10Hz

2. ROS2 override mode

Orin can send a CAN frame to override LED state for social/expressive purposes (eyes, emotions, notifications):

  • CAN frame: custom LED command (LED1 pattern, LED2 pattern, duration_ms, priority)
  • Patterns: OFF, ON, BLINK_SLOW, BLINK_FAST, PULSE
  • After duration_ms, reverts to auto mode
  • Priority: if safety state is ESTOP/FAULT, auto mode always wins
  • ROS2 topic: /saltybot/leds (publish LED command → CAN frame → Mamba)

Notes

  • LEDs are active low (GPIO LOW = ON)
  • PC15 = LED1, PC14 = LED2
  • If LED strip (PB3) is connected, extend ROS2 control to RGB strip too
  • Safety states (ESTOP, FAULT) always override ROS2 commands
  • Coordinate with CAN telemetry frame design (#680)
## Feature Use Mamba onboard LEDs (PC15=LED1, PC14=LED2, active low) for state feedback AND as a ROS2-controllable actuator over CAN. ## Two modes ### 1. Auto mode (default) Firmware drives LEDs based on internal state: | State | LED1 (PC15) | LED2 (PC14) | |---|---|---| | Boot / init | Fast alternating | Fast alternating | | Calibrating IMU | Slow blink 500ms | OFF | | Disarmed | OFF | Pulse 1Hz | | Armed / balancing | Solid ON | Solid ON | | Rolling (motor_cmd > 50) | Solid ON | Fast blink 5Hz | | Parked | Both sync blink 1Hz | Both sync blink 1Hz | | E-Stop / fault | Both fast blink 10Hz | Both fast blink 10Hz | ### 2. ROS2 override mode Orin can send a CAN frame to override LED state for social/expressive purposes (eyes, emotions, notifications): - CAN frame: custom LED command (LED1 pattern, LED2 pattern, duration_ms, priority) - Patterns: OFF, ON, BLINK_SLOW, BLINK_FAST, PULSE - After `duration_ms`, reverts to auto mode - Priority: if safety state is ESTOP/FAULT, auto mode always wins - ROS2 topic: `/saltybot/leds` (publish LED command → CAN frame → Mamba) ## Notes - LEDs are active low (GPIO LOW = ON) - PC15 = LED1, PC14 = LED2 - If LED strip (PB3) is connected, extend ROS2 control to RGB strip too - Safety states (ESTOP, FAULT) always override ROS2 commands - Coordinate with CAN telemetry frame design (#680)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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