sl-jetson
ea26cda76a
feat(bridge): battery management node (Issue #125)
Add battery_node.py:
- Subscribes /saltybot/telemetry/battery (JSON from stm32_cmd_node)
- Publishes sensor_msgs/BatteryState on /saltybot/battery at 1 Hz
- SoC source priority: STM32 fuel gauge soc_pct field → fallback to
3S LiPo voltage curve (12-point lookup with linear interpolation)
- Charging detection: current_ma < -100 mA threshold
- Alert levels: WARNING (20%)→speed 60%, CRITICAL (10%)→speed 30%,
EMERGENCY (5%)→zero /cmd_vel + /saltybot/arm(False) disarm
- /saltybot/battery/alert JSON topic on threshold crossings
- /saltybot/speed_limit Float32 (0.0-1.0) for nav speed capping
- SQLite history logging: /var/log/saltybot/battery.db, 7-day retention
- Hourly prune timer to keep DB bounded
Add test_battery.py (70+ tests, no ROS2 runtime):
- SoC lookup: all curve points, interpolation, clamping, 3S/4S packs
- Alert level thresholds and transitions for all levels
- Speed factor assignments per alert level
- Charging detection logic
- sensor_msgs/BatteryState field population
- SQLite insert/retrieve/prune (in-memory and on-disk)
- JSON telemetry parsing: normal, charging, soc_pct=0 fallback
Add battery_params.yaml, battery.launch.py.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 09:27:06 -05:00
..
2026-03-02 09:27:06 -05:00
2026-03-02 09:17:54 -05:00
2026-03-02 08:38:24 -05:00
2026-02-28 22:59:13 -05:00
2026-03-01 00:42:18 -05:00
2026-02-28 22:57:58 -05:00
2026-03-01 00:48:03 -05:00
2026-03-02 09:17:54 -05:00
2026-03-02 08:38:49 -05:00
2026-03-01 00:52:54 -05:00
2026-03-02 08:41:40 -05:00
2026-02-28 23:21:24 -05:00
2026-03-01 01:07:06 -05:00
2026-03-02 09:03:28 -05:00
2026-03-01 01:15:13 -05:00
2026-03-01 01:15:13 -05:00
2026-03-02 08:23:19 -05:00
2026-03-01 23:32:26 -05:00
2026-03-01 23:31:48 -05:00
2026-03-02 08:23:19 -05:00
2026-03-01 23:15:00 -05:00
2026-03-01 23:56:05 -05:00
2026-03-02 08:50:22 -05:00
2026-03-01 23:59:10 -05:00
2026-03-01 01:06:50 -05:00
2026-02-28 23:19:23 -05:00
2026-03-02 09:14:37 -05:00
2026-03-01 23:25:08 -05:00
2026-03-01 23:25:08 -05:00