Skip to content

fix(path_generator): ensure refined path connects start and goal #511

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

Merged
Changes from 2 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
4 changes: 4 additions & 0 deletions planning/autoware_path_generator/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ experimental::trajectory::Trajectory<PathPointWithLaneId> refine_path_for_goal(
if (!intervals.empty()) {
auto cropped = autoware::experimental::trajectory::crop(cropped_path, 0, intervals.back().end);
goal_connected_trajectory_points = cropped.restore(2);
} else if (cropped_path.length() > 1.0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.0 is a magic number. Please declare the constexpr value to name it.

Copy link
Contributor Author

@mitukou1109 mitukou1109 Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mitukou1109#6 was merged to this branch.

// If distance from start to goal is smaller than refine_goal_search_radius_range and start is
// farther from goal than pre_goal, we just connect start, pre_goal, and goal.
Comment on lines +675 to +676
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is helpful. Thank you!

goal_connected_trajectory_points = {cropped_path.compute(0)};
}

auto goal = input.compute(autoware::experimental::trajectory::closest(input, goal_pose));
Expand Down
Loading