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(map_based_prediction): use obstacle acceleration for map prediction #6072

Merged

Conversation

danielsanchezaran
Copy link
Contributor

@danielsanchezaran danielsanchezaran commented Jan 15, 2024

Description

This PR adds acceleration readings from perception into the map_based_prediction module (can be toggled on or off. Off by default) to calculate path lengths more accurately.

Since including acceleration might have a big impact on path length (the time horizon for prediction is usually between 10 to 18s and we cannot assume a car will accelerate for that long) this feature uses a decaying acceleration model to calculate the path length after time_horizon T:

a(t) = a_0 * e ^(-λ*t)

were a_0 is the instantaneous acceleration detected by perception, λ is the exponential decaying constant, and t is time with 0 <= t <= T.

The result is a map based prediction that also includes (attenuated/decaying) acceleration information for a more accurate prediction.

Also, there is a slightly more detailed explanation in this link: TIER IV INTERNAL LINK

Considerations:

  • If a vehicle is braking (decelerating) the path is computed until its predicted velocity reaches 0 (it reaches a full stop) to prevent backwards paths.
  • If a vehicle is accelerating, its velocity is capped at the vehicle's lanelet's speed limit times a constant (almost everyone drives above the speed limit). We assume the vehicle will accelerate until reaching said threshold and then continue at a constant speed.
  • If a vehicle is already going at the speed limit times our constant, and still accelerating, we use our normal model an assume there is no speed limit cap (the vehicle is driving recklessly and it is better to be conservative about path prediction).

Related links

Evaluator tests with the feature turned on: TIER IV INTERNAL LINK. No degradation when compared to base.

Also, there is a slightly more detailed explanation in this link: TIER IV INTERNAL LINK

Tests performed

Evaluator tests (see above) and PSim tests.
Some examples:

cap-.2024-01-11-18-00-03.mp4

Comparison between no acceleration consideration (first) and acc consideration (second) for a vehicle decelerating at -1 m/s^2 from a starting speed of 8 m/s. In the second case, the prediction detects the path is safe, while the first case takes a while before figuring out it will be safe

cap-.2024-01-11-18-11-03.mp4

Comparison between no acceleration consideration (first) and acc consideration (second) for a vehicle accelerating at 1.2 m/s^2 from a starting speed of 0 m/s. The second case detects danger faster than the first case.

cap-.2023-12-20-09-35-03.mp4

In this video, it can be seen how the predicted path of an accelerating vehicle is longer than a non accelerating and faster vehicle (eventually, the accelerating vehicle will overtake the non accelerating one).

Notes for reviewers

Launch changes are necessary for this PR, please review too: autowarefoundation/autoware_launch#788

NOTE: acceleration tracking is not implemented in this PR, but will be in the future.

Interface changes

Effects on system behavior

If enabled, this feature changes predicted path length by calculating future path extensions using velocity AND acceleration information from perception.

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

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

@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) labels Jan 15, 2024
@danielsanchezaran danielsanchezaran added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jan 16, 2024
@danielsanchezaran danielsanchezaran marked this pull request as ready for review January 16, 2024 00:20
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 79 lines in your changes are missing coverage. Please review.

Comparison is base (2a6dc0e) 14.63% compared to head (2cfb6d6) 14.65%.
Report is 16 commits behind head on main.

Files Patch % Lines
...based_prediction/src/map_based_prediction_node.cpp 0.00% 48 Missing ⚠️
...eption/map_based_prediction/src/path_generator.cpp 0.00% 29 Missing ⚠️
...on/include/map_based_prediction/path_generator.hpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6072      +/-   ##
==========================================
+ Coverage   14.63%   14.65%   +0.02%     
==========================================
  Files        1858     1858              
  Lines      126821   126604     -217     
  Branches    37163    37139      -24     
==========================================
- Hits        18563    18558       -5     
+ Misses      87380    87189     -191     
+ Partials    20878    20857      -21     
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 14.66% <ø> (+0.03%) ⬆️ Carriedforward from 49a2a88

*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.

danielsanchezaran and others added 6 commits January 16, 2024 11:41
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Copy link
Contributor

@maxime-clem maxime-clem left a comment

Choose a reason for hiding this comment

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

I have some minor comments about the code.
After that I will test the feature and double check the calculations.

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

@danielsanchezaran danielsanchezaran merged commit c2de78d into autowarefoundation:main Jan 19, 2024
20 of 25 checks passed
@danielsanchezaran danielsanchezaran deleted the feat/use-acc-for-map-prediction branch January 19, 2024 04:16
yuki-takagi-66 pushed a commit to tier4/autoware.universe that referenced this pull request Feb 19, 2024
…ion (autowarefoundation#6072)

* add acc filtering and decaying acc to model

Signed-off-by: Daniel Sanchez <[email protected]>

* fixed compilation problem, acc is used to predict search_dist

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* change decaying factor to T/4

Signed-off-by: Daniel Sanchez <[email protected]>

* coment out cerr for evaluation

Signed-off-by: Daniel Sanchez <[email protected]>

* simplify code

Signed-off-by: Daniel Sanchez <[email protected]>

* comments

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Implement lanelet speed limit for acc consideration

Signed-off-by: Daniel Sanchez <[email protected]>

* add option to activate on and off acceleration feature

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused class

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* delete comments

Signed-off-by: Daniel Sanchez <[email protected]>

* fix comments

Signed-off-by: Daniel Sanchez <[email protected]>

* update comments, refactor code

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused line

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request May 26, 2024
…ion (autowarefoundation#6072)

* add acc filtering and decaying acc to model

Signed-off-by: Daniel Sanchez <[email protected]>

* fixed compilation problem, acc is used to predict search_dist

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* change decaying factor to T/4

Signed-off-by: Daniel Sanchez <[email protected]>

* coment out cerr for evaluation

Signed-off-by: Daniel Sanchez <[email protected]>

* simplify code

Signed-off-by: Daniel Sanchez <[email protected]>

* comments

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Implement lanelet speed limit for acc consideration

Signed-off-by: Daniel Sanchez <[email protected]>

* add option to activate on and off acceleration feature

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused class

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* delete comments

Signed-off-by: Daniel Sanchez <[email protected]>

* fix comments

Signed-off-by: Daniel Sanchez <[email protected]>

* update comments, refactor code

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused line

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request May 28, 2024
…ion (autowarefoundation#6072)

* add acc filtering and decaying acc to model

Signed-off-by: Daniel Sanchez <[email protected]>

* fixed compilation problem, acc is used to predict search_dist

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* change decaying factor to T/4

Signed-off-by: Daniel Sanchez <[email protected]>

* coment out cerr for evaluation

Signed-off-by: Daniel Sanchez <[email protected]>

* simplify code

Signed-off-by: Daniel Sanchez <[email protected]>

* comments

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Implement lanelet speed limit for acc consideration

Signed-off-by: Daniel Sanchez <[email protected]>

* add option to activate on and off acceleration feature

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused class

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* delete comments

Signed-off-by: Daniel Sanchez <[email protected]>

* fix comments

Signed-off-by: Daniel Sanchez <[email protected]>

* update comments, refactor code

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused line

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: karishma <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request May 28, 2024
…ion (autowarefoundation#6072)

* add acc filtering and decaying acc to model

Signed-off-by: Daniel Sanchez <[email protected]>

* fixed compilation problem, acc is used to predict search_dist

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* change decaying factor to T/4

Signed-off-by: Daniel Sanchez <[email protected]>

* coment out cerr for evaluation

Signed-off-by: Daniel Sanchez <[email protected]>

* simplify code

Signed-off-by: Daniel Sanchez <[email protected]>

* comments

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Implement lanelet speed limit for acc consideration

Signed-off-by: Daniel Sanchez <[email protected]>

* add option to activate on and off acceleration feature

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused class

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* delete comments

Signed-off-by: Daniel Sanchez <[email protected]>

* fix comments

Signed-off-by: Daniel Sanchez <[email protected]>

* update comments, refactor code

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused line

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…ion (autowarefoundation#6072)

* add acc filtering and decaying acc to model

Signed-off-by: Daniel Sanchez <[email protected]>

* fixed compilation problem, acc is used to predict search_dist

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* change decaying factor to T/4

Signed-off-by: Daniel Sanchez <[email protected]>

* coment out cerr for evaluation

Signed-off-by: Daniel Sanchez <[email protected]>

* simplify code

Signed-off-by: Daniel Sanchez <[email protected]>

* comments

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Use an equivalent velocity to calculate paths

Signed-off-by: Daniel Sanchez <[email protected]>

* add missing constant to decaying acc model

Signed-off-by: Daniel Sanchez <[email protected]>

* Implement lanelet speed limit for acc consideration

Signed-off-by: Daniel Sanchez <[email protected]>

* add option to activate on and off acceleration feature

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* add params

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused class

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* delete comments

Signed-off-by: Daniel Sanchez <[email protected]>

* fix comments

Signed-off-by: Daniel Sanchez <[email protected]>

* update comments, refactor code

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused line

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
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) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants