feat: VESC MQTT telemetry relay (Issue #656) #660

Merged
sl-jetson merged 1 commits from sl-android/issue-656-vesc-mqtt-relay into main 2026-03-18 07:55:42 -04:00
Collaborator

Summary

  • New vesc_mqtt_relay_node.py in saltybot_phone: subscribes to /vesc/left/state, /vesc/right/state, /vesc/combined (ROS2 std_msgs/String JSON from vesc_telemetry_node)
  • Publishes to MQTT: saltybot/phone/vesc_left, saltybot/phone/vesc_right, saltybot/phone/vesc_combined
  • Per-motor JSON payload: rpm, current_a, voltage_v, temperature_c (FET temp), duty_cycle, fault_code, ts
  • Rate-limited to 5 Hz per topic (configurable via motor_rate_hz parameter)
  • New entry point vesc_mqtt_relay registered in setup.py

Test plan

  • 32 unit tests in test/test_vesc_mqtt_relay.py (no ROS2/paho required) — all pass
  • _extract_motor_payload: all required fields, type coercion, negative RPM/current/duty, missing stamp fallback, JSON roundtrip
  • _extract_combined_payload: all fields, alive flags, JSON roundtrip
  • Rate-limit gate: first message passes, sub-interval drops, post-interval passes, 10 Hz / 1 Hz / independent topic variants

🤖 Generated with Claude Code

## Summary - New `vesc_mqtt_relay_node.py` in `saltybot_phone`: subscribes to `/vesc/left/state`, `/vesc/right/state`, `/vesc/combined` (ROS2 `std_msgs/String` JSON from `vesc_telemetry_node`) - Publishes to MQTT: `saltybot/phone/vesc_left`, `saltybot/phone/vesc_right`, `saltybot/phone/vesc_combined` - Per-motor JSON payload: `rpm`, `current_a`, `voltage_v`, `temperature_c` (FET temp), `duty_cycle`, `fault_code`, `ts` - Rate-limited to 5 Hz per topic (configurable via `motor_rate_hz` parameter) - New entry point `vesc_mqtt_relay` registered in `setup.py` ## Test plan - [x] 32 unit tests in `test/test_vesc_mqtt_relay.py` (no ROS2/paho required) — all pass - [x] `_extract_motor_payload`: all required fields, type coercion, negative RPM/current/duty, missing stamp fallback, JSON roundtrip - [x] `_extract_combined_payload`: all fields, alive flags, JSON roundtrip - [x] Rate-limit gate: first message passes, sub-interval drops, post-interval passes, 10 Hz / 1 Hz / independent topic variants 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sl-jetson added 1 commit 2026-03-17 11:35:20 -04:00
Add vesc_mqtt_relay_node.py to saltybot_phone: subscribes to
/vesc/left/state, /vesc/right/state, /vesc/combined ROS2 topics and
publishes JSON telemetry to saltybot/phone/vesc_{left,right,combined}
MQTT topics at 5 Hz per motor.  32 unit tests, no ROS2/paho required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sl-jetson merged commit 6561e35fd6 into main 2026-03-18 07:55:42 -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#660
No description provided.