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(avoidance): fix margin param inconsistency #6765

Merged

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented Apr 9, 2024

Description

The avoidance module has two type lateral hard margin params:

  1. lateral hard margin for parked vehicle
  2. lateral hard margin for othther objects

Basically, it should choose proper one based on the data "if it's parked vehicle" but there are bugs that only latter param is used. This may cause wrong stop distance calculation.

double AvoidanceModule::calcDistanceToStopLine(const ObjectData & object) const
{
  const auto & p = parameters_;
  const auto & vehicle_width = planner_data_->parameters.vehicle_width;
...
  const auto object_type = utils::getHighestProbLabel(object.object.classification);
  const auto object_parameter = parameters_->object_parameters.at(object_type);

  const auto avoid_margin = object_parameter.lateral_hard_margin * object.distance_factor +
                            object_parameter.lateral_soft_margin + 0.5 * vehicle_width;
  const auto avoidance_distance = helper_->getMinAvoidanceDistance(
    helper_->getShiftLength(object, utils::avoidance::isOnRight(object), avoid_margin));
  const auto constant_distance = helper_->getFrontConstantDistance(object);
  return object.longitudinal -
         std::min(
           avoidance_distance + constant_distance + p->min_prepare_distance + p->stop_buffer,
           p->stop_max_distance);
}

Tests performed

Effects on system behavior

Bug fix.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Apr 9, 2024
Copy link
Contributor

@zulfaqar-azmi-t4 zulfaqar-azmi-t4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Can Ota-san help to update the Readme to reflect the latest changes?

@satoshi-ota
Copy link
Contributor Author

@zulfaqar-azmi-t4 Thank you!

LGTM! Can Ota-san help to update the Readme to reflect the latest changes?

Sorry for the unsafficient module documentations... 🙏 Now I update module specifications frequently so I put off updating documention until later. But I'll start it asap because some specifications are fixed and actually I have to complete docs by the end of June.

@satoshi-ota satoshi-ota added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 9, 2024
@satoshi-ota satoshi-ota enabled auto-merge (squash) April 9, 2024 12:22
@satoshi-ota satoshi-ota merged commit c3b727f into autowarefoundation:main Apr 9, 2024
42 of 45 checks passed
@satoshi-ota satoshi-ota deleted the fix/margin-inconsistency branch April 9, 2024 13:14
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Apr 9, 2024
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Apr 10, 2024
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Apr 10, 2024
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Apr 18, 2024
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants