Skip to content

fix(planning,control): stabilize reverse behavior and decouple front-distance reflex#124

Open
xiaolefang-dm wants to merge 13 commits intomainfrom
xiaole/optimized/planning
Open

fix(planning,control): stabilize reverse behavior and decouple front-distance reflex#124
xiaolefang-dm wants to merge 13 commits intomainfrom
xiaole/optimized/planning

Conversation

@xiaolefang-dm
Copy link
Copy Markdown
Contributor

  • keep reverse decision in planner only, with a single reverse candidate and front-clearance threshold gating
  • remove front-distance topic coupling between planner and controller
  • simplify cmd_vel_control behavior by keeping rotate-first gating for forward motion and enforcing straight-line reverse (vyaw=0 when reversing)
  • tune low-speed deadband for smoother low-speed control response

@xiaolefang-dm xiaolefang-dm force-pushed the xiaole/optimized/planning branch from 7baa340 to ff67ae9 Compare April 29, 2026 08:30
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (253.8 files/s, 37212.9 lines/s)
Language files blank comment code
Python 13 611 263 3382
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 931 360 4867

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (248.4 files/s, 36501.9 lines/s)
Language files blank comment code
Python 13 611 265 3394
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 931 362 4879

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (245.3 files/s, 36040.9 lines/s)
Language files blank comment code
Python 13 611 265 3394
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 931 362 4879

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.13 s (331.1 files/s, 48654.9 lines/s)
Language files blank comment code
Python 13 611 265 3393
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 931 362 4878

xiaolefang and others added 11 commits April 29, 2026 22:11
target_pose is never cleared on arrival, so planning_node kept generating
paths and the robot never stopped. Now publishes an empty path once within
0.3m of target_pose so cmd_vel_control stale-path protection kicks in.

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

target_pose is a camera-frame position (POI recorded as camera pose),
but previously compared against robot control center which is 0.35m
behind the camera, so dist_to_goal was always ~0.35m > 0.3m threshold.
Now compare T[:3,3] (camera position) directly to target_pose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
map_node already detects arrival (dist < 0.5m) and publishes poi_change,
which clears target_pose in planning_node, which then publishes an empty
path to stop the robot. The dist_to_goal guard here is unreachable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed redundant path publishing when target_pose is None or all trajectories are in collision.
Keep planner forward-only and delegate reverse handling to cmd_vel, while adding front-obstacle reflex and simple rotate-first gating to reduce risky turn-and-go behavior.

Made-with: Cursor
Drop front_dist publisher coupling and keep reverse selection fully inside planning cost with single reverse candidate and front-clearance threshold gating.

Made-with: Cursor
Normalize EOF newlines for planning_node.py and cmd_vel_control.py.

Made-with: Cursor
Clean up unresolved conflict marker that caused ruff syntax failure in CI.

Made-with: Cursor
…amline velocity sampling

Added a new function to generate predefined trajectory vocabularies, allowing for future behaviors to be easily appended. Simplified the velocity sampling in the trajectory generation by removing the reverse sample and directly using a linear space for forward velocities. Updated trajectory generation in the PlanningNode to incorporate the new vocabulary, enhancing maneuvering capabilities.
@xiaolefang-dm xiaolefang-dm force-pushed the xiaole/optimized/planning branch from 59f7d8f to a7a9e12 Compare April 29, 2026 14:59
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (253.6 files/s, 37677.0 lines/s)
Language files blank comment code
Python 13 619 274 3444
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 939 371 4929

…fy comments

Updated the cost function in PlanningNode to improve clarity and maintainability. Introduced clearer comments regarding predefined backward trajectory penalties and streamlined the logic for determining when to apply reverse penalties. This refactor aims to enhance the understanding of trajectory evaluations and improve the overall planning logic.
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.16 s (256.9 files/s, 38144.7 lines/s)
Language files blank comment code
Python 13 619 273 3443
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 939 370 4928

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.13 s (319.0 files/s, 47378.8 lines/s)
Language files blank comment code
Python 13 619 273 3443
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 939 370 4928

@xiaolefang-dm xiaolefang-dm requested a review from dvorak0 April 29, 2026 15:49
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