-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(lane_change): refactor getLaneChangePaths function #8909
refactor(lane_change): refactor getLaneChangePaths function #8909
Conversation
Signed-off-by: mohammad alqudah <[email protected]>
…f-lane-change-module
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
…f-lane-change-module
Signed-off-by: mohammad alqudah <[email protected]>
…f-lane-change-module
Signed-off-by: mohammad alqudah <[email protected]>
…f-lane-change-module
…f-lane-change-module
Signed-off-by: mohammad alqudah <[email protected]>
…f-lane-change-module
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
…f-lane-change-module
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
…ule' into RT1-7829-refactor-code-get-lane-change-paths
…trics Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
…-paths Signed-off-by: mohammad alqudah <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only checked the code and it looks good.
The CI failure is caused by a random test failure so re-running it should fix the issue. (the random failure is supposed to be fixed by #8799 but I guess not).
...ng/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/calculation.cpp
Outdated
Show resolved
Hide resolved
...ng/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/calculation.cpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/scene.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
…-paths Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
planning/autoware_route_handler/include/autoware/route_handler/route_handler.hpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/autoware_behavior_path_lane_change_module/README.md
Outdated
Show resolved
Hide resolved
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
Signed-off-by: mohammad alqudah <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. LGTM!
…foundation#8909) * refactor lane change utility funcions Signed-off-by: mohammad alqudah <[email protected]> * LC utility function to get distance to next regulatory element Signed-off-by: mohammad alqudah <[email protected]> * don't activate LC module when close to regulatory element Signed-off-by: mohammad alqudah <[email protected]> * modify threshold distance calculation Signed-off-by: mohammad alqudah <[email protected]> * move regulatory element check to canTransitFailureState() function Signed-off-by: mohammad alqudah <[email protected]> * always run LC module if approaching terminal point Signed-off-by: mohammad alqudah <[email protected]> * use max possible LC length as threshold Signed-off-by: mohammad alqudah <[email protected]> * update LC readme Signed-off-by: mohammad alqudah <[email protected]> * refactor implementation Signed-off-by: mohammad alqudah <[email protected]> * update readme Signed-off-by: mohammad alqudah <[email protected]> * refactor checking data validity Signed-off-by: mohammad alqudah <[email protected]> * refactor sampling of prepare phase metrics and lane changing phase metrics Signed-off-by: mohammad alqudah <[email protected]> * add route handler function to get pose from 2d arc length Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path generation Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path safety check Signed-off-by: mohammad alqudah <[email protected]> * fix variable name Signed-off-by: mohammad alqudah <[email protected]> * Update planning/autoware_route_handler/src/route_handler.cpp Co-authored-by: Zulfaqar Azmi <[email protected]> * correct parameter name Signed-off-by: mohammad alqudah <[email protected]> * set prepare segment velocity after taking max path velocity value Signed-off-by: mohammad alqudah <[email protected]> * update LC README Signed-off-by: mohammad alqudah <[email protected]> * minor changes Signed-off-by: mohammad alqudah <[email protected]> * check phase length difference with previos valid candidate path Signed-off-by: mohammad alqudah <[email protected]> * change logger name Signed-off-by: mohammad alqudah <[email protected]> * change functions names to snake case Signed-off-by: mohammad alqudah <[email protected]> * use snake case for function names Signed-off-by: mohammad alqudah <[email protected]> * add colors to flow chart in README Signed-off-by: mohammad alqudah <[email protected]> --------- Signed-off-by: mohammad alqudah <[email protected]> Co-authored-by: Zulfaqar Azmi <[email protected]> Signed-off-by: prakash-kannaiah <[email protected]>
…foundation#8909) * refactor lane change utility funcions Signed-off-by: mohammad alqudah <[email protected]> * LC utility function to get distance to next regulatory element Signed-off-by: mohammad alqudah <[email protected]> * don't activate LC module when close to regulatory element Signed-off-by: mohammad alqudah <[email protected]> * modify threshold distance calculation Signed-off-by: mohammad alqudah <[email protected]> * move regulatory element check to canTransitFailureState() function Signed-off-by: mohammad alqudah <[email protected]> * always run LC module if approaching terminal point Signed-off-by: mohammad alqudah <[email protected]> * use max possible LC length as threshold Signed-off-by: mohammad alqudah <[email protected]> * update LC readme Signed-off-by: mohammad alqudah <[email protected]> * refactor implementation Signed-off-by: mohammad alqudah <[email protected]> * update readme Signed-off-by: mohammad alqudah <[email protected]> * refactor checking data validity Signed-off-by: mohammad alqudah <[email protected]> * refactor sampling of prepare phase metrics and lane changing phase metrics Signed-off-by: mohammad alqudah <[email protected]> * add route handler function to get pose from 2d arc length Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path generation Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path safety check Signed-off-by: mohammad alqudah <[email protected]> * fix variable name Signed-off-by: mohammad alqudah <[email protected]> * Update planning/autoware_route_handler/src/route_handler.cpp Co-authored-by: Zulfaqar Azmi <[email protected]> * correct parameter name Signed-off-by: mohammad alqudah <[email protected]> * set prepare segment velocity after taking max path velocity value Signed-off-by: mohammad alqudah <[email protected]> * update LC README Signed-off-by: mohammad alqudah <[email protected]> * minor changes Signed-off-by: mohammad alqudah <[email protected]> * check phase length difference with previos valid candidate path Signed-off-by: mohammad alqudah <[email protected]> * change logger name Signed-off-by: mohammad alqudah <[email protected]> * change functions names to snake case Signed-off-by: mohammad alqudah <[email protected]> * use snake case for function names Signed-off-by: mohammad alqudah <[email protected]> * add colors to flow chart in README Signed-off-by: mohammad alqudah <[email protected]> --------- Signed-off-by: mohammad alqudah <[email protected]> Co-authored-by: Zulfaqar Azmi <[email protected]>
…foundation#8909) * refactor lane change utility funcions Signed-off-by: mohammad alqudah <[email protected]> * LC utility function to get distance to next regulatory element Signed-off-by: mohammad alqudah <[email protected]> * don't activate LC module when close to regulatory element Signed-off-by: mohammad alqudah <[email protected]> * modify threshold distance calculation Signed-off-by: mohammad alqudah <[email protected]> * move regulatory element check to canTransitFailureState() function Signed-off-by: mohammad alqudah <[email protected]> * always run LC module if approaching terminal point Signed-off-by: mohammad alqudah <[email protected]> * use max possible LC length as threshold Signed-off-by: mohammad alqudah <[email protected]> * update LC readme Signed-off-by: mohammad alqudah <[email protected]> * refactor implementation Signed-off-by: mohammad alqudah <[email protected]> * update readme Signed-off-by: mohammad alqudah <[email protected]> * refactor checking data validity Signed-off-by: mohammad alqudah <[email protected]> * refactor sampling of prepare phase metrics and lane changing phase metrics Signed-off-by: mohammad alqudah <[email protected]> * add route handler function to get pose from 2d arc length Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path generation Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path safety check Signed-off-by: mohammad alqudah <[email protected]> * fix variable name Signed-off-by: mohammad alqudah <[email protected]> * Update planning/autoware_route_handler/src/route_handler.cpp Co-authored-by: Zulfaqar Azmi <[email protected]> * correct parameter name Signed-off-by: mohammad alqudah <[email protected]> * set prepare segment velocity after taking max path velocity value Signed-off-by: mohammad alqudah <[email protected]> * update LC README Signed-off-by: mohammad alqudah <[email protected]> * minor changes Signed-off-by: mohammad alqudah <[email protected]> * check phase length difference with previos valid candidate path Signed-off-by: mohammad alqudah <[email protected]> * change logger name Signed-off-by: mohammad alqudah <[email protected]> * change functions names to snake case Signed-off-by: mohammad alqudah <[email protected]> * use snake case for function names Signed-off-by: mohammad alqudah <[email protected]> * add colors to flow chart in README Signed-off-by: mohammad alqudah <[email protected]> --------- Signed-off-by: mohammad alqudah <[email protected]> Co-authored-by: Zulfaqar Azmi <[email protected]>
…foundation#8909) * refactor lane change utility funcions Signed-off-by: mohammad alqudah <[email protected]> * LC utility function to get distance to next regulatory element Signed-off-by: mohammad alqudah <[email protected]> * don't activate LC module when close to regulatory element Signed-off-by: mohammad alqudah <[email protected]> * modify threshold distance calculation Signed-off-by: mohammad alqudah <[email protected]> * move regulatory element check to canTransitFailureState() function Signed-off-by: mohammad alqudah <[email protected]> * always run LC module if approaching terminal point Signed-off-by: mohammad alqudah <[email protected]> * use max possible LC length as threshold Signed-off-by: mohammad alqudah <[email protected]> * update LC readme Signed-off-by: mohammad alqudah <[email protected]> * refactor implementation Signed-off-by: mohammad alqudah <[email protected]> * update readme Signed-off-by: mohammad alqudah <[email protected]> * refactor checking data validity Signed-off-by: mohammad alqudah <[email protected]> * refactor sampling of prepare phase metrics and lane changing phase metrics Signed-off-by: mohammad alqudah <[email protected]> * add route handler function to get pose from 2d arc length Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path generation Signed-off-by: mohammad alqudah <[email protected]> * refactor candidate path safety check Signed-off-by: mohammad alqudah <[email protected]> * fix variable name Signed-off-by: mohammad alqudah <[email protected]> * Update planning/autoware_route_handler/src/route_handler.cpp Co-authored-by: Zulfaqar Azmi <[email protected]> * correct parameter name Signed-off-by: mohammad alqudah <[email protected]> * set prepare segment velocity after taking max path velocity value Signed-off-by: mohammad alqudah <[email protected]> * update LC README Signed-off-by: mohammad alqudah <[email protected]> * minor changes Signed-off-by: mohammad alqudah <[email protected]> * check phase length difference with previos valid candidate path Signed-off-by: mohammad alqudah <[email protected]> * change logger name Signed-off-by: mohammad alqudah <[email protected]> * change functions names to snake case Signed-off-by: mohammad alqudah <[email protected]> * use snake case for function names Signed-off-by: mohammad alqudah <[email protected]> * add colors to flow chart in README Signed-off-by: mohammad alqudah <[email protected]> --------- Signed-off-by: mohammad alqudah <[email protected]> Co-authored-by: Zulfaqar Azmi <[email protected]>
Description
The function
getLaneChangePaths
in LC module is the main part of LC code and is responsible for sampling different candidate paths and verifying the validity and safety of the candidate path. However the function is very big and complex, which makes it difficult to understand and modify.This PR aims to refactor the
getLaneChangePaths
function to improve code readability and granularity and reduce its complexity.Changes
PhaseMetrics
to group relevant measurements (duration, length, velocity, lon. acc, lat. acc) for LC phasescalc_prepare_phase_metrics
to compute and return a list of sampled prepare phase metricscalc_shift_phase_metrics
to compute and return a list of sampled lane changing phase metricsgetCandidatePath
to process LC info and construct the cadidate pathcheckCandidatePathSafety
to verify LC candidate pathFlowchart of getLaneChangePaths function after refactoring
Related links
None.
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.