Skip to content

Commit

Permalink
fix: fix curve deceleration (#777) (#178)
Browse files Browse the repository at this point in the history
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

Co-authored-by: Fumiya Watanabe <rej55.g@gmail.com>
Co-authored-by: Tomoya Kimura <tomoya.kimura@tier4.jp>
  • Loading branch information
3 people authored Dec 14, 2021
1 parent 1587b68 commit 1f98799
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ boost::optional<TrajectoryPoints> 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)));
}
Expand Down

0 comments on commit 1f98799

Please sign in to comment.