Skip to content

Commit 174a04d

Browse files
committed
fix(start_planner): use waypoints as centerline if available
Signed-off-by: Mehmet Dogru <[email protected]>
1 parent fbc7a9d commit 174a04d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

planning/behavior_path_planner/autoware_behavior_path_start_planner_module/include/autoware/behavior_path_start_planner_module/start_planner_module.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class StartPlannerModule : public SceneModuleInterface
230230
bool receivedNewRoute() const;
231231

232232
bool isModuleRunning() const;
233-
bool isCurrentPoseOnMiddleOfTheRoad() const;
233+
bool isCurrentPoseOnCenterline() const;
234234

235235
/**
236236
* @brief Check if the ego vehicle is preventing the rear vehicle from passing through.

planning/behavior_path_planner/autoware_behavior_path_start_planner_module/src/start_planner_module.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,12 @@ bool StartPlannerModule::isExecutionRequested() const
342342
}
343343

344344
// Return false and do not request execution if any of the following conditions are true:
345-
// - The start pose is on the middle of the road.
345+
// - The start pose is on the centerline or on "waypoints" (custom centerline)
346346
// - The vehicle has already arrived at the start position planner.
347347
// - The vehicle has reached the goal position.
348348
// - The vehicle is still moving.
349349
if (
350-
isCurrentPoseOnMiddleOfTheRoad() || isCloseToOriginalStartPose() || hasArrivedAtGoal() ||
350+
isCurrentPoseOnCenterline() || isCloseToOriginalStartPose() || hasArrivedAtGoal() ||
351351
isMoving()) {
352352
return false;
353353
}
@@ -367,12 +367,15 @@ bool StartPlannerModule::isModuleRunning() const
367367
return getCurrentStatus() == ModuleStatus::RUNNING;
368368
}
369369

370-
bool StartPlannerModule::isCurrentPoseOnMiddleOfTheRoad() const
370+
bool StartPlannerModule::isCurrentPoseOnCenterline() const
371371
{
372+
const auto & lanelet_map_ptr = planner_data_->route_handler->getLaneletMapPtr();
372373
const Pose & current_pose = planner_data_->self_odometry->pose.pose;
373374
const lanelet::ConstLanelets current_lanes = utils::getCurrentLanes(planner_data_);
374375
const double lateral_distance_to_center_lane =
375-
lanelet::utils::getArcCoordinates(current_lanes, current_pose).distance;
376+
lanelet::utils::getArcCoordinatesConsideringWaypoints(
377+
current_lanes, current_pose, lanelet_map_ptr)
378+
.distance;
376379

377380
return std::abs(lateral_distance_to_center_lane) < parameters_->th_distance_to_middle_of_the_road;
378381
}

0 commit comments

Comments
 (0)