feat: GPS waypoint logger (Issue #617) #620
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-android/issue-617-waypoint-logger"
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
phone/waypoint_logger.py— interactive Termux CLI for recording, managing, and publishing GPS waypoints from the phone to SaltyBot's Nav2 stack.Commands
rldpsaltybot/phone/route, retained)cniqGPS acquisition
termux-location -p gps -r once→ automatic fallback tonetworkon timeout--live-gps: subscribes tosaltybot/phone/gpsMQTT topic (reuses sensor_dashboard.py stream — no double GPS call)MQTT output (
saltybot/phone/route, QoS 1, retained)Nav2 integration
nav2_posesarray uses flat-earth ENU coordinates (metres from first waypoint). Yaw faces the next waypoint; last waypoint faces previous. Compatible with Nav2FollowWaypointsaction input format.Geo maths
haversine_m()— great-circle distance;bearing_deg()→ 8-point compassflat_earth_xy()— ENU metres (< 1% error within 100 km)Persistence
Route auto-saved to
~/saltybot_route.jsonon every change; reloaded on startup.Flags
--broker,--port,--file,--route,--provider gps|network|passive,--live-gps,--no-mqtt,--debugTest plan
python3 -m py_compile phone/waypoint_logger.py— syntax cleanpython3 phone/waypoint_logger.py --no-mqtt— menu appearsr→ records waypoint with GPS fix, name prompt worksl→ lists waypoints; distance/bearing shown between consecutive pointslshows cumulative distances + compass headingsd 1→ deletes wp#1, remaining indices renumberedp→mosquitto_sub -t saltybot/phone/routeshows full JSON with nav2_poses--live-gps→ subscribes to saltybot/phone/gps, skips termux-location callc→ clears route, confirms 0 waypoints after🤖 Generated with Claude Code
Add phone/waypoint_logger.py — interactive Termux CLI for recording, managing, and publishing GPS waypoints: GPS acquisition - termux-location with gps/network/passive provider selection - Falls back to network provider on GPS timeout - Optional --live-gps flag: subscribes to saltybot/phone/gps MQTT topic (sensor_dashboard.py stream) to avoid redundant GPS calls Waypoint operations - Record: acquires GPS fix, prompts for name + tags, appends to route - List: table with lat/lon/alt/accuracy/tags + inter-waypoint distance (haversine) and bearing (8-point compass) - Delete: by index with confirmation prompt - Clear: entire route with confirmation - Rename: route name Persistence - Routes saved as JSON to ~/saltybot_route.json (configurable) - Auto-loads on startup; survives session restarts MQTT publish (saltybot/phone/route, QoS 1, retained) - Full waypoint list with metadata - nav2_poses array: flat-earth x/y (metres from origin), quaternion yaw facing next waypoint (last faces prev) - Compatible with Nav2 FollowWaypoints action input Geo maths - haversine_m(): great-circle distance - bearing_deg(): initial bearing with 8-point compass label - flat_earth_xy(): ENU metres for Nav2 pose export (<1% error <100km) Flags: --broker, --port, --file, --route, --provider, --live-gps, --no-mqtt, --debug Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>