Skip to content

Commit

Permalink
fix(lane_change): extending lane change path for multiple lane change…
Browse files Browse the repository at this point in the history
… (RT1-8427) (autowarefoundation#9268) (#1656)

* RT1-8427 extending lc path for multiple lc



* Update planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/scene.cpp



---------

Signed-off-by: Zulfaqar Azmi <[email protected]>
Co-authored-by: Zulfaqar Azmi <[email protected]>
Co-authored-by: mkquda <[email protected]>
  • Loading branch information
3 people authored Dec 23, 2024
1 parent 4f4110c commit 9313d1d
Showing 1 changed file with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,6 @@ std::optional<PathWithLaneId> NormalLaneChange::extendPath()
{
universe_utils::ScopedTimeTrack st(__func__, *time_keeper_);
const auto path = status_.lane_change_path.path;
const auto lc_start_point = status_.lane_change_path.info.lane_changing_start.position;

const auto dist = calcSignedArcLength(path.points, lc_start_point, getEgoPosition());

if (dist < 0.0) {
return std::nullopt;
}

auto & target_lanes = common_data_ptr_->lanes_ptr->target;
const auto target_lane_length = lanelet::utils::getLaneletLength2d(target_lanes);
Expand All @@ -601,22 +594,21 @@ std::optional<PathWithLaneId> NormalLaneChange::extendPath()
if ((target_lane_length - dist_in_target.length) > forward_path_length) {
return std::nullopt;
}
const auto dist_to_end_of_path =
lanelet::utils::getArcCoordinates(target_lanes, path.points.back().point.pose).length;

const auto is_goal_in_target = getRouteHandler()->isInGoalRouteSection(target_lanes.back());

if (is_goal_in_target) {
if (common_data_ptr_->lanes_ptr->target_lane_in_goal_section) {
const auto goal_pose = getRouteHandler()->getGoalPose();

const auto dist_to_goal = lanelet::utils::getArcCoordinates(target_lanes, goal_pose).length;
const auto dist_to_end_of_path =
lanelet::utils::getArcCoordinates(target_lanes, path.points.back().point.pose).length;

return getRouteHandler()->getCenterLinePath(target_lanes, dist_to_end_of_path, dist_to_goal);
}

lanelet::ConstLanelet next_lane;
if (!getRouteHandler()->getNextLaneletWithinRoute(target_lanes.back(), &next_lane)) {
return std::nullopt;
return getRouteHandler()->getCenterLinePath(
target_lanes, dist_to_end_of_path, transient_data.target_lane_length);
}

target_lanes.push_back(next_lane);
Expand All @@ -640,8 +632,6 @@ std::optional<PathWithLaneId> NormalLaneChange::extendPath()

const auto dist_to_target_pose =
lanelet::utils::getArcCoordinates(target_lanes, target_pose).length;
const auto dist_to_end_of_path =
lanelet::utils::getArcCoordinates(target_lanes, path.points.back().point.pose).length;

return getRouteHandler()->getCenterLinePath(
target_lanes, dist_to_end_of_path, dist_to_target_pose);
Expand Down

0 comments on commit 9313d1d

Please sign in to comment.