-
Notifications
You must be signed in to change notification settings - Fork 696
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(mpc_lateral_controller): signal a MRM when MPC fails. #7016
Conversation
control/mpc_lateral_controller/include/mpc_lateral_controller/mpc_lateral_controller.hpp
Outdated
Show resolved
Hide resolved
9a29b89
to
74b4106
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost lgtm. Please take my suggestion.
@@ -88,9 +91,16 @@ class MpcLateralController : public trajectory_follower::LateralControllerBase | |||
// Flag indicating whether to keep the steering control until it converges. | |||
bool m_keep_steer_control_until_converged; | |||
|
|||
// MPC solver checker. | |||
bool m_is_mpc_solved{true}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is okay, but let me write some advice here.
Increasing the number of member variables is generally not recommended because having more variables accessible from anywhere in the class reduces maintainability.
In essence, this variable does not need to be a member variable. It is enough to receive the results of the MPC optimization and, if it fails, publish the diagnostic as an ERROR right there. We don't have to store the information in the class member veriable.
This code has room for improvement in the sense that it unnecessarily increases the number of member variables and outputs diagnostic information via member variables.
However, since using the diagnostic_updater makes the above improvements somewhat difficult, the current code is acceptable.
64de78c
to
b1f24cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed there are no degradation on Evaluator.
https://evaluation.tier4.jp/evaluation/reports/d6ac264d-a7c7-506d-b2e0-b70347275cfd?project_id=prd_jt
LGTM
b1f24cf
to
4adc181
Compare
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>
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>
Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>
4adc181
to
2f13bfc
Compare
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7016 +/- ##
===========================================
+ Coverage 14.84% 19.01% +4.16%
===========================================
Files 1999 149 -1850
Lines 139163 13440 -125723
Branches 43716 2217 -41499
===========================================
- Hits 20661 2555 -18106
+ Misses 95731 10531 -85200
+ Partials 22771 354 -22417
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…oundation#7016) * mpc fail checker diagnostic added Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * fix some scope issues Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * member attribute added. Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * shared pointer added. Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * member attribute (diag_updater_) added Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * dependency added. Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * implementation of the MpcLateralController corrected! Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * typo in comment corrected! Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * member method argument corrected Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * delete unnecessary reference mark Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com> * rebase Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * correct the include 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> Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com> Signed-off-by: Simon Eisenmann <simon.eisenmann@driveblocks.ai>
* mpc fail checker diagnostic added Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * fix some scope issues Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * member attribute added. Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * shared pointer added. Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * member attribute (diag_updater_) added Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * dependency added. Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * implementation of the MpcLateralController corrected! Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * typo in comment corrected! Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * member method argument corrected Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * delete unnecessary reference mark Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com> * rebase Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com> * correct the include 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> Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Description
The car is expected to experience an MRM stop when MPC fails.
Related links
https://tier4.atlassian.net/jira/software/c/projects/RT1/boards/438?selectedIssue=RT1-6221
Tests performed
Set the is_mpc_solved to false manually.
We received the error message.
Screencast from 06-05-2024 03:34:32 PM.webm
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.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.