New ROS2 package saltybot_uwb_espnow_relay:
- packet.py: EspNowPacket dataclass + FrameReader stateful decoder
- Parses 20-byte ESP-NOW packets: MAGIC, tag_id, msg_type, anchor_id,
range_mm (int32 LE), rssi_dbm (float32), timestamp_ms, battery_pct,
flags (bit0=estop), seq_num
- Serial framing: STX(0x02) + LEN(0x14) + DATA[20] + XOR-CRC(1)
- Sync recovery: re-hunts STX after bad LEN or CRC; byte-by-byte capable
- relay_node.py: /espnow_relay ROS2 node
- Reads from USB serial in background thread (auto-reconnects on error)
- MSG_RANGE (0x10): publishes UwbRange on /uwb/espnow/ranges
- MSG_ESTOP (0x20): publishes std_msgs/Bool on /uwb/espnow/estop
and /saltybot/estop (latched True for estop_latch_s after last packet)
- MSG_HEARTBEAT (0x30): publishes EspNowHeartbeat on /uwb/espnow/heartbeat
- Range validity gating: min_range_m / max_range_m params
- 16/16 unit tests passing (test/test_packet.py, no ROS2/hardware needed)
saltybot_uwb_msgs: add EspNowHeartbeat.msg
(tag_id, battery_pct, seq_num, timestamp_ms + std_msgs/Header)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11 lines
387 B
Plaintext
11 lines
387 B
Plaintext
# EspNowHeartbeat.msg — heartbeat status from ESP-NOW UWB tag (Issue #618)
|
|
#
|
|
# Published by the ESP-NOW relay node on each MSG_HEARTBEAT (0x30) frame.
|
|
|
|
std_msgs/Header header
|
|
|
|
uint8 tag_id # tag identifier
|
|
uint8 battery_pct # 0-100, or 255 = unknown
|
|
uint8 seq_num # rolling sequence number (detect loss)
|
|
uint32 timestamp_ms # ESP32 millis() at time of transmission
|