Skip to content

Commit

Permalink
fix(lane_change): fix end pose not connected to goal (RT1-9247)
Browse files Browse the repository at this point in the history
Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 committed Feb 12, 2025
1 parent 2d0ed6f commit 6d83d17
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,15 @@ void append_target_ref_to_candidate(
const auto lc_end_idx =
motion_utils::findNearestIndex(target_lane_ref_path, lc_end_pose.position);
auto & candidate_path = frenet_candidate.path.points;
const auto & points = target_lane_ref_path;
if (target_lane_ref_path.size() <= lc_end_idx + 2) {
for (const auto & pt : points | ranges::views::drop(lc_end_idx + 1)) {
candidate_path.push_back(pt);
}
return;
}
const auto add_size = target_lane_ref_path.size() - (lc_end_idx + 1);
candidate_path.reserve(candidate_path.size() + add_size);

Check warning on line 743 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/path.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Bumpy Road Ahead

append_target_ref_to_candidate has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
const auto & points = target_lane_ref_path;
for (const auto & [p2, p3] : ranges::views::zip(
points | ranges::views::drop(lc_end_idx + 1),
points | ranges::views::drop(lc_end_idx + 2))) {
Expand Down

0 comments on commit 6d83d17

Please sign in to comment.