From d091ddc808af1595489bae3dbafd0a2427f3dd96 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 12:19:07 +0000 Subject: [PATCH] ci(pre-commit): autofix --- .../src/trajectory_utils.cpp | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/planning/motion_velocity_smoother/src/trajectory_utils.cpp b/planning/motion_velocity_smoother/src/trajectory_utils.cpp index f18ae80253917..ea6d71084efc3 100644 --- a/planning/motion_velocity_smoother/src/trajectory_utils.cpp +++ b/planning/motion_velocity_smoother/src/trajectory_utils.cpp @@ -194,36 +194,36 @@ std::vector calcTrajectoryIntervalDistance(const TrajectoryPoints & traj std::vector calcTrajectoryCurvatureFrom3Points( const TrajectoryPoints & trajectory, size_t idx_dist) { - using tier4_autoware_utils::calcCurvature; - using tier4_autoware_utils::getPoint; + using tier4_autoware_utils::calcCurvature; + using tier4_autoware_utils::getPoint; - if (trajectory.size() < 3) { - const std::vector k_arr(trajectory.size(), 0.0); - return k_arr; - } + if (trajectory.size() < 3) { + const std::vector k_arr(trajectory.size(), 0.0); + return k_arr; + } - // if the idx size is not enough, change the idx_dist - const auto max_idx_dist = static_cast(std::floor((trajectory.size() - 1) / 2.0)); - idx_dist = std::max(1ul, std::min(idx_dist, max_idx_dist)); + // if the idx size is not enough, change the idx_dist + const auto max_idx_dist = static_cast(std::floor((trajectory.size() - 1) / 2.0)); + idx_dist = std::max(1ul, std::min(idx_dist, max_idx_dist)); - if (idx_dist < 1) { - throw std::logic_error("idx_dist less than 1 is not expected"); - } + if (idx_dist < 1) { + throw std::logic_error("idx_dist less than 1 is not expected"); + } - // calculate curvature by circle fitting from three points - std::vector k_arr; - // for first point curvature = 0; - k_arr.push_back(0.0); - for (size_t i = 1; i + 1 < trajectory.size(); i++) { - const auto p0 = getPoint(trajectory.at(i - std::min(idx_dist, i))); - const auto p1 = getPoint(trajectory.at(i)); - const auto p2 = getPoint(trajectory.at(i + std::min(idx_dist, trajectory.size() - 1 - i))); - k_arr.push_back(calcCurvature(p0, p1, p2)); - } - // for last point curvature = 0; - k_arr.push_back(0.0); + // calculate curvature by circle fitting from three points + std::vector k_arr; + // for first point curvature = 0; + k_arr.push_back(0.0); + for (size_t i = 1; i + 1 < trajectory.size(); i++) { + const auto p0 = getPoint(trajectory.at(i - std::min(idx_dist, i))); + const auto p1 = getPoint(trajectory.at(i)); + const auto p2 = getPoint(trajectory.at(i + std::min(idx_dist, trajectory.size() - 1 - i))); + k_arr.push_back(calcCurvature(p0, p1, p2)); + } + // for last point curvature = 0; + k_arr.push_back(0.0); - return k_arr; + return k_arr; } void setZeroVelocity(TrajectoryPoints & trajectory)