Skip to content

Commit 413805a

Browse files
authored
fix(autoware_pid_longitudinal_controller): fix bugprone-branch-clone (#9629)
fix: bugprone-branch-clone Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
1 parent 46cfadb commit 413805a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

control/autoware_pid_longitudinal_controller/src/smooth_stop.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ double SmoothStop::calculate(
140140
// when the car is running
141141
if (is_running) {
142142
// when the car will not stop in a certain time
143-
if (time_to_stop && *time_to_stop > m_params.weak_stop_time + delay_time) {
144-
return m_strong_acc;
145-
} else if (!time_to_stop && is_fast_vel) {
143+
if (
144+
(time_to_stop && *time_to_stop > m_params.weak_stop_time + delay_time) ||
145+
(!time_to_stop && is_fast_vel)) {
146146
return m_strong_acc;
147147
}
148148

0 commit comments

Comments
 (0)