mpc.pytorch
mpc.pytorch copied to clipboard
path follow with custom cost function
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?
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.