fix(avoidance): fix invalid optional access #5804
Analysis complete
Summary
Improved return-to-center shift line generation in behavior_path_avoidance_module
. Added a threshold and adjusted the shift point condition to reduce redundant or invalid shift lines.
Walkthrough
- Introduce a constant
RETURN_SHIFT_THRESHOLD
to define the minimum shift length for return-to-center shift lines (link) - Modify the condition for registering return-to-center shift points to check both the initial and the last shift lengths (link)
- Avoid a potential null pointer dereference when accessing the
last_
value by adding ahas_value()
check (link)
Poem
To avoid path collisions with care
We improved the shift line logic there
We addedRETURN_SHIFT_THRESHOLD
To reduce the shift line wealth
And checked the last line in the pair
Emoji
🛣️🔧🚗
Include these descriptions in your pull request description by including the following marker tags:
copilot:all
: all the content, in one gocopilot:summary
: a one paragraph summary of the code changescopilot:walkthrough
: a step by step walkthrough of the code changescopilot:poem
: a poem about the code changes!copilot:emoji
: three emoji that capture the changes
Feedback is welcome. Simply add a comment to this PR of the form /copilot feedback [your comments here]
.
Details
Copilot for PRs is a limited technical preview from GitHub Next.
It's aim is to make it easier to write pull request descriptions by providing automatically generated suggestions based on the code changes.
To find out more go to https://githubnext.com/projects/copilot-for-pull-requests or come and chat with us on Discord
File | Status | Duration |
---|---|---|
Summary & Walkthrough | ✅ Finished | 16 seconds |
planning/behavior_path_avoidance_module/src/shift_line_generator.cpp | ✅ Finished | 9.5 seconds |