feat: Jetson→STM32 command protocol — /cmd_vel to serial (Phase 2)
STM32 firmware (C):
- include/jetson_cmd.h: protocol constants (HB_TIMEOUT_MS=500,
SPEED_MAX_DEG=4°), API for jetson_cmd_process/is_active/steer/sp_offset
- src/jetson_cmd.c: main-loop parser for buffered C<spd>,<str> frames;
setpoint offset = speed/1000 * 4°; steer clamped ±1000
- lib/USB_CDC/src/usbd_cdc_if.c: add H (heartbeat) and C (drive cmd) to
CDC_Receive ISR — follows existing pattern: H updates jetson_hb_tick in
ISR, C copied to jetson_cmd_buf for main-loop sscanf (avoids sscanf in IRQ)
- src/main.c: integrate jetson_cmd — process buffered frame, apply setpoint
offset around balance_update(), inject steer into motor_driver_update()
only when heartbeat alive (fallback: steer=0, setpoint unchanged)
ROS2 (Python):
- saltybot_cmd_node.py: full bidirectional node — owns serial port, handles
telemetry RX → topics AND /cmd_vel TX → C<spd>,<str>\n + H\n heartbeat
200ms timer; sends C0,0\n on shutdown; speed/steer_scale configurable
- serial_bridge_node.py: add write_serial() helper for extensibility
- launch/bridge.launch.py: mode arg (bidirectional|rx_only) selects node
- config/bridge_params.yaml: heartbeat_period, speed_scale, steer_scale docs
- test/test_cmd.py: 13 tests — zero, full fwd/rev, turn clamping, combined
- setup.py: saltybot_cmd_node entry point
All 21 tests pass (8 parse + 13 cmd).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>