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

fix(avoidance): fix avoidance return dead point calculation logic for high curverture path #5489

Merged
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Tier IV, Inc.

Check notice on line 1 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Lines of Code in a Single File

The lines of code increases from 2190 to 2194, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -2902,8 +2902,15 @@
return;
}

// Consider the difference in path length between the shifted path and original path (the path
// that is shifted inward has a shorter distance to the end of the path than the other one.)
const auto & to_reference_path_end = data.arclength_from_ego.back();
const auto to_shifted_path_end = calcSignedArcLength(
shifted_path.path.points, getEgoPosition(), shifted_path.path.points.size() - 1);

Check warning on line 2909 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L2908-L2909

Added lines #L2908 - L2909 were not covered by tests
const auto buffer = std::max(0.0, to_shifted_path_end - to_reference_path_end);

const auto min_return_distance = helper_.getMinAvoidanceDistance(shift_length);
const auto to_stop_line = data.to_return_point - min_return_distance;
const auto to_stop_line = data.to_return_point - min_return_distance - buffer;

Check warning on line 2913 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L2913

Added line #L2913 was not covered by tests

// If we don't need to consider deceleration constraints, insert a deceleration point
// and return immediately
Expand Down
Loading