Skip to content

MPC weight problem #4720

Answered by HansOersted
hupo4321 asked this question in Q&A
May 15, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

To my understanding, addSteerWeightR and addSteerWeightF penalize the change (or derivative of the change) in the steering angle in the upcoming MPC result and penalize the change in the steering angle between the last MPC and the beginning of the upcoming MPC result.

The best way to understand these two matrices is to expand it.

We will take const Eigen::Matrix2d D = steer_rate_r * (Eigen::Matrix2d() << 1.0, -1.0, -1.0, 1.0).finished(); for example.

This will result in a diagonal matrix below:

Define u = [u1 u2 u3 ...]'
Expand u' * R * u yields
(u1 - u2) ^2 + (u2 - u3) ^2 + (u3 - u4) ^2 + ...

Consequently, the weight for the steering rate compensation is defined in this part.

Likewise, …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maxime-clem
Comment options

Answer selected by maxime-clem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
component:control Vehicle control algorithms and mechanisms.
3 participants