Skip to content

Commit

Permalink
perf(motion_utils): faster removeOverlapPoints (#5360)
Browse files Browse the repository at this point in the history
Signed-off-by: Takayuki Murooka <[email protected]>
  • Loading branch information
takayuki5168 authored Oct 21, 2023
1 parent 89ae3bb commit 98c24b8
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ T removeOverlapPoints(const T & points, const size_t start_idx = 0)
for (size_t i = start_idx + 1; i < points.size(); ++i) {
const auto prev_p = tier4_autoware_utils::getPoint(dst.back());
const auto curr_p = tier4_autoware_utils::getPoint(points.at(i));
const double dist = tier4_autoware_utils::calcDistance2d(prev_p, curr_p);
if (dist < eps) {
if (std::abs(prev_p.x - curr_p.x) < eps && std::abs(prev_p.y - curr_p.y) < eps) {
continue;
}
dst.push_back(points.at(i));
Expand Down

0 comments on commit 98c24b8

Please sign in to comment.