mpc.pytorch icon indicating copy to clipboard operation
mpc.pytorch copied to clipboard

path follow with custom cost function

Open nag92 opened this issue 4 years ago • 1 comments

I am trying to design a custom MPC to follow a trajectory. The cost function has the form of

(x-x_i)^T Q_i (x-x_i) + (u-u_i)^T R (u-u_i)

where the x_i is desired value at that point. Is this possible using this framework? if so how would I go about setting up such a cost function?

nag92 avatar Sep 19 '20 14:09 nag92

hello, you can write this cost function into the form 0.5z^TPz+q^Tz, (equation(2) in paper https://arxiv.org/pdf/1703.00443.pdf), which is a general form of quadratic programming. in this way, x_i would be some coefficient in vector q.

sichaozhang1112 avatar Oct 12 '22 09:10 sichaozhang1112