feat: auto-localization assist — yaw sweep until localized - #167
Draft
xiaolefang-dm wants to merge 9 commits into
Draft
feat: auto-localization assist — yaw sweep until localized#167xiaolefang-dm wants to merge 9 commits into
xiaolefang-dm wants to merge 9 commits into
Conversation
When the 'Assist' toggle is enabled on the Operate page:
- Nav ON starts map_node but NOT cmd_vel_control
- Backend runs a yaw sweep (±expanding angles, 5s dwell each)
- Once localized, sweep stops and cmd_vel_control starts normally
Backend changes (node_manager.py):
- _loc_assist_enabled / _loc_assist_thread / _loc_assist_stop_event state
- _loc_assist_loop(): expanding yaw sweep pattern via /cmd_vel
- _on_localization_achieved(): stops sweep, launches cmd_vel_control
- cmd_start_nav_nodes skips cmd_vel_control when assist is on
- cmd_stop_nav_nodes stops assist thread
- get_status() includes locAssistEnabled
API (routers/nav.py):
- POST /nav/loc-assist {enabled: bool} — toggle
- GET /nav/loc-assist — read state
Frontend:
- DeviceStatus.locAssistEnabled field
- _LocAssistToggle button on Operate page (bottom-right, above Nav)
|
|
|
|
|
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the Assist toggle is enabled on the Operate page, pressing Nav ON will:
cmd_vel_controlnormallyThis helps in scenarios where the robot's current view doesn't match any map keyframe, avoiding indefinite waiting.
Changes
app/backend/node_manager.pyapp/backend/routers/nav.pyPOST/GET /nav/loc-assistendpointsapp/frontend/lib/core/models.dartlocAssistEnabledin DeviceStatusapp/frontend/lib/pages/operate_tab.dart_LocAssistTogglebutton widgetTesting
Toggle off = original behavior
When Assist is OFF, Nav ON works exactly as before (map_node + cmd_vel_control start together).