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(simple_planning_simulator): fix ego sign pitch problem #5616

Merged

Conversation

danielsanchezaran
Copy link
Contributor

@danielsanchezaran danielsanchezaran commented Nov 17, 2023

Description

There is a bug on the simple_planning simulator when enable_road_slope_simulation is true. Currently, the ego pitch angle is negative when the ego vehicle is on a downward slope and positive when on an upwards slope, which causes trouble when computing the acceleration caused by the slope (the sign is negative when it should be positive and vice versa), causing a wrong simulation output.

image

The original code:
image

As you can see on the code picture, if the vehicle is on an upwards slope, the pitch sign is negative but the resulting acceleration will be positive (-9.81 * sin(negative) = positive value) which makes no sense for an upwards slope.

Examples of wrong behavior:
The vehicle goes uphill, but its acceleration is high, it overshoots its goal

uphill_overshoot_goal.mp4

the vehicle wont move downhill

downslope_no_movement.mp4

This PR fixes the mentioned problem. Also, now the vehicle pitch simulation should be correct, even if enable_slope_simulation is disabled.

Tests performed

Tested with uphill and downhill lanelet maps:

Uphill:

cap-.2023-11-17-14-01-09.mp4

Downhill, the ego vehicle moves, no overshoot:

cap-.2023-11-17-13-57-38.mp4

Effects on system behavior

Fixes the acceleration by slope to have the correct sign. Now the simulated ego vehicle can start on a downward slope and it does not overshoot on uphill paths.

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: Daniel Sanchez <[email protected]>
@danielsanchezaran danielsanchezaran self-assigned this Nov 17, 2023
@github-actions github-actions bot added the component:simulation Virtual environment setups and simulations. (auto-assigned) label Nov 17, 2023
@danielsanchezaran danielsanchezaran added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) component:simulation Virtual environment setups and simulations. (auto-assigned) and removed component:simulation Virtual environment setups and simulations. (auto-assigned) labels Nov 17, 2023
@danielsanchezaran danielsanchezaran marked this pull request as ready for review November 17, 2023 05:11
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a84c43b) 15.26% compared to head (d0373e1) 15.37%.
Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5616      +/-   ##
==========================================
+ Coverage   15.26%   15.37%   +0.10%     
==========================================
  Files        1713     1713              
  Lines      118192   118381     +189     
  Branches    37797    37899     +102     
==========================================
+ Hits        18047    18206     +159     
- Misses      79595    79623      +28     
- Partials    20550    20552       +2     
Flag Coverage Δ *Carryforward flag
differential 57.51% <ø> (?)
total 15.26% <ø> (-0.01%) ⬇️ Carriedforward from 913a43b

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

@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Nov 17, 2023
@danielsanchezaran danielsanchezaran merged commit 40c407a into autowarefoundation:main Nov 20, 2023
21 of 23 checks passed
@danielsanchezaran danielsanchezaran deleted the fix/simulation_pitch_angle branch November 20, 2023 01:34
h-ohta pushed a commit to tier4/autoware.universe that referenced this pull request Nov 21, 2023
…oundation#5616)

* fix ego sign pitch problem

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

* change variable name for clarity

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

* update documentation to clarify that driving against the lane is not supported

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

---------

Signed-off-by: Daniel Sanchez <[email protected]>
h-ohta added a commit to tier4/autoware.universe that referenced this pull request Nov 21, 2023
…oundation#5616) (#1029)

* fix ego sign pitch problem



* change variable name for clarity



* update documentation to clarify that driving against the lane is not supported



---------

Signed-off-by: Daniel Sanchez <[email protected]>
Co-authored-by: danielsanchezaran <[email protected]>
takayuki5168 pushed a commit to tier4/autoware.universe that referenced this pull request Nov 22, 2023
…oundation#5616)

* fix ego sign pitch problem

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

* change variable name for clarity

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

* update documentation to clarify that driving against the lane is not supported

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:simulation Virtual environment setups and simulations. (auto-assigned) 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.

3 participants