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

feat(avoidance): ignore behind unavoidable objects (#4034) #601

Merged
merged 1 commit into from
Jun 22, 2023
Merged
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 @@ -776,6 +776,8 @@ AvoidLineArray AvoidanceModule::calcRawShiftLinesFromObjects(
const auto & base_link2front = planner_data_->parameters.base_link2front;
const auto & base_link2rear = planner_data_->parameters.base_link2rear;

const auto is_forward_object = [](const auto & object) { return object.longitudinal > 0.0; };

AvoidLineArray avoid_lines;
std::vector<AvoidanceDebugMsg> avoidance_debug_msg_array;
avoidance_debug_msg_array.reserve(data.target_objects.size());
Expand All @@ -797,7 +799,7 @@ AvoidLineArray AvoidanceModule::calcRawShiftLinesFromObjects(
avoidance_debug_array_false_and_push_back(AvoidanceDebugFactor::INSUFFICIENT_LATERAL_MARGIN);
o.reason = AvoidanceDebugFactor::INSUFFICIENT_LATERAL_MARGIN;
debug.unavoidable_objects.push_back(o);
if (o.avoid_required) {
if (o.avoid_required && is_forward_object(o)) {
break;
} else {
continue;
Expand All @@ -810,7 +812,7 @@ AvoidLineArray AvoidanceModule::calcRawShiftLinesFromObjects(
avoidance_debug_array_false_and_push_back(AvoidanceDebugFactor::SAME_DIRECTION_SHIFT);
o.reason = AvoidanceDebugFactor::SAME_DIRECTION_SHIFT;
debug.unavoidable_objects.push_back(o);
if (o.avoid_required) {
if (o.avoid_required && is_forward_object(o)) {
break;
} else {
continue;
Expand Down Expand Up @@ -850,7 +852,7 @@ AvoidLineArray AvoidanceModule::calcRawShiftLinesFromObjects(
if (!data.avoiding_now) {
o.reason = AvoidanceDebugFactor::REMAINING_DISTANCE_LESS_THAN_ZERO;
debug.unavoidable_objects.push_back(o);
if (o.avoid_required) {
if (o.avoid_required && is_forward_object(o)) {
break;
} else {
continue;
Expand All @@ -868,7 +870,7 @@ AvoidLineArray AvoidanceModule::calcRawShiftLinesFromObjects(
if (!data.avoiding_now) {
o.reason = AvoidanceDebugFactor::TOO_LARGE_JERK;
debug.unavoidable_objects.push_back(o);
if (o.avoid_required) {
if (o.avoid_required && is_forward_object(o)) {
break;
} else {
continue;
Expand Down