-
Notifications
You must be signed in to change notification settings - Fork 682
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): bilinear discretization #1567
fix(mpc): bilinear discretization #1567
Conversation
@boyali Would you please check this fix for the bilinear discretization? |
Codecov ReportBase: 10.85% // Head: 10.85% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #1567 +/- ##
=======================================
Coverage 10.85% 10.85%
=======================================
Files 1176 1176
Lines 77652 77652
Branches 19386 19386
=======================================
Hits 8432 8432
Misses 59978 59978
Partials 9242 9242
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. |
a_d = inv * (I + dt * 0.5 * a_d); | ||
c_d = c_d * inv; | ||
b_d = inv * b_d * dt; | ||
w_d = inv * w_d * dt; |
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 don't know if you are using d_d. Even D = 0 in the continuous state space is not zero in the discrete version.
y(k) = Cx(k) + Du(k)
Here my implementation in the Autoware Control Toolbox.
auto const &&mat1_ATs = I - A_ * Ts / 2.;
auto const &&inv1_ATs = mat1_ATs.inverse();
Ad_ = inv1_ATs * (I + A_ * Ts / 2.);
Bd_ = inv1_ATs * B_ * Ts;
Cd_ = C_ * inv1_ATs;
Dd_ = D_ + C_ * Bd_ / 2.;
Dd = D + C inv(1 - Adt/2) Bdt/2
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.
Thank you for the comment. I misunderstood. Since we can assume the system has a ZOH input, we don't need to convert the measurement equation.
fa6282c
to
7a5e992
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.
We tested it on a real vehicle and found no problems.
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
7a5e992
to
f35af14
Compare
This reverts commit f70cb22.
fix dependency of mult object tracker
…n#1612) * chore: fix dependency of mult object tracker (autowarefoundation#1567) fix dependency of mult object tracker * add relax logic Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * define params Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * add universe params Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * delete null line Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * fix spell Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * fix Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * change universe params Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> --------- Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> Co-authored-by: Shohei Sakai <saka1s.jp@gmail.com>
…n#1612) * chore: fix dependency of mult object tracker (autowarefoundation#1567) fix dependency of mult object tracker * add relax logic Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * define params Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * add universe params Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * delete null line Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * fix spell Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * fix Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> * change universe params Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> --------- Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp> Co-authored-by: Shohei Sakai <saka1s.jp@gmail.com>
Description
The bilinear discretization used in the MPC model needs to be fixed.
Related links
Tests performed
To see the accuracy of the model, steering rate information is visualized below.
The important lines are:
These two plots should fit in the perfect model. (Although there is a time shift due to the delay compensation.) You can see that the current model is not good, and the bilinear one has the best fit.
Current Implementation
![image](https://user-images.githubusercontent.com/21360593/183908929-698ab8b4-40d5-480c-b07b-de04512ab12a.png)
(Ad is bilinear, but Bd, Cd, Wd is Euler)
Euler
![image](https://user-images.githubusercontent.com/21360593/183909208-9d762483-0c50-47e4-80e2-9259f89904db.png)
Bilinear (fixed)
![image](https://user-images.githubusercontent.com/21360593/184152249-1b2537a7-6aae-4ad2-90ff-98ef8e7f2ee7.png)
Note: test site in simulation (kashiwanoha)
![image](https://user-images.githubusercontent.com/21360593/183909921-e8b2cb26-dc90-45f8-b3cc-0d1c6a89c0ec.png)
Notes for reviewers
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.