Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(obstacle_avoidance_planner): add options for plan_from_ego #1191

Merged
merged 5 commits into from
Jul 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use calcArcLength
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
  • Loading branch information
kosuke55 committed Jul 4, 2022
commit 0c3e2400b0da91f5066f468aebaee3bfeb35989c
9 changes: 1 addition & 8 deletions planning/obstacle_avoidance_planner/src/mpt_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,7 @@ void MPTOptimizer::calcPlanningFromEgo(std::vector<ReferencePoint> & ref_points)
{
// if plan from ego
constexpr double epsilon = 1e-04;
const double trajectory_length = [&]() {
double sum_length = 0;
for (size_t i = 1; i < ref_points.size(); ++i) {
sum_length +=
tier4_autoware_utils::calcDistance2d(ref_points.at(i - 1).p, ref_points.at(i).p);
}
return sum_length;
}();
const double trajectory_length = tier4_autoware_utils::calcArcLength(ref_points);

const bool plan_from_ego = mpt_param_.plan_from_ego && std::abs(current_ego_vel_) < epsilon &&
ref_points.size() > 1 &&
Expand Down