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(mpc_lateral_controller): align the MPC steering angle when the car is controlled manually. #7109

Merged
merged 11 commits into from
Jun 20, 2024

Conversation

HansOersted
Copy link
Contributor

@HansOersted HansOersted commented May 24, 2024

Description

The MPC steering angle stops tracking the actual one while the car is driving manually.

This causes the so-called "improper initial steering angle" after switching from manual to auto as below:

case 1
Screencast from 06-14-2024 01:39:49 PM.webm

case 2
Screencast from 06-14-2024 02:10:00 PM.webm

case 3
Screencast from 06-14-2024 02:31:54 PM.webm

This PR aligns the MPC steering angle when the car is controlled manually.

The resulting response of the updated algorithm is given below:

case 1 (after modification)
Screencast from 06-14-2024 01:27:01 PM.webm

case 2 (after modification)
Screencast from 06-14-2024 02:04:21 PM.webm

case 3 (after modification)
Screencast from 06-14-2024 02:28:51 PM.webm

The flag used is const bool is_under_control = input_data.current_operation_mode.is_autoware_control_enabled &&
input_data.current_operation_mode.mode ==
autoware_adapi_v1_msgs::msg::OperationModeState::AUTONOMOUS;

Related links

case 1
https://tier4.atlassian.net/jira/software/c/projects/RT1/boards/438?selectedIssue=RT0-31121

case 2
https://tier4.atlassian.net/jira/software/c/projects/RT1/boards/438?selectedIssue=RT0-30739

case 3
Case 3 was raised by Dr. M. @maxime-clem

Tests performed

https://evaluation.tier4.jp/evaluation/reports/b49b340f-dcb8-5bf0-8feb-7dfbdfd24179?page=1&project_id=prd_jt

Notes for reviewers

Interface changes

ROS Topic Changes

ROS Parameter Changes

Effects on system behavior

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 the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label May 24, 2024
@HansOersted HansOersted changed the title align the MPC steering angle when the car is controlled manually. fix(mpc_lateral_controller): align the MPC steering angle when the car is controlled manually. May 24, 2024
@HansOersted HansOersted marked this pull request as ready for review May 24, 2024 04:30
@HansOersted HansOersted force-pushed the steer_align_while_manually branch from 893f5af to fb242a6 Compare May 27, 2024 05:17
@kyoichi-sugahara
Copy link
Contributor

@HansOersted
FYI: you can choose PR template and if a big change (e,g, interface chenge) is not included, you can choose small change. Then you don't need to describe about your change that much.
image

@HansOersted HansOersted force-pushed the steer_align_while_manually branch from 3b04ccd to ce00f6d Compare June 17, 2024 02:03
@HansOersted HansOersted requested a review from TakaHoribe June 17, 2024 02:09
Copy link
Contributor

@TakaHoribe TakaHoribe left a comment

Choose a reason for hiding this comment

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

If the vehicle does not follow the MPC command (e.g. in manual mode), the previous value used to keep the consistency will not make sense. It is reasonable to reset the previous value to the current value in this case.

@TakaHoribe
Copy link
Contributor

@HansOersted Please read the description and make sure these check box are done before merge.
image

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
…abled

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
@satoshi-ota satoshi-ota force-pushed the steer_align_while_manually branch from 3ed6531 to 5e044bf Compare June 19, 2024 04:48
@takayuki5168 takayuki5168 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 19, 2024
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 18.89%. Comparing base (507e3f4) to head (0eeaf6d).
Report is 65 commits behind head on main.

Files Patch % Lines
..._lateral_controller/src/mpc_lateral_controller.cpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7109       +/-   ##
===========================================
+ Coverage   14.84%   18.89%    +4.05%     
===========================================
  Files        1999      149     -1850     
  Lines      139163    13429   -125734     
  Branches    43716     2214    -41502     
===========================================
- Hits        20661     2538    -18123     
+ Misses      95731    10537    -85194     
+ Partials    22771      354    -22417     
Flag Coverage Δ
differential 18.89% <0.00%> (?)
total ?

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

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
@HansOersted HansOersted merged commit d677314 into autowarefoundation:main Jun 20, 2024
28 of 30 checks passed
@HansOersted HansOersted deleted the steer_align_while_manually branch June 20, 2024 01:29
simon-eisenmann-driveblocks pushed a commit to simon-eisenmann-driveblocks/autoware.universe that referenced this pull request Jun 26, 2024
…r is controlled manually. (autowarefoundation#7109)

* align the MPC steering angle when the car is controlled manually.

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* update the condition for is_driving_manually

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* STOP mode included

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* comment the is_driving_manually

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* align the steering outside (after) the solver.

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* use the flag input_data.current_operation_mode.is_autoware_control_enabled

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* correct a typo

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* correct the under control condition check

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* undo the space delete

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* unchange the unrelevant line

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* pre-commit

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

---------

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Simon Eisenmann <simon.eisenmann@driveblocks.ai>
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
…r is controlled manually. (#7109)

* align the MPC steering angle when the car is controlled manually.

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* update the condition for is_driving_manually

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* STOP mode included

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* comment the is_driving_manually

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* align the steering outside (after) the solver.

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* use the flag input_data.current_operation_mode.is_autoware_control_enabled

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* correct a typo

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* correct the under control condition check

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* undo the space delete

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* unchange the unrelevant line

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

* pre-commit

Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>

---------

Signed-off-by: Zhe Shen <lucidshenzhe@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.

4 participants