Skip to content

feat(nav): per-POI navigation progress with dynamic ETA #129

Open
xiaolefang-dm wants to merge 20 commits intomainfrom
feat/poi-nav-auto-done
Open

feat(nav): per-POI navigation progress with dynamic ETA #129
xiaolefang-dm wants to merge 20 commits intomainfrom
feat/poi-nav-auto-done

Conversation

@xiaolefang-dm
Copy link
Copy Markdown
Contributor

Summary

  • /mapping/nav_progress ROS topicmap_node publishes per-POI path progress on every keyframe: current POI index, completion %, remaining path distance, and estimated remaining time. Speed is derived dynamically from covered
    distance / elapsed time and carried over across POI transitions for a progressively better estimate. Publishes 100% on arrival before moving to the next POI.
  • Dedicated /ws/nav-progress WebSocket — backend subscribes to the ROS topic and forwards each message immediately via a new /ws/nav-progress endpoint, so the frontend updates at full topic rate instead of the 1 s status poll.
  • Navigation progress overlay in Operate tab — floating overlay above the map buttons showing → <POI name> XX% · X.Xm · ~Xs. Flashes green "Arrived" for 1.2 s when all POIs are visited.
  • Fix: global map path coordinates_GlobalMapView was passing globalPath (odom frame) to MapOverlayPainter; corrected to mapGlobalPath (map frame) to match the coordinate system expected by _worldToImage.
  • Fix: relocalization map pose — backend now stores map_pose when a relocalization message arrives so the PiP map has a robot position to draw immediately after localization.
  • Auto nav-donemap_node publishes /mapping/nav_done when all POIs are visited; backend transitions state navigation → idle and clears the active POI list in the frontend.
  • Active POIs on PiP map — PiP map shows the currently active nav POIs after Go is pressed.
3.mov

xiaolefang and others added 20 commits April 30, 2026 09:58
map_node publishes Bool(True) to /mapping/nav_done once all POIs
are reached (guarded by _nav_completed flag to avoid repeat fires);
BackendNode subscribes and transitions state back to idle so the
frontend POI button restores automatically without manual cancel.
_nav_completed resets when new POIs arrive via pois_callback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Capture Navigator before await to avoid stale context; replace
whenData (which doesn't await the returned future) with direct
valueOrNull call so the async close actually runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add _MapToggleButton to switch between Local and Global map views when localized
- Show selected POIs on global map after Go; clear them when nav ends or is cancelled
- Add robot footprint rectangle (0.7m × 0.3m, Go2 config) to local planning view
  mirroring /planning/footprint topic data

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_on_relocalization now stores the pose dict so the PiP map
can show the robot arrow immediately after localization,
without waiting for POI navigation to start.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Increase stroke width 1.5→2.5 and fill opacity for better
contrast on dark background.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously footprint was drawn before the arrow and got covered
by the white fill. Now draws after as a yellow outline-only,
always visible regardless of zoom level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root cause: at default 10m grid scale (40px/m), footprint
fl=0.35m×40=14px coincided exactly with arrow tip=14px,
making the rectangle completely hidden behind the arrow.

Fix: use max(world_scale, min_pixels) so footprint always
clearly surrounds the arrow (min 22px front, 18px rear, 12px half-w).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously drew a hardcoded rectangle (wrong). Now:
- node_manager subscribes to /planning/footprint (PointCloud)
- extracts x,y points and includes in planning snapshot
- PlanningState.footprint parsed from WS payload
- LocalPlanningPainter draws the actual footprint polygon
  using same world→canvas transform as trajectory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused pose param from _PoiButton / _PoiSheet
- Remove showFootprint toggle (footprint always drawn when data present)
- Hide _LayerTogglePanel when global map view is active

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both features did not work reliably. Clean slate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pass activeNavPois from _CameraPanel to _MapPip so selected
POIs appear as markers on the picture-in-picture map.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Publishes per-POI path progress on each keyframe update so the upper
layer can show completion percentage and estimated remaining time.
Speed is derived from covered/elapsed distance and carried over across
POI transitions for a progressively better estimate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…card

- map_node publishes percent=100 on POI arrival before incrementing index
- backend subscribes /mapping/nav_progress and forwards via /ws/status
- NavProgress model added to DeviceStatus
- nav status card shows progress bar + remaining distance + ETA;
  flashes green 100% for 1.2s after nav completes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nate frame

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…for compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Socket

Instead of polling via /ws/status every 1s, push progress events
directly from the ROS callback so the UI updates at full topic rate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Shows POI index, remaining distance, ETA and progress bar as a
floating overlay above the map bottom buttons. Flashes green
Arrived!/100% for 1.2s when navigation completes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (253.1 files/s, 37544.3 lines/s)
Language files blank comment code
Python 13 618 262 3449
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 938 359 4934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant