saltylab-firmware/jetson/ros2_ws/src/saltybot_emergency_stop
sl-firmware 381549b33f feat: Emergency stop cascade system (Issue #459)
Critical safety system with <50ms latency emergency response.

ROS2 action server /saltybot/estop with unified trigger sources:
- Voice commands: 'stop', 'emergency', 'e-stop'
- Gamepad emergency button
- IMU tilt detection (>45 degrees)
- LiDAR obstacle detection (<0.3m)
- Geofence boundary violation
- Watchdog timeout trigger
- MQTT remote kill signal

Cascade response (within 500ms):
1. Zero cmd_vel in <50ms (priority critical)
2. Disable autonomous mode
3. Face alert animation (emergency_stop)
4. LED red indicator
5. TTS alert announcement
6. Event logging + sensor snapshot

Safety properties:
- Cannot be overridden once triggered
- Manual resume only (gamepad Start or voice 'resume')
- Non-blockable execution (separate thread)
- Redundant trigger sources for reliability

Published topics:
- /saltybot/estop_active (Bool) - System state
- /saltybot/estop_event (String) - Event log (JSON)

Subscribed triggers:
- /camera/imu - Tilt detection
- /scan - Obstacle detection <0.3m
- /voice/command - Voice e-stop/resume
- /gamepad/emergency, /gamepad/start - Gamepad controls
- /saltybot/geofence_violation - Geofence boundary
- /saltybot/watchdog_timeout - Watchdog signal
- /saltybot/mqtt_kill - Remote kill signal

Package structure:
- estop_server: Main emergency stop node
- estop_config.yaml: Timing, triggers, cascade config
- estop.launch.py: Launch with safety parameters
- Unit tests for trigger detection and cascade timing

Logging: /home/seb/saltybot-data/estop/ (JSON format)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-05 09:19:31 -05:00
..

SaltyBot Emergency Stop Cascade System

Critical safety emergency stop system with <50ms latency response.

Features

Trigger Sources

  • Voice: "stop", "emergency", "e-stop"
  • Gamepad: Emergency button
  • Tilt: >45 degrees (IMU-based)
  • Obstacle: <0.3m (LiDAR)
  • Geofence: Boundary violation
  • Watchdog: Timeout trigger
  • MQTT: Remote kill signal

Cascade Response (within 500ms)

  1. Zero cmd_vel (<50ms) - Priority critical
  2. Disable autonomous - Prevent override
  3. Face alert - Emergency animation
  4. LED red - Visual indicator
  5. TTS alert - Audio confirmation
  6. Log event - Sensor snapshot + timestamp

Safety Properties

  • Cannot be overridden once triggered
  • Manual resume only - Gamepad Start or voice
  • Non-blockable - Uses separate thread
  • Redundant triggers - Multiple independent sources

Launch

ros2 launch saltybot_emergency_stop estop.launch.py

Topics

Published:

  • /saltybot/estop_active (Bool) - System state
  • /saltybot/estop_event (String) - Event JSON log

Subscribed:

  • /camera/imu (Imu) - Tilt detection
  • /scan (LaserScan) - Obstacle detection
  • /voice/command (String) - Voice triggers
  • /gamepad/emergency (Bool) - Gamepad e-stop
  • /gamepad/start (Bool) - Resume control
  • /saltybot/geofence_violation (Bool)
  • /saltybot/watchdog_timeout (Bool)
  • /saltybot/mqtt_kill (Bool) - Remote kill

Response Times

  • cmd_vel zeroed: <50ms
  • Full cascade: <500ms
  • Resume pending: Manual only

Logging

Location: /home/seb/saltybot-data/estop/

Format: estop_YYYYMMDD_HHMMSS.json

Includes:

  • Trigger source
  • State transitions
  • Sensor snapshot (tilt angle, IMU, LiDAR)
  • Timestamp

Resume Procedure

E-stop can only be resumed via:

  1. Gamepad: Press Start button
  2. Voice: Say "resume"
  3. Manual override not possible

System will:

  • Clear alert state
  • Set LED to green
  • Publish TTS resume message
  • Resume normal operation