Skip to content

Commit

Permalink
fix(obstacle_stop_planner): fix unreadVariable warning (#7626)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryuta Kambe <[email protected]>
  • Loading branch information
veqcc authored Jun 27, 2024
1 parent bcf0677 commit 0cc45ae
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions planning/obstacle_stop_planner/src/adaptive_cruise_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,11 @@ double AdaptiveCruiseController::calcTargetVelocity_D(
return 0.0;
}

double add_vel_d = 0;

add_vel_d = diff_vel;
double add_vel_d = diff_vel;
if (add_vel_d >= 0) {
diff_vel *= param_.d_coeff_pos;
}
if (add_vel_d < 0) {
diff_vel *= param_.d_coeff_neg;
add_vel_d *= param_.d_coeff_pos;
} else {
add_vel_d *= param_.d_coeff_neg;
}
add_vel_d = boost::algorithm::clamp(add_vel_d, -param_.d_max_vel_norm, param_.d_max_vel_norm);

Expand Down

0 comments on commit 0cc45ae

Please sign in to comment.