Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dynamic_avoidance): ignore objects on LC target lane #4137

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

successive_num_to_entry_dynamic_avoidance_condition: 5

min_obj_lat_offset_to_ego_path: 0.3 # [m]

drivable_area_generation:
lat_offset_from_obstacle: 0.8 # [m]
max_lat_offset_to_avoid: 0.5 # [m]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct DynamicAvoidanceParameters
bool avoid_pedestrian{false};
double min_obstacle_vel{0.0};
int successive_num_to_entry_dynamic_avoidance_condition{0};
double min_obj_lat_offset_to_ego_path{0.0};

// drivable area generation
double lat_offset_from_obstacle{0.0};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ DynamicAvoidanceModule::calcTargetObjectsCandidate() const
const auto objects_in_right_lanes = getObjectsInLanes(input_objects, right_lanes);
const auto objects_in_left_lanes = getObjectsInLanes(input_objects, left_lanes);

// 4. check if object will cut into the ego lane or cut out to the next lane.
// 4. check if object will not cut into the ego lane or cut out to the next lane,
// or close to the ego's path considering ego's lane change.
// NOTE: The oncoming object will be ignored.
constexpr double epsilon_path_lat_diff = 0.3;
std::vector<DynamicAvoidanceObjectCandidate> output_objects_candidate;
Expand Down Expand Up @@ -380,6 +381,15 @@ DynamicAvoidanceModule::calcTargetObjectsCandidate() const
continue;
}

// Ignore object that is close to the ego's path.
const double lat_offset_to_path =
motion_utils::calcLateralOffset(prev_module_path->points, object.pose.position);
if (
std::abs(lat_offset_to_path) < planner_data_->parameters.vehicle_width / 2.0 +
parameters_->min_obj_lat_offset_to_ego_path) {
continue;
}

// get previous object if it exists
const auto prev_target_object_candidate = DynamicAvoidanceObjectCandidate::getObjectFromUuid(
prev_target_objects_candidate_, object.uuid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ DynamicAvoidanceModuleManager::DynamicAvoidanceModuleManager(
p.min_obstacle_vel = node->declare_parameter<double>(ns + "min_obstacle_vel");
p.successive_num_to_entry_dynamic_avoidance_condition =
node->declare_parameter<int>(ns + "successive_num_to_entry_dynamic_avoidance_condition");
p.min_obj_lat_offset_to_ego_path =
node->declare_parameter<double>(ns + "min_obj_lat_offset_to_ego_path");
}

{ // drivable_area_generation
Expand Down Expand Up @@ -92,6 +94,8 @@ void DynamicAvoidanceModuleManager::updateModuleParams(
updateParam<int>(
parameters, ns + "successive_num_to_entry_dynamic_avoidance_condition",
p->successive_num_to_entry_dynamic_avoidance_condition);
updateParam<double>(
parameters, ns + "min_obj_lat_offset_to_ego_path", p->min_obj_lat_offset_to_ego_path);
}

{ // drivable_area_generation
Expand Down