Skip to content

Commit c215d6f

Browse files
committed
fix(lane_change): prevent empty path when rerouting (autowarefoundation#7717)
fix(lane_change): prevent empty path when routing Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
1 parent 970c6f3 commit c215d6f

File tree

1 file changed

+10
-2
lines changed
  • planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src

1 file changed

+10
-2
lines changed

planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/scene.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,16 @@ void NormalLaneChange::insertStopPoint(
467467

468468
PathWithLaneId NormalLaneChange::getReferencePath() const
469469
{
470-
return utils::getCenterLinePathFromLanelet(
471-
status_.lane_change_path.info.target_lanes.front(), planner_data_);
470+
lanelet::ConstLanelet closest_lanelet;
471+
if (!lanelet::utils::query::getClosestLanelet(
472+
status_.lane_change_path.info.target_lanes, getEgoPose(), &closest_lanelet)) {
473+
return prev_module_output_.reference_path;
474+
}
475+
const auto reference_path = utils::getCenterLinePathFromLanelet(closest_lanelet, planner_data_);
476+
if (reference_path.points.empty()) {
477+
return prev_module_output_.reference_path;
478+
}
479+
return reference_path;
472480
}
473481

474482
std::optional<PathWithLaneId> NormalLaneChange::extendPath()

0 commit comments

Comments
 (0)