ALTRO logs intermediate values during the course of the solve. These values are all stored in the
SolverStats type, accessible via
Altro.stats(solver). This currently stores the following information:
|Total number of iterations
|Number of outer loop (Augmented Lagrangian) iterations
|Number of projected newton iterations
|Vector of iteration number
|Vector of outer loop iteration number
|Vector of costs
|Change in cost
|Maximum constrained violation
|Approximation of dual optimality residual (2-norm of gradient of the Lagrangian)
|Maximum penalty parameter
The other fields are used interally by the solver and not important to the end user.
The vector fields of the
SolverStats type can be converted to a dictionary via
Dict(stats::SolverStats), which can then be cast into a tabular format such as
DataFrame from DataFrames.jl.
Struct containing key statistics collected during the solve, such as histories of the cost and constraint violations by time step, number of iterations, solve time, etc.
Like any nonlinear programming solver, ALTRO comes with a host of solver options. While the default values yield good/acceptable performance on many problem, extra performance can always be gained by tuning these parameters. In practice, there are only a few parameters that need to be tuned. See the AL-iLQR Tutorial for more details.
The ALTRO solver is actually a composition of several different solvers with their own options. Early versions of Altro.jl required the user to manipulate a rather confusing heirarchy of solver options. Newer versions of Altro.jl provide a single options struct that dramatically simplifies setting and working with the solver parameters.
Solver options can be specified when the solver is instantiated or afterwards using the
set_options! command. If we have a previously constructed
Problem, this looks like
solver = ALTROSolver(prob, verbose=1, constraint_tolerance=1e-3, square_root=true)
Alternatively, solver options can be set using the
set_options! command after the solver has been instantiated:
set_options!(solver, reset_duals=true, penalty_initial=100, penalty_scaling=50)
Set solver options via keyword arguments, supporting either solvers or solver option types directly. Will set any and all options that match the provided arguments. For example,
set_options!(solver::ALTROSolver, constraint_tolerance=1e-4) will set the constraint tolerance option in the ALTRO, Augmented Lagrangian, and Project Newton solvers.
The only exeption is the
verbose setting, which always accepts a boolean, while ALTRO and Augmented Lagrangian solvers accept integers 0-2, with 1 providing output for the outer AL iterations but not the iLQR iterations.
The options struct for the
ALTROSolver can be directly accessed via
Altro.options(solver). Options can be directly set or retrieved from this mutable struct.
For convenience, we provide a list of options in the ALTRO solver, along with a brief description:
|All constraint violations must be below this value.
|The difference in costs between subsequent iterations must be below this value.
|Cost tolerance for intermediate iLQR solves. Can speed up convergence by increase to 10-100x the
|Tolerance for 2-norm of primal optimality residual.
|Primal optimality residual tolerance for intermediate solve.
|Max iLQR iterations per iLQR solve.
|Max number of times iLQR can fail to make progress before exiting.
|Enable the square root backward pass for improved numerical conditioning (WIP).
|Lower bound for Armijo line search.
|Upper bound for Armijo line search.
|Max number of backtracking steps in iLQR line search
|Maximum cost value. Will terminate solve if cost exeeds this limit.
|Maximum value of any state. Will terminate solve if any state exeeds this limit.
|Maximum value of any control. Will terminate solve if any control exeeds this limit.
|Enable the static backward pass. Only advisable for state + control dimensions < 20. Turn off if compile time is exessive.
|Save the intermediate cost-to-go expansions in the iLQR backward pass.
|Enable iLQR backward pass regularization (WIP).
|Initial backward pass regularization.
|Multiplicative factor by which the regularization is increased.
|Amount of regularization added when foward pass fails
|Initial penalty term on all constraints. Set low if the unconstrained solution is a good approximate solution to the constrained problem, and high if the initial guess provided is a good esimate. If
NaN uses values in each constraint param, which defaults to
|Multiplicative factor by which the penalty is increased each outer loop iteration. High values can speed up convergence but quickly lead to poor numerical conditioning on difficult problems. Start with small values and then increase.If
NaN defaults to
10 in the per-constraint parameter.
|Max number of outer loop (Augmented Lagrangian) iterations.
|Turn on printing in the projected newton solver.
|Maximum number of projected newton steps.
|Constraint tolerance at which the solver will exit the Augmented Lagrangian solve and start the projected newton solve. Typically
|Tolerance for the active constraints during the projected newton solve. Includes some barely satisfied constraints into the active set. Can fix singularity issues during projected newton solve.
|Enable updating the dual variables during the projected newton solve. Also provides a calculation of the optimality residual in the stats output.
|Regularization on the projected newton Cholesky solve.
|Regularization on the primal variables during the projected newton solve. Required if cost Hessian is positive-semi-definite.
|Regularization on the dual variables during the multiplier projection step.
|Improvement ratio threshold for projected newton solve. If the ratio of constraint violations between subsequent steps is less than this value, it will update the cost and constraint expansions
|Enable projected newton solve. If enabled,
projected_newton_solve is used as the
constraint_tolerance for the AL-iLQR solve. Projected newton solve is still a WIP and not very robust.
|Max number of total iterations (iLQR + projected newton).
|Controls output during solve.
0 is zero output,
1 outputs AL iterations, and
2 outputs both AL and iLQR iterations
Struct containing all of the options for the ALTRO solver.