Skip to content

Commit

Permalink
rename param
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sanchez <[email protected]>
  • Loading branch information
danielsanchezaran committed Mar 5, 2024
1 parent 227967d commit 1ba9c67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
th_stopped_time: 1.0
collision_check_margins: [2.0, 1.0, 0.5, 0.1]
collision_check_margin_from_front_object: 5.0
extra_width_margin_for_rear_obstacle: 0.5
th_moving_object_velocity: 1.0
object_types_to_check_for_path_generation:
check_car: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ struct StartPlannerParameters
double th_distance_to_middle_of_the_road{0.0};
double intersection_search_length{0.0};
double length_ratio_for_turn_signal_deactivation_near_intersection{0.0};
double extra_width_margin_for_rear_obstacle{0.0};
std::vector<double> collision_check_margins{};
double collision_check_margin_from_front_object{0.0};
double th_moving_object_velocity{0.0};
Expand Down
6 changes: 6 additions & 0 deletions planning/behavior_path_start_planner_module/src/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ void StartPlannerModuleManager::init(rclcpp::Node * node)
p.intersection_search_length = node->declare_parameter<double>(ns + "intersection_search_length");
p.length_ratio_for_turn_signal_deactivation_near_intersection = node->declare_parameter<double>(
ns + "length_ratio_for_turn_signal_deactivation_near_intersection");
p.extra_width_margin_for_rear_obstacle =
node->declare_parameter<double>(ns + "extra_width_margin_for_rear_obstacle");
p.collision_check_margins =
node->declare_parameter<std::vector<double>>(ns + "collision_check_margins");
p.collision_check_margin_from_front_object =
Expand Down Expand Up @@ -371,6 +373,10 @@ void StartPlannerModuleManager::updateModuleParams(
updateParam<double>(
parameters, ns + "length_ratio_for_turn_signal_deactivation_near_intersection",
p->length_ratio_for_turn_signal_deactivation_near_intersection);
updateParam<double>(
parameters, ns + "extra_width_margin_for_rear_obstacle",
p->extra_width_margin_for_rear_obstacle);

updateParam<std::vector<double>>(
parameters, ns + "collision_check_margins", p->collision_check_margins);
updateParam<double>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ bool StartPlannerModule::isPreventingRearVehicleFromCrossing() const
const auto closest_object_width = std::invoke([&]() -> std::optional<double> {
double arc_length_to_closet_object = std::numeric_limits<double>::max();
double closest_object_width = -1.0;

std::for_each(
target_objects_on_lane.on_current_lane.begin(), target_objects_on_lane.on_current_lane.end(),
[&](const auto & o) {
Expand All @@ -420,8 +419,11 @@ bool StartPlannerModule::isPreventingRearVehicleFromCrossing() const
std::cerr << "Dims \n";
std::cerr << "target_object_itr->shape.dimensions.y " << closest_object_width.value() << "\n";
std::cerr << "gap_between_ego_and_lane_border " << gap_between_ego_and_lane_border << "\n";
std::cerr << "parameters_->extra_width_margin_for_rear_obstacle "
<< parameters_->extra_width_margin_for_rear_obstacle << "\n";
// Decide if the closest object does not fit in the gap left by the ego vehicle.
return closest_object_width.value() > gap_between_ego_and_lane_border;
return closest_object_width.value() + parameters_->extra_width_margin_for_rear_obstacle >
gap_between_ego_and_lane_border;
}

bool StartPlannerModule::isOverlapWithCenterLane() const
Expand Down

0 comments on commit 1ba9c67

Please sign in to comment.