Skip to content

Commit 1ba9c67

Browse files
rename param
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent 227967d commit 1ba9c67

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

planning/behavior_path_start_planner_module/config/start_planner.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
th_stopped_time: 1.0
88
collision_check_margins: [2.0, 1.0, 0.5, 0.1]
99
collision_check_margin_from_front_object: 5.0
10+
extra_width_margin_for_rear_obstacle: 0.5
1011
th_moving_object_velocity: 1.0
1112
object_types_to_check_for_path_generation:
1213
check_car: true

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/data_structs.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct StartPlannerParameters
6464
double th_distance_to_middle_of_the_road{0.0};
6565
double intersection_search_length{0.0};
6666
double length_ratio_for_turn_signal_deactivation_near_intersection{0.0};
67+
double extra_width_margin_for_rear_obstacle{0.0};
6768
std::vector<double> collision_check_margins{};
6869
double collision_check_margin_from_front_object{0.0};
6970
double th_moving_object_velocity{0.0};

planning/behavior_path_start_planner_module/src/manager.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ void StartPlannerModuleManager::init(rclcpp::Node * node)
4444
p.intersection_search_length = node->declare_parameter<double>(ns + "intersection_search_length");
4545
p.length_ratio_for_turn_signal_deactivation_near_intersection = node->declare_parameter<double>(
4646
ns + "length_ratio_for_turn_signal_deactivation_near_intersection");
47+
p.extra_width_margin_for_rear_obstacle =
48+
node->declare_parameter<double>(ns + "extra_width_margin_for_rear_obstacle");
4749
p.collision_check_margins =
4850
node->declare_parameter<std::vector<double>>(ns + "collision_check_margins");
4951
p.collision_check_margin_from_front_object =
@@ -371,6 +373,10 @@ void StartPlannerModuleManager::updateModuleParams(
371373
updateParam<double>(
372374
parameters, ns + "length_ratio_for_turn_signal_deactivation_near_intersection",
373375
p->length_ratio_for_turn_signal_deactivation_near_intersection);
376+
updateParam<double>(
377+
parameters, ns + "extra_width_margin_for_rear_obstacle",
378+
p->extra_width_margin_for_rear_obstacle);
379+
374380
updateParam<std::vector<double>>(
375381
parameters, ns + "collision_check_margins", p->collision_check_margins);
376382
updateParam<double>(

planning/behavior_path_start_planner_module/src/start_planner_module.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ bool StartPlannerModule::isPreventingRearVehicleFromCrossing() const
401401
const auto closest_object_width = std::invoke([&]() -> std::optional<double> {
402402
double arc_length_to_closet_object = std::numeric_limits<double>::max();
403403
double closest_object_width = -1.0;
404-
405404
std::for_each(
406405
target_objects_on_lane.on_current_lane.begin(), target_objects_on_lane.on_current_lane.end(),
407406
[&](const auto & o) {
@@ -420,8 +419,11 @@ bool StartPlannerModule::isPreventingRearVehicleFromCrossing() const
420419
std::cerr << "Dims \n";
421420
std::cerr << "target_object_itr->shape.dimensions.y " << closest_object_width.value() << "\n";
422421
std::cerr << "gap_between_ego_and_lane_border " << gap_between_ego_and_lane_border << "\n";
422+
std::cerr << "parameters_->extra_width_margin_for_rear_obstacle "
423+
<< parameters_->extra_width_margin_for_rear_obstacle << "\n";
423424
// Decide if the closest object does not fit in the gap left by the ego vehicle.
424-
return closest_object_width.value() > gap_between_ego_and_lane_border;
425+
return closest_object_width.value() + parameters_->extra_width_margin_for_rear_obstacle >
426+
gap_between_ego_and_lane_border;
425427
}
426428

427429
bool StartPlannerModule::isOverlapWithCenterLane() const

0 commit comments

Comments
 (0)