Constraints satisfied, but iLQR did not converge
This can be acceptable if accepted_steps > 0. It means the trajectory was optimized, but the inner cost-delta tolerance was not the final stopping reason.
Convergence Logic Tree ====================== This page helps trace an AL-iLQR solve from the innermost line-search decision to the final AL-iLQR status. Use it when ``trajOpt`` reports a failure, when constraints are satisfied but the inner iLQR status is not ``Converged``, or when a trajectory appears unchanged despite a successful return. The three layers are: .. raw:: html
Goal: satisfy all inequality constraints, then return a trajectory only if the inner solve made real progress or converged.
Collect each constraint vector c_k. Initialize lambda_aug and mu_aug with the same per-timestep sizes.
Run the middle layer with the current augmented Lagrangian penalties.
Current recoverable statuses are MaxIterations and RegularizationExceeded, because either may still leave an improved trajectory.
Return ALILQRStatus::InnerFailed.
Measure the maximum positive constraint violation.
max_c <= constraint_tol?
This is the AL feasibility test. It is checked after every iLQR subproblem, even if the iLQR status is not Converged.
Return ALILQRStatus::Converged. Constraint satisfaction is valid because the trajectory was optimized or the inner cost tolerance was reached.
Return ALILQRStatus::InnerFailed. This blocks false positives where the warm start was feasible but the optimizer never improved the trajectory.
Update lambda_aug and mu_aug, then start another AL outer iteration.
If constraints never satisfy the tolerance, return ALILQRStatus::MaxOuterIterations.
Goal: locally reduce the augmented trajectory cost by alternating backward and forward passes.
Set reg = reg_init. Telemetry starts with accepted_steps = 0.
The Riccati step requires a positive-definite regularized Q_uu.
Increase regularization by reg_scale and retry the same iLQR iteration.
Build feedback gains K, feedforward terms d, and expected cost terms deltaV.
Try to roll out a new trajectory using K, d, and decreasing line-search step sizes.
Increase regularization by reg_scale and retry from the backward pass.
Overwrite X and U. Increment accepted_steps, store last_delta_J, and store final_cost.
abs(J_prev - J_new) <= cost_tol?
Return ILQRStatus::Converged and true.
Continue to the next iLQR iteration. The trajectory may still be useful because a forward pass was accepted.
RegularizationExceeded means all regularization retries failed. MaxIterations means the cost tolerance was not reached before the iLQR iteration budget ended.
Goal: find one acceptable rollout that decreases cost consistently with the expected model reduction.
alpha = 1, 1/2, 1/4, ...
Initialize X_bar and U_bar from the current nominal trajectory.
The predicted cost change is dV(alpha) = alpha*dV0 + alpha^2*dV1
from the backward pass. A trial is only meaningful when the model predicts
descent (dV(alpha) < -1e-16); when it predicts ascent or no
change, the acceptance ratio z flips sign and a cost-increasing
rollout could otherwise be accepted.
Reject this alpha without rolling out and keep backtracking.
If every alpha is rejected this way, the forward pass fails and
regularization escalates — persistent ascent predictions usually mean stale
or indefinite curvature (check the cost Hessian mode and regularization
settings, not the dynamics).
Roll out the trial.
Reject the trial if the state is non-finite, the timestep is invalid, dynamics throw, the next state is invalid, or quaternion normalization fails.
Reject this alpha and try the next smaller step.
Compute nominal cost plus augmented Lagrangian penalty terms.
The line search requires lambda_aug[k], mu_aug[k], and c_k to have matching sizes.
Return forward-pass failure immediately.
Evaluate the line-search acceptance ratio.
beta1 <= z <= beta2?
With ilqr.ls_strict_decrease enabled, acceptance additionally
requires a strict merit decrease (J_new < J_prev).
Accept the rollout, overwrite X and U, return forward-pass success.
Reject this alpha and keep searching.
Return forward-pass failure. The middle layer will usually increase regularization and retry.
This can be acceptable if accepted_steps > 0. It means the trajectory was optimized, but the inner cost-delta tolerance was not the final stopping reason.
Treat this as unsafe. The warm start may have been feasible, but the optimizer did not produce a new trajectory.
The latest refinement attempt stalled, but previous accepted steps may still have produced a valid AL solution if constraints are now below tolerance.
The middle layer may be working, but AL penalty updates are not enforcing at least one active constraint quickly enough.