saltybot_bridge ROS2 Python package (ament_python):
- serial_bridge_node.py: reads USB CDC JSON telemetry from STM32F722 at 50Hz
Parses exact firmware format: {"p","r","e","ig","m","s","y"} (all ×10 ints)
State enum: 0=DISARMED, 1=ARMED, 2=TILT_FAULT (matched to balance_state_t)
- Publishes sensor_msgs/Imu on /saltybot/imu (pitch/roll/yaw as angular_velocity)
- Publishes std_msgs/String on /saltybot/balance_state (full PID JSON diagnostics)
- Publishes diagnostic_msgs/DiagnosticArray on /diagnostics (OK/WARN/ERROR by state)
- Auto-reconnects on serial disconnect; IMU fault frames → ERROR diagnostic
- launch/bridge.launch.py with serial_port + baud_rate launch args
- config/bridge_params.yaml (921600 baud, /dev/ttyACM0)
- test/test_parse.py: 8 unit tests covering normal, fault, edge cases (all pass)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9 lines
340 B
YAML
9 lines
340 B
YAML
stm32_serial_bridge:
|
|
ros__parameters:
|
|
# STM32 USB CDC device node
|
|
# Use /dev/stm32-bridge if udev rule from jetson/docs/pinout.md is applied
|
|
serial_port: /dev/ttyACM0
|
|
baud_rate: 921600
|
|
timeout: 0.1 # serial readline timeout (seconds)
|
|
reconnect_delay: 2.0 # seconds between reconnect attempts on disconnect
|