forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(behavior_path_planner): change side shift module logic (autoware…
…foundation#2195) * change side shift module design Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> * cherry picked side shift controller Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> * add debug marker to side shift Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> * fix pointer error due to direct assignment added make_shared Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * add flow chart Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> * add status of AFTER_SHIFT Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> * remove function for debug Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> * ci(pre-commit): autofix * fix flow chart Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> * ci(pre-commit): autofix Signed-off-by: kyoichi sugahara <81.s.kyo.19@gmail.com> Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> Co-authored-by: tanaka3 <ttatcoder@outlook.jp> Co-authored-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9183c4f
commit 77b1c36
Showing
3 changed files
with
154 additions
and
94 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
planning/behavior_path_planner/behavior_path_planner_side-shift.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Side shift Module | ||
|
||
(For remote control) Shift the path to left or right according to an external instruction. | ||
|
||
## Flowchart | ||
|
||
```plantuml | ||
@startuml | ||
skinparam monochrome true | ||
skinparam defaultTextAlignment center | ||
skinparam noteTextAlignment left | ||
title callback function of lateral offset input | ||
start | ||
partition onLateralOffset { | ||
:**INPUT** double new_lateral_offset; | ||
if (abs(inserted_lateral_offset_ - new_lateral_offset) < 1e-4) then ( true) | ||
stop | ||
else ( false) | ||
if (interval from last request is too short) then ( no) | ||
else ( yes) | ||
:requested_lateral_offset_ = new_lateral_offset \n lateral_offset_change_request_ = true; | ||
endif | ||
stop | ||
@enduml | ||
``` | ||
|
||
```plantuml --> | ||
@startuml | ||
skinparam monochrome true | ||
skinparam defaultTextAlignment center | ||
skinparam noteTextAlignment left | ||
title path generation | ||
start | ||
partition plan { | ||
if (lateral_offset_change_request_ == true \n && \n (shifting_status_ == BEFORE_SHIFT \n || \n shifting_status_ == AFTER_SHIFT)) then ( true) | ||
partition replace-shift-line { | ||
if ( shift line is inserted in the path ) then ( yes) | ||
:erase left shift line; | ||
else ( no) | ||
endif | ||
:calcShiftLines; | ||
:add new shift lines; | ||
:inserted_lateral_offset_ = requested_lateral_offset_ \n inserted_shift_lines_ = new_shift_line; | ||
} | ||
else( false) | ||
endif | ||
stop | ||
@enduml | ||
``` | ||
|
||
```plantuml | ||
@startuml | ||
skinparam monochrome true | ||
skinparam defaultTextAlignment center | ||
skinparam noteTextAlignment left | ||
title update state | ||
start | ||
partition updateState { | ||
:last_sp = path_shifter_.getLastShiftLine(); | ||
note left | ||
get furthest shift lines | ||
end note | ||
:calculate max_planned_shift_length; | ||
note left | ||
calculate furthest shift length of previous shifted path | ||
end note | ||
if (abs(inserted_lateral_offset_ - inserted_shift_line_.end_shift_length) < 1e-4 \n && \n abs(max_planned_shift_length) < 1e-4 \n && \n abs(requested_lateral_offset_) < 1e-4) then ( true) | ||
:current_state_ = BT::NodeStatus::SUCCESS; | ||
else (false) | ||
if (ego's position is behind of shift line's start point) then( yes) | ||
:shifting_status_ = BEFORE_SHIFT; | ||
else ( no) | ||
if ( ego's position is between shift line's start point and end point) then (yes) | ||
:shifting_status_ = SHIFTING; | ||
else( no) | ||
:shifting_status_ = AFTER_SHIFT; | ||
endif | ||
endif | ||
:current_state_ = BT::NodeStatus::RUNNING; | ||
endif | ||
stop | ||
} | ||
@enduml | ||
``` |
This file contains 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
This file contains 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