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

perf(map_based_prediction): calculate yaw without calling getLaneletAngle #2895

Merged

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented Feb 15, 2023

Signed-off-by: veqcc ryuta.kambe@tier4.jp

Description

The motivation to improve the latency of map_based_prediction node is the same as #2883 .
How I optimized getPredictedReferencePath is to remove the getLanletAngle function calls. In getLanletAngle, we search which segment is the closest to the point in parameter, where the segments are created from two adjacent centerline points in lanelet. These points in parameter, however, are exactly the points of centerline in lanelet (as seen in convertPathType). Thus, we don't have to walk through the lanelet centerline points again and to calculate the yaw from the previous point is enough.

The following figure shows how latencies are optimized with the idea. The red graph is the original latency, and the blue graph is the latency after #2883 is merged, and the green graph is the latency of this proposal.
image

By the way, the current implementation of skipping the first point is not smart I think. If you have better implementation ideas, please add a comment.

…ngle

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
@veqcc veqcc requested review from miursh, tkimura4, purewater0901 and a team as code owners February 15, 2023 15:03
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Feb 15, 2023
@xmfcx xmfcx changed the title perf(map_based_prediction): calculate yaw without calling getLaneleAngle perf(map_based_prediction): calculate yaw without calling getLaneletAngle Feb 15, 2023
@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Base: 12.59% // Head: 12.59% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (c979f82) compared to base (722f4cd).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2895      +/-   ##
==========================================
- Coverage   12.59%   12.59%   -0.01%     
==========================================
  Files        1219     1219              
  Lines       86539    86549      +10     
  Branches    24794    24794              
==========================================
  Hits        10898    10898              
- Misses      64281    64291      +10     
  Partials    11360    11360              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 12.59% <ø> (+<0.01%) ⬆️ Carriedforward from 722f4cd

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

Impacted Files Coverage Δ
...based_prediction/src/map_based_prediction_node.cpp 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@tkimura4 tkimura4 left a comment

Choose a reason for hiding this comment

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

LGTM
I confimed that the frequency of /perception/object_recognition/objects became stable even when there are a lot of objects in the planning simulator

@tkimura4 tkimura4 merged commit 61a891f into autowarefoundation:main Feb 16, 2023
tkimura4 pushed a commit to tier4/autoware.universe that referenced this pull request Feb 27, 2023
…ngle (autowarefoundation#2895)

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: veqcc <ryuta.kambe@tier4.jp>
tkimura4 added a commit to tier4/autoware.universe that referenced this pull request Feb 27, 2023
…v0.7.0

* perf(map_based_prediction): performance improvement of interpolateReferencePath with cumulative sum (autowarefoundation#2883)

* perf(map_based_prediction): performance improvement of interpolateReferencePath with cumulative sum

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* perf(map_based_prediction): calculate yaw without calling getLaneletAngle (autowarefoundation#2895)

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: veqcc <ryuta.kambe@tier4.jp>

---------

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: Ryuta Kambe <veqcc.c@gmail.com>
Co-authored-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
nabetetsu pushed a commit to xygyo77/autoware.universe that referenced this pull request Mar 1, 2023
…ngle (autowarefoundation#2895)

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: veqcc <ryuta.kambe@tier4.jp>
1222-takeshi pushed a commit to 1222-takeshi/autoware.universe that referenced this pull request Mar 6, 2023
…ngle (autowarefoundation#2895)

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: veqcc <ryuta.kambe@tier4.jp>
taikitanaka3 pushed a commit to tier4/autoware.universe that referenced this pull request Mar 6, 2023
…ngle (autowarefoundation#2895)

Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
Co-authored-by: veqcc <ryuta.kambe@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants