@@ -384,7 +384,7 @@ void LaneParkingPlanner::onTimer()
384
384
closest_start_pose, path_candidates, sorted_indices_opt);
385
385
} else {
386
386
normal_pullover_planning_helper (
387
- local_planner_data, goal_candidates, upstream_module_output, current_lanes,
387
+ local_planner_data, goal_candidates, upstream_module_output, use_bus_stop_area, current_lanes,
388
388
closest_start_pose, path_candidates);
389
389
}
390
390
@@ -405,7 +405,7 @@ void LaneParkingPlanner::onTimer()
405
405
406
406
void LaneParkingPlanner::normal_pullover_planning_helper (
407
407
const std::shared_ptr<PlannerData> planner_data, const GoalCandidates & goal_candidates,
408
- const BehaviorModuleOutput & upstream_module_output,
408
+ const BehaviorModuleOutput & upstream_module_output, const bool use_bus_stop_area,
409
409
const lanelet::ConstLanelets current_lanelets, std::optional<Pose> & closest_start_pose,
410
410
std::vector<PullOverPath> & path_candidates)
411
411
{
@@ -464,7 +464,7 @@ void LaneParkingPlanner::normal_pullover_planning_helper(
464
464
if (closest_start_pose) {
465
465
const auto original_pose = planner_data->route_handler ->getOriginalGoalPose ();
466
466
if (
467
- parameters_. bus_stop_area . use_bus_stop_area &&
467
+ use_bus_stop_area &&
468
468
std::fabs (autoware_utils::normalize_radian (
469
469
autoware_utils::get_rpy (original_pose).z -
470
470
autoware_utils::get_rpy (closest_start_pose.value ()).z )) > pull_over_angle_threshold) {
@@ -473,7 +473,7 @@ void LaneParkingPlanner::normal_pullover_planning_helper(
473
473
path_candidates.clear ();
474
474
RCLCPP_INFO (getLogger (), " will generate Bezier Paths next" );
475
475
}
476
- } else if (parameters_. bus_stop_area . use_bus_stop_area && path_candidates.size () == 0 ) {
476
+ } else if (use_bus_stop_area && path_candidates.size () == 0 ) {
477
477
switch_bezier_ = true ;
478
478
RCLCPP_INFO (
479
479
getLogger (), " Could not find any shift pull over paths, will generate Bezier Paths next" );
@@ -649,8 +649,10 @@ std::pair<LaneParkingResponse, FreespaceParkingResponse> GoalPlannerModule::sync
649
649
{
650
650
std::lock_guard<std::mutex> guard (lane_parking_mutex_);
651
651
if (!lane_parking_request_) {
652
+ const auto & goal_searcher = goal_searcher_.value ();
652
653
lane_parking_request_.emplace (
653
- vehicle_footprint_, goal_candidates_, getPreviousModuleOutput (), use_bus_stop_area_);
654
+ vehicle_footprint_, goal_candidates_, getPreviousModuleOutput (),
655
+ use_bus_stop_area_ && goal_searcher.bus_stop_area_available ());
654
656
}
655
657
// NOTE: for the above reasons, PlannerManager/behavior_path_planner_node ensure that
656
658
// planner_data_ is not nullptr, so it is OK to copy as value
@@ -714,7 +716,7 @@ void GoalPlannerModule::updateData()
714
716
parameters_.forward_goal_search_length );
715
717
const auto bus_stop_area_polygons = goal_planner_utils::getBusStopAreaPolygons (pull_over_lanes);
716
718
use_bus_stop_area_ =
717
- parameters_.bus_stop_area .use_bus_stop_area &&
719
+ parameters_.bus_stop_area .use_bus_stop_area && goal_searcher. bus_stop_area_available () &&
718
720
std::any_of (
719
721
bus_stop_area_polygons.begin (), bus_stop_area_polygons.end (), [&](const auto & area) {
720
722
const auto & goal_position = planner_data_->route_handler ->getOriginalGoalPose ().position ;
0 commit comments