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(autonomous_emergency_braking): speed up aeb #8778

Conversation

danielsanchezaran
Copy link
Contributor

Description

This PR refactors the AEB code to speed up processing time. Clustering and path-based pointcloud cropping are done once per iteration instead of twice. Some other changes are done to increase speed.

Comparison using driving log replayer:
before
aeb_times.txt

times higher than 70 ms:

processing_time: 89.683 processing_time: 74.601 processing_time: 82.908 processing_time: 87.936 processing_time: 93.321 processing_time: 89.623 processing_time: 119.028 processing_time: 99.281 processing_time: 85.516 processing_time: 72.685 processing_time: 85.565 processing_time: 93.702 processing_time: 87.082 processing_time: 72.67 processing_time: 107.033 processing_time: 95.981 processing_time: 73.572 processing_time: 97.633 processing_time: 82.361 processing_time: 95.262 processing_time: 78.441 processing_time: 93.552 processing_time: 72.987 processing_time: 72.825 processing_time: 75.752 processing_time: 76.714 processing_time: 73.017 processing_time: 74.023 processing_time: 81.248 processing_time: 85.993 processing_time: 117.669 processing_time: 109.717

After

aeb_times_after_pr.txt

Only times higher than 30 ms:

processing_time: 32.252 processing_time: 30.629 processing_time: 34.249 processing_time: 32.926 processing_time: 30.046 processing_time: 35.681 processing_time: 33.811 processing_time: 51.401 processing_time: 51.346 processing_time: 39.437 processing_time: 31.665 processing_time: 30.943 processing_time: 35.911 processing_time: 30.852 processing_time: 33.021 processing_time: 30.979 processing_time: 42.528 processing_time: 39.72 processing_time: 32.504 processing_time: 32.254 processing_time: 34.45 processing_time: 33.739 processing_time: 35.689 processing_time: 34.073 processing_time: 42.685 processing_time: 42.625 processing_time: 40.024 processing_time: 36.324 processing_time: 37.852 processing_time: 34.826 processing_time: 30.493 processing_time: 34.955 processing_time: 45.721 processing_time: 34.387

Related links

ticket: https://tier4.atlassian.net/browse/RT1-5790
Parent Issue:

  • Link

How was this PR tested?

Psim, DLR

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
@danielsanchezaran danielsanchezaran marked this pull request as ready for review September 5, 2024 09:27
@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@danielsanchezaran danielsanchezaran added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Sep 5, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 6.97674% with 80 lines in your changes missing coverage. Please review.

Project coverage is 24.13%. Comparing base (1ae6082) to head (e5438c4).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
...autoware_autonomous_emergency_braking/src/node.cpp 7.50% 72 Missing and 2 partials ⚠️
...utoware_autonomous_emergency_braking/src/utils.cpp 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8778      +/-   ##
==========================================
- Coverage   24.13%   24.13%   -0.01%     
==========================================
  Files        1407     1409       +2     
  Lines      102317   102360      +43     
  Branches    38830    38840      +10     
==========================================
+ Hits        24699    24703       +4     
- Misses      75045    75083      +38     
- Partials     2573     2574       +1     
Flag Coverage Δ *Carryforward flag
differential 6.59% <6.97%> (?)
total 24.15% <ø> (+0.01%) ⬆️ Carriedforward from 1ae6082

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kyoichi-sugahara kyoichi-sugahara self-assigned this Sep 5, 2024
Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks
You can follow my suggestion and you can ignore my suggestion as you like!

@danielsanchezaran danielsanchezaran merged commit 46bf5ec into autowarefoundation:main Sep 6, 2024
41 checks passed
@danielsanchezaran danielsanchezaran deleted the feat/fix-missing-transform-lookup branch September 6, 2024 04:02
emuemuJP pushed a commit to arayabrain/autoware.universe.origin that referenced this pull request Sep 10, 2024
…8778)

* add missing rclcpp::Time(0)

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* refactor to reduce cropping to once per iteration

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* add LookUpTransform to utils

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* separate object creation and clustering

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* error handling of empty pointcloud

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

---------

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
Signed-off-by: emuemuJP <k.matsumoto.0807@gmail.com>
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request Sep 11, 2024
…8778)

* add missing rclcpp::Time(0)

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* refactor to reduce cropping to once per iteration

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* add LookUpTransform to utils

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* separate object creation and clustering

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* error handling of empty pointcloud

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

---------

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
kosuke55 pushed a commit to tier4/autoware.universe that referenced this pull request Sep 20, 2024
…8778)

* add missing rclcpp::Time(0)

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* refactor to reduce cropping to once per iteration

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* add LookUpTransform to utils

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* separate object creation and clustering

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* error handling of empty pointcloud

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

---------

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request Oct 28, 2024
…8778)

* add missing rclcpp::Time(0)

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* refactor to reduce cropping to once per iteration

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* add LookUpTransform to utils

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* separate object creation and clustering

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* error handling of empty pointcloud

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

---------

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request Nov 14, 2024
…8778)

* add missing rclcpp::Time(0)

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* refactor to reduce cropping to once per iteration

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* add LookUpTransform to utils

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* separate object creation and clustering

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

* error handling of empty pointcloud

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>

---------

Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:control Vehicle control algorithms and mechanisms. (auto-assigned) 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