Skip to content

Commit 7b1a414

Browse files
feat(start_planner): define ignore section separately (#6219)
* Update collision check distances in start planner module Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp> --------- Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
1 parent ae3e758 commit 7b1a414

File tree

5 files changed

+31
-13
lines changed

5 files changed

+31
-13
lines changed

planning/behavior_path_start_planner_module/config/start_planner.param.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
th_arrived_distance: 1.0
66
th_stopped_velocity: 0.01
77
th_stopped_time: 1.0
8-
collision_check_margins: [2.0, 1.5, 1.0]
9-
collision_check_distance_from_end: 1.0
8+
collision_check_margins: [2.0, 1.0, 0.5, 0.1]
109
collision_check_margin_from_front_object: 5.0
1110
th_moving_object_velocity: 1.0
1211
th_distance_to_middle_of_the_road: 0.5
1312
center_line_path_interval: 1.0
1413
# shift pull out
1514
enable_shift_pull_out: true
16-
check_shift_path_lane_departure: false
15+
shift_collision_check_distance_from_end: -10.0
1716
minimum_shift_pull_out_distance: 0.0
1817
deceleration_interval: 15.0
1918
lateral_jerk: 0.5
@@ -23,6 +22,7 @@
2322
maximum_curvature: 0.07
2423
# geometric pull out
2524
enable_geometric_pull_out: true
25+
geometric_collision_check_distance_from_end: 0.0
2626
divide_pull_out_path: true
2727
geometric_pull_out_velocity: 1.0
2828
arc_path_interval: 1.0
@@ -32,7 +32,7 @@
3232
# search start pose backward
3333
enable_back: true
3434
search_priority: "efficient_path" # "efficient_path" or "short_back_distance"
35-
max_back_distance: 30.0
35+
max_back_distance: 20.0
3636
backward_search_resolution: 2.0
3737
backward_path_update_duration: 3.0
3838
ignore_distance_from_lane_end: 15.0

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/data_structs.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ struct StartPlannerParameters
6363
double intersection_search_length{0.0};
6464
double length_ratio_for_turn_signal_deactivation_near_intersection{0.0};
6565
std::vector<double> collision_check_margins{};
66-
double collision_check_distance_from_end{0.0};
6766
double collision_check_margin_from_front_object{0.0};
6867
double th_moving_object_velocity{0.0};
6968
double center_line_path_interval{0.0};
7069

7170
// shift pull out
7271
bool enable_shift_pull_out{false};
7372
bool check_shift_path_lane_departure{false};
73+
double shift_collision_check_distance_from_end{0.0};
7474
double minimum_shift_pull_out_distance{0.0};
7575
int lateral_acceleration_sampling_num{0};
7676
double lateral_jerk{0.0};
@@ -80,6 +80,7 @@ struct StartPlannerParameters
8080
double deceleration_interval{0.0};
8181
// geometric pull out
8282
bool enable_geometric_pull_out{false};
83+
double geometric_collision_check_distance_from_end;
8384
bool divide_pull_out_path{false};
8485
ParallelParkingParameters parallel_parking_parameters{};
8586
// search start pose backward

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/start_planner_module.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ class StartPlannerModule : public SceneModuleInterface
174174
const Pose & start_pose_candidate, const std::shared_ptr<PullOutPlannerBase> & planner,
175175
const Pose & refined_start_pose, const Pose & goal_pose, const double collision_check_margin);
176176

177-
PathWithLaneId extractCollisionCheckSection(const PullOutPath & path);
177+
PathWithLaneId extractCollisionCheckSection(
178+
const PullOutPath & path, const behavior_path_planner::PlannerType & planner_type);
178179
void updateStatusWithCurrentPath(
179180
const behavior_path_planner::PullOutPath & path, const Pose & start_pose,
180181
const behavior_path_planner::PlannerType & planner_type);

planning/behavior_path_start_planner_module/src/manager.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ void StartPlannerModuleManager::init(rclcpp::Node * node)
4545
ns + "length_ratio_for_turn_signal_deactivation_near_intersection");
4646
p.collision_check_margins =
4747
node->declare_parameter<std::vector<double>>(ns + "collision_check_margins");
48-
p.collision_check_distance_from_end =
49-
node->declare_parameter<double>(ns + "collision_check_distance_from_end");
5048
p.collision_check_margin_from_front_object =
5149
node->declare_parameter<double>(ns + "collision_check_margin_from_front_object");
5250
p.th_moving_object_velocity = node->declare_parameter<double>(ns + "th_moving_object_velocity");
@@ -55,6 +53,8 @@ void StartPlannerModuleManager::init(rclcpp::Node * node)
5553
p.enable_shift_pull_out = node->declare_parameter<bool>(ns + "enable_shift_pull_out");
5654
p.check_shift_path_lane_departure =
5755
node->declare_parameter<bool>(ns + "check_shift_path_lane_departure");
56+
p.shift_collision_check_distance_from_end =
57+
node->declare_parameter<double>(ns + "shift_collision_check_distance_from_end");
5858
p.minimum_shift_pull_out_distance =
5959
node->declare_parameter<double>(ns + "minimum_shift_pull_out_distance");
6060
p.lateral_acceleration_sampling_num =
@@ -66,6 +66,8 @@ void StartPlannerModuleManager::init(rclcpp::Node * node)
6666
p.deceleration_interval = node->declare_parameter<double>(ns + "deceleration_interval");
6767
// geometric pull out
6868
p.enable_geometric_pull_out = node->declare_parameter<bool>(ns + "enable_geometric_pull_out");
69+
p.geometric_collision_check_distance_from_end =
70+
node->declare_parameter<double>(ns + "geometric_collision_check_distance_from_end");
6971
p.divide_pull_out_path = node->declare_parameter<bool>(ns + "divide_pull_out_path");
7072
p.parallel_parking_parameters.pull_out_velocity =
7173
node->declare_parameter<double>(ns + "geometric_pull_out_velocity");

planning/behavior_path_start_planner_module/src/start_planner_module.cpp

+19-5
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ bool StartPlannerModule::findPullOutPath(
657657

658658
// check collision
659659
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)) {
662662
return false;
663663
}
664664

@@ -672,8 +672,17 @@ bool StartPlannerModule::findPullOutPath(
672672
return true;
673673
}
674674

675-
PathWithLaneId StartPlannerModule::extractCollisionCheckSection(const PullOutPath & path)
675+
PathWithLaneId StartPlannerModule::extractCollisionCheckSection(
676+
const PullOutPath & path, const behavior_path_planner::PlannerType & planner_type)
676677
{
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+
677686
PathWithLaneId combined_path;
678687
for (const auto & partial_path : path.partial_paths) {
679688
combined_path.points.insert(
@@ -682,7 +691,7 @@ PathWithLaneId StartPlannerModule::extractCollisionCheckSection(const PullOutPat
682691
// calculate collision check end idx
683692
const size_t collision_check_end_idx = std::invoke([&]() {
684693
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);
686695

687696
if (collision_check_end_pose) {
688697
return motion_utils::findNearestIndex(
@@ -1403,9 +1412,14 @@ void StartPlannerModule::setDebugData()
14031412
// visualize collision_check_end_pose and footprint
14041413
{
14051414
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];
14061420
const auto collision_check_end_pose = motion_utils::calcLongitudinalOffsetPose(
14071421
getFullPath().points, status_.pull_out_path.end_pose.position,
1408-
parameters_->collision_check_distance_from_end);
1422+
collision_check_distance_from_end);
14091423
if (collision_check_end_pose) {
14101424
add(createPoseMarkerArray(
14111425
*collision_check_end_pose, "static_collision_check_end_pose", 0, 1.0, 0.0, 0.0));

0 commit comments

Comments
 (0)