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(goal_planner): resample path interval for lane departure check accuracy #10058

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Expand Up @@ -16,6 +16,7 @@

#include "autoware/behavior_path_goal_planner_module/util.hpp"
#include "autoware/behavior_path_planner_common/utils/drivable_area_expansion/static_drivable_area.hpp"
#include "autoware/behavior_path_planner_common/utils/path_utils.hpp"

#include <autoware_lanelet2_extension/utility/query.hpp>
#include <autoware_lanelet2_extension/utility/utilities.hpp>
Expand Down Expand Up @@ -77,6 +78,10 @@ std::optional<PullOverPath> GeometricPullOver::plan(
const auto arc_path = planner_.getArcPath();

// check lane departure with road and shoulder lanes
// To improve the accuracy of lane departure detection, make the sampling interval finer
// todo: Implement lane departure detection that does not depend on the footprint
const auto resampled_arc_path =
utils::resamplePathWithSpline(arc_path, parameters_.center_line_path_interval / 2);
if (lane_departure_checker_.checkPathWillLeaveLane({departure_check_lane}, arc_path)) return {};

auto pull_over_path_opt = PullOverPath::create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,12 @@

const auto departure_check_lane = goal_planner_utils::createDepartureCheckLanelet(
pull_over_lanes, *planner_data->route_handler, left_side_parking_);
const bool is_in_lanes = !lane_departure_checker_.checkPathWillLeaveLane(
{departure_check_lane}, pull_over_path.parking_path());
// To improve the accuracy of lane departure detection, make the sampling interval finer
// todo: Implement lane departure detection that does not depend on the footprint
const auto resampled_parking_path = utils::resamplePathWithSpline(
pull_over_path.parking_path(), parameters_.center_line_path_interval / 2);
const bool is_in_lanes =
!lane_departure_checker_.checkPathWillLeaveLane({departure_check_lane}, resampled_parking_path);

Check warning on line 307 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/pull_over_planner/shift_pull_over.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

ShiftPullOver::generatePullOverPath already has high cyclomatic complexity, and now it increases in Lines of Code from 137 to 139. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

if (!is_in_parking_lots && !is_in_lanes) {
return {};
Expand Down
Loading