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 longitudinal dintance calculation with lane-change in HdMapUtils::getLongitudinalDistance #1348

Merged
merged 8 commits into from
Aug 27, 2024

Conversation

HansRobo
Copy link
Member

@HansRobo HansRobo commented Aug 21, 2024

Description

Abstract

Fix longitudinal dintance calculation with lane-change in HdMapUtils::getLongitudinalDistance

Details

In previous implementation of HdMapUtils::getLongitudinalDistance, the function performed wrong longitudinal distance when the route has a lane change between first and second lanelet.

The calculation method is as described in the documentation, but the implementation contained a miss, so I will fix it in this pull-request.

scenario test behavior

I added the bugged case to ByEntityCondition.EntityCondition.DistanceCondition.Shortest.yaml
Before this pull_request, the relative longitudinal distance between Npc1 and Npc4 is calculated to about 113, as executed here.
But after this pull-request, it is calculated to about 54, as defined in the test scenario.

image

References

Regression Test: OK

Destructive Changes

None

Known Limitations

None

Copy link

github-actions bot commented Aug 21, 2024

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@HansRobo HansRobo force-pushed the fix/distance-with-lane-change branch from 0cc8c80 to 0456a52 Compare August 21, 2024 08:22
@HansRobo HansRobo added the bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 label Aug 21, 2024
@HansRobo HansRobo changed the title Fix double counting the second lanelet length following first lanelet with lane-change in HdMapUtils::getLongitudinalDistance Fix longitudinal dintance calculation with lane-change in HdMapUtils::getLongitudinalDistance Aug 21, 2024
@HansRobo HansRobo marked this pull request as ready for review August 23, 2024 09:59
@hakuturu583
Copy link
Collaborator

@HansRobo Thank you!
Code is looks good to me.
Could you write test scenarios written in C++ and add it to the test in github actions?

@HansRobo
Copy link
Member Author

HansRobo commented Aug 26, 2024

OK, I'll add C++ unit test
⇒ done

@HansRobo HansRobo self-assigned this Aug 26, 2024
@hakuturu583 hakuturu583 merged commit fe1aed2 into master Aug 27, 2024
10 checks passed
@github-actions github-actions bot deleted the fix/distance-with-lane-change branch August 27, 2024 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bump patch If this pull request merged, bump patch version of the scenario_simulator_v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants