(lqr_problem)
| 78 | |
| 79 | @pytest.fixture |
| 80 | def lqr_problem_constrained(lqr_problem): |
| 81 | problem, nx, nu, x0 = lqr_problem |
| 82 | ctrl_fn = aligator.ControlErrorResidual(nx, np.zeros(nu)) |
| 83 | for stage in problem.stages: |
| 84 | stage: aligator.StageModel |
| 85 | umin = np.array([-1, -1, -1]) |
| 86 | umax = np.array([1, 1, 1]) |
| 87 | stage.addConstraint(ctrl_fn, aligator.constraints.BoxConstraint(umin, umax)) |
| 88 | space = stage.xspace |
| 89 | xf = x0 * 0.9 |
| 90 | state_fn = aligator.StateErrorResidual(space, nu, xf) |
| 91 | problem.addTerminalConstraint( |
| 92 | state_fn, aligator.constraints.EqualityConstraintSet() |
| 93 | ) |
| 94 | return lqr_problem |
| 95 | |
| 96 | |
| 97 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected