Skip to content

Included an stopping criteria test for KKT on LQR problem

Carlos Mastalli requested to merge topic/unittest into devel

This PR includes a very simple unit-test for stopping criteria in LQR problem. Basically, we build and solve a KKT problem (computeKKTPoint https://gepgitlab.laas.fr/loco-3d/cddp/blob/topic/unittest/unittest/ddp.py#L184). After that, we check that the gradient of the Lagrangian is equals zero.

Some extra comments:

  • The KKT problem is built by computing the Hessian of the problem, the Jacobian for the constraints (dynamics one) and cost function, and the constraint function. All these terms are computed by assuming an LQR problem, i.e. by using the quadratic approximation of the cost and the linear approximation of the dynamics. This routine is defined in buildKKTProblem (https://gepgitlab.laas.fr/loco-3d/cddp/blob/topic/unittest/unittest/ddp.py#L138).
  • The gradient of the Lagrangian computation assumes LQR problem, it doesn't work for nonlinear problems.

This proposes a solution for the #17 (closed).

Merge request reports