feat: Issue #365 — UWB DW3000 anchor/tag tracking (bearing + distance) #368
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-perception/issue-365-uwb-tracking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Software-complete UWB ranging stack for the two ESP32-UWB-Pro anchors. All code written against an abstract serial interface — fully testable without physical hardware while anchors are in transit.
New message type
UwbTarget.msg:valid,bearing_deg,distance_m,confidence,anchor0/1_dist_m,baseline_m,fix_quality(0=none, 1=single-anchor, 2=dual-anchor)Core library —
_uwb_tracker.py(pure Python, no ROS2/runtime deps)parse_frame(): ASCIIRANGE,<id>,<tag>,<mm>protocol decoder (mm→m)bearing_from_ranges(): law-of-cosines 2-anchor bearing geometry with confidence (penalises extreme angles and close-range poor geometry)bearing_single_anchor(): fallback when only one anchor responds — bearing=0, conf≤0.3BearingKalman: 1-D constant-velocity Kalman filter [bearing_deg, bearing_rate_dps]UwbRangingState: thread-safe per-anchor latest measurement + stale timeout + Kalman smoothingAnchorSerialReader: background thread withreadline()interface (works withserial.Serialor any file-like mock)ROS2 node —
uwb_node.py/dev/ttyUSB0+/dev/ttyUSB1(configurable via parameters)FIX_NONEuntil anchor plugged in/saltybot/uwb_targetat 10 Hz (configurable)port_anchor0,port_anchor1,baud_rate,baseline_m,publish_rate_hz,stale_timeout_sTests —
test/test_uwb_tracker.pyUwbRangingState: single/dual fix, stale timeout, thread safety (concurrent read/write), baseline storedAnchorSerialReader: mock serial feeding, STATUS ignored, malformed lines no crash, stop()Test plan
RANGEframes appear at ≥10 Hz/saltybot/uwb_targetat 10 Hz in RViz with target moving left/right at 5 mCloses #365
🤖 Generated with Claude Code