Skip to content

Commit 7d52394

Browse files
docs(lane_change): update documentation
Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
1 parent 1b45a7e commit 7d52394

File tree

1 file changed

+83
-0
lines changed
  • planning/behavior_path_lane_change_module

1 file changed

+83
-0
lines changed

planning/behavior_path_lane_change_module/README.md

+83
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,89 @@ longitudinal_acceleration_resolution = (maximum_longitudinal_acceleration - mini
6060

6161
Note that when the `current_velocity` is lower than `minimum_lane_changing_velocity`, the vehicle needs to accelerate its velocity to `minimum_lane_changing_velocity`. Therefore, longitudinal acceleration becomes positive value (not decelerate).
6262

63+
The chart illustrates the conditions under which longitudinal acceleration values are sampled.
64+
65+
```plantuml
66+
@startuml
67+
skinparam defaultTextAlignment center
68+
skinparam backgroundColor #WHITE
69+
70+
start
71+
72+
if (prev_module_path is empty?) then (yes)
73+
:Return empty list;
74+
stop
75+
else (no)
76+
endif
77+
78+
if (max_acc <= 0.0) then (yes)
79+
:Return **sampled acceleration values**;
80+
note left: Calculated sampled acceleration using\n<color:red>getAccelerationValues(min_acc, max_acc, longitudinal_acc_sampling_num)</color>
81+
stop
82+
endif
83+
84+
if (max_lane_change_length > ego's distance to the end of the current lanes.) then (yes)
85+
:Return **sampled acceleration values**;
86+
stop
87+
endif
88+
89+
if (isVehicleStuck(current_lanes)) then (yes)
90+
:Return **sampled acceleration values**;
91+
stop
92+
else (no)
93+
endif
94+
95+
if (is goal is in target lanes) then (yes)
96+
if (max_lane_change_length < ego's distance to the goal along the target lanes) then (yes)
97+
:Return {max_acc};
98+
stop
99+
else (no)
100+
endif
101+
else (no)
102+
if (max_lane_change_length < ego's distance to the end of the target lanes.) then (yes)
103+
:Return {max_acc};
104+
stop
105+
else (no)
106+
endif
107+
endif
108+
109+
:Return **sampled acceleration values**;
110+
stop
111+
112+
@enduml
113+
114+
```
115+
116+
while the following describes the process by which longitudinal accelerations are sampled.
117+
118+
```plantuml
119+
@startuml
120+
start
121+
:Initialize sampled_values with min_acc;
122+
123+
if (min_acc > max_acc) then (yes)
124+
:Return {};
125+
stop
126+
elseif (max_acc - min_acc < epsilon) then (yes)
127+
:Return {0.0};
128+
stop
129+
else (no)
130+
:Calculate resolution;
131+
endif
132+
133+
:Start loop from min_acc to max_acc with resolution step;
134+
repeat
135+
if (sampled_values.back() < -epsilon AND next_value > epsilon) then (yes)
136+
:Insert 0.0 into sampled_values;
137+
endif
138+
:Add sampled_acc to sampled_values;
139+
repeat while (sampled_acc < max_acc + epsilon) is (TRUE)
140+
141+
:Return sampled_values;
142+
stop
143+
@enduml
144+
```
145+
63146
The following figure illustrates when `longitudinal_acceleration_sampling_num = 4`. Assuming that `maximum_deceleration = 1.0` then `a0 == 0.0 == no deceleration`, `a1 == 0.25`, `a2 == 0.5`, `a3 == 0.75` and `a4 == 1.0 == maximum_deceleration`. `a0` is the expected lane change trajectories should ego vehicle do not decelerate, and `a1`'s path is the expected lane change trajectories should ego vehicle decelerate at `0.25 m/s^2`.
64147

65148
![path_samples](./images/lane_change-candidate_path_samples.png)

0 commit comments

Comments
 (0)