ShuoYangRobotics / A1-QP-MPC-Controller

An open source implementation of MIT Cheetah 3 controllers
GNU Affero General Public License v3.0
616 stars 130 forks source link

Possible missing coefficient when converting QP controller to osqp. #16

Closed chalkchalk closed 2 years ago

chalkchalk commented 2 years ago

in https://github.com/ShuoYangRobotics/A1-QP-MPC-Controller/blob/main/src/a1_cpp/src/A1RobotControl.cpp,A1RobotControl.cpp, line404, the gredient of osqp is calculated by gradient.block<3 * NUM_LEG, 1>(0, 0) = -inertia_inv.transpose() * Q * root_acc; It seems that a coefficient 2 is missing, which may cause undesirable performance.

chalkchalk commented 2 years ago

Ops, notice that the hessian is already halved. So there is no problem there.