From 3679803ce46516108eafd2fea8231a498a916b03 Mon Sep 17 00:00:00 2001 From: Koichi98 <45482193+Koichi98@users.noreply.github.com> Date: Mon, 24 Jun 2024 17:54:03 +0900 Subject: [PATCH] fix(autoware_obstacle_cruise_planner): fix shadowVariable warning (#7656) * fix(autoware_obstacle_cruise_planner): fix shadowVariable warning Signed-off-by: Koichi Imai * fix Signed-off-by: Koichi Imai * style(pre-commit): autofix --------- Signed-off-by: Koichi Imai Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Signed-off-by: Simon Eisenmann --- .../src/pid_based_planner/pid_based_planner.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp b/planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp index 345265b1d20b0..d0736c6158a7a 100644 --- a/planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp +++ b/planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp @@ -509,7 +509,6 @@ std::vector PIDBasedPlanner::getAccelerationLimitedTrajectory( const double v0, const double a0, const double target_acc, const double target_jerk_ratio) const { // calculate vt function - const auto & i = longitudinal_info_; const auto vt = [&]( const double v0, const double a0, const double jerk, const double t, const double target_acc) { @@ -541,8 +540,8 @@ std::vector PIDBasedPlanner::getAccelerationLimitedTrajectory( // Therefore, we calculate v1 (velocity at next step) and use it for initial velocity. const double v1 = v0; // + 0.1; // a0 * 0.1; // + jerk * 0.1 * 0.1 / 2.0; const double a1 = a0; // + jerk * 0.1; - const double jerk = - target_acc > a1 ? i.max_jerk * target_jerk_ratio : i.min_jerk * target_jerk_ratio; + const double jerk = target_acc > a1 ? longitudinal_info_.max_jerk * target_jerk_ratio + : longitudinal_info_.min_jerk * target_jerk_ratio; double t_current = 0.0; std::vector s_vec{0.0};