@@ -657,8 +657,8 @@ bool StartPlannerModule::findPullOutPath(
657
657
658
658
// check collision
659
659
if (utils::checkCollisionBetweenPathFootprintsAndObjects (
660
- vehicle_footprint, extractCollisionCheckSection (*pull_out_path), pull_out_lane_stop_objects ,
661
- collision_check_margin)) {
660
+ vehicle_footprint, extractCollisionCheckSection (*pull_out_path, planner-> getPlannerType ()) ,
661
+ pull_out_lane_stop_objects, collision_check_margin)) {
662
662
return false ;
663
663
}
664
664
@@ -672,8 +672,17 @@ bool StartPlannerModule::findPullOutPath(
672
672
return true ;
673
673
}
674
674
675
- PathWithLaneId StartPlannerModule::extractCollisionCheckSection (const PullOutPath & path)
675
+ PathWithLaneId StartPlannerModule::extractCollisionCheckSection (
676
+ const PullOutPath & path, const behavior_path_planner::PlannerType & planner_type)
676
677
{
678
+ const std::map<PlannerType, double > collision_check_distances = {
679
+ {behavior_path_planner::PlannerType::SHIFT,
680
+ parameters_->shift_collision_check_distance_from_end },
681
+ {behavior_path_planner::PlannerType::GEOMETRIC,
682
+ parameters_->geometric_collision_check_distance_from_end }};
683
+
684
+ const double collision_check_distance_from_end = collision_check_distances.at (planner_type);
685
+
677
686
PathWithLaneId combined_path;
678
687
for (const auto & partial_path : path.partial_paths ) {
679
688
combined_path.points .insert (
@@ -682,7 +691,7 @@ PathWithLaneId StartPlannerModule::extractCollisionCheckSection(const PullOutPat
682
691
// calculate collision check end idx
683
692
const size_t collision_check_end_idx = std::invoke ([&]() {
684
693
const auto collision_check_end_pose = motion_utils::calcLongitudinalOffsetPose (
685
- combined_path.points , path.end_pose .position , parameters_-> collision_check_distance_from_end );
694
+ combined_path.points , path.end_pose .position , collision_check_distance_from_end);
686
695
687
696
if (collision_check_end_pose) {
688
697
return motion_utils::findNearestIndex (
@@ -1403,9 +1412,14 @@ void StartPlannerModule::setDebugData()
1403
1412
// visualize collision_check_end_pose and footprint
1404
1413
{
1405
1414
const auto local_footprint = vehicle_info_.createFootprint ();
1415
+ std::map<PlannerType, double > collision_check_distances = {
1416
+ {PlannerType::SHIFT, parameters_->shift_collision_check_distance_from_end },
1417
+ {PlannerType::GEOMETRIC, parameters_->geometric_collision_check_distance_from_end }};
1418
+
1419
+ double collision_check_distance_from_end = collision_check_distances[status_.planner_type ];
1406
1420
const auto collision_check_end_pose = motion_utils::calcLongitudinalOffsetPose (
1407
1421
getFullPath ().points , status_.pull_out_path .end_pose .position ,
1408
- parameters_-> collision_check_distance_from_end );
1422
+ collision_check_distance_from_end);
1409
1423
if (collision_check_end_pose) {
1410
1424
add (createPoseMarkerArray (
1411
1425
*collision_check_end_pose, " static_collision_check_end_pose" , 0 , 1.0 , 0.0 , 0.0 ));
0 commit comments