From 1f98799a709c3fdf4e1c48b66c6c21abd7f39dda Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Date: Tue, 14 Dec 2021 14:21:20 +0900 Subject: [PATCH] fix: fix curve deceleration (#777) (#178) Signed-off-by: wep21 Co-authored-by: Fumiya Watanabe Co-authored-by: Tomoya Kimura --- .../motion_velocity_smoother/src/smoother/smoother_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/planning/motion_velocity_smoother/src/smoother/smoother_base.cpp b/planning/motion_velocity_smoother/src/smoother/smoother_base.cpp index adaaa71d68a09..77b2da1d0e80f 100644 --- a/planning/motion_velocity_smoother/src/smoother/smoother_base.cpp +++ b/planning/motion_velocity_smoother/src/smoother/smoother_base.cpp @@ -79,8 +79,8 @@ boost::optional SmootherBase::applyLateralAccelerationFilter( for (size_t i = 0; i < output->size(); ++i) { double curvature = 0.0; - const size_t start = i > before_decel_index ? i - before_decel_index : 0; - const size_t end = std::min(output->size(), i + after_decel_index); + const size_t start = i > after_decel_index ? i - after_decel_index : 0; + const size_t end = std::min(output->size(), i + before_decel_index); for (size_t j = start; j < end; ++j) { curvature = std::max(curvature, std::fabs(curvature_v->at(j))); }