Skip to content

Commit

Permalink
change motion_utils::overlap_threshold to 0.2 and use it
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
  • Loading branch information
kosuke55 committed Dec 13, 2022
1 parent a827911 commit edfb2d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/motion_utils/include/motion_utils/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace motion_utils
{
constexpr double overlap_threshold = 0.1;
constexpr double overlap_threshold = 0.2;
} // namespace motion_utils

#endif // MOTION_UTILS__CONSTANTS_HPP_
5 changes: 3 additions & 2 deletions planning/behavior_path_planner/src/path_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ PathWithLaneId resamplePathWithSpline(
transformed_path.at(i) = path.points.at(i).point;
}

constexpr double epsilon = 0.2;
const auto has_almost_same_value = [&](const auto & vec, const auto x) {
if (vec.empty()) return false;
const auto has_close = [&](const auto v) { return std::abs(v - x) < epsilon; };
const auto has_close = [&](const auto v) {
return std::abs(v - x) < motion_utils::overlap_threshold;
};
return std::find_if(vec.begin(), vec.end(), has_close) != vec.end();
};

Expand Down

0 comments on commit edfb2d5

Please sign in to comment.