• Stars
    star
    141
  • Rank 258,296 (Top 6 %)
  • Language
    Julia
  • License
    MIT License
  • Created over 4 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CI codecov

Altro.jl

Implementation of the Augmented Lagrangian TRajectory Optimizer (ALTRO) solver, a very fast solver for constrained trajectory optimization problems. ALTRO uses iterative LQR (iLQR) with an augmented Lagrangian framework and can solve problems with nonlinear inequality and equality path constraints and nonlinear dynamics. The key features of the ALTRO solver are:

  • General nonlinear cost functions, including minimum time problems
  • General nonlinear state and input constraints
  • Infeasible state initialization
  • Square-root methods for improved numerical conditioning
  • Active-set projection method for solution polishing

Altro.jl solves trajectory optimization problems set up using TrajectoryOptimization.jl.

For details on the solver, see the original conference paper or related tutorial.

Simple Example

See examples/quickstart.jl for a simple example of solving the canonical cartpole problem with Altro.jl.

Solver Statistics

ALTRO logs intermediate values during the course of the solve. These values are all stored in the SolverStats type, accessible via solver.stats or Altro.stats(solver). This currently stores the following information:

Field Description
iterations Total number of iterations
iterations_outer Number of outer loop (Augmented Lagrangian) iterations
iterations_pn Number of projected newton iterations
iteration Vector of iteration number
iteration_outer Vector of outer loop iteration number
cost Vector of costs
dJ Change in cost
c_max Maximum constrained violation
gradient Approximation of dual optimality residual (2-norm of gradient of the Lagrangian)
penalty_max 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.

Solver Options

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 version of Altro.jl provide a single options struct that dramatically simplifies setting and working with the solver parameters.

Setting Solver Options

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)

Querying Solver Options

The options struct for the ALTROSolver can be directly accessed via solver.opts or Altro.options(solver). Options can be directly set or retrieved from this mutable struct.

List of Options

For convenience, we provide a list of options in the ALTRO solver, along with a brief description:

Option Description Importance Default
constraint_tolerance All constraint violations must be below this value. High 1e-6
cost_tolerance The difference in costs between subsequent iterations must be below this value. High 1e-4
cost_tolerance_intermediate Cost tolerance for intermediate iLQR solves. Can speed up convergence by increase to 10-100x the cost_tolerance. Med 1e-4
gradient_tolerance Tolerance for 2-norm of primal optimality residual. Low 1
gradient_tolerance_intermediate Primal optimality residual tolerance for intermediate solve. Low 10
iterations_inner Max iLQR iterations per iLQR solve. Med 300
dJ_counter_limit Max number of times iLQR can fail to make progress before exiting. Low 10
square_root Enable the square root backward pass for improved numerical conditioning (WIP). Med false
line_search_lower_bound Lower bound for Armijo line search. Low 1e-8
line_search_upper_bound Upper bound for Armijo line search. Low 10.0
iterations_linesearch Max number of backtracking steps in iLQR line search Low 20
max_cost_value Maximum cost value. Will terminate solve if cost exeeds this limit. Low 1e8
max_state_value Maximum value of any state. Will terminate solve if any state exeeds this limit. Low 1e8
max_control_value Maximum value of any control. Will terminate solve if any control exeeds this limit. Low 1e8
static_bp Enable the static backward pass. Only advisable for state + control dimensions < 20. Turn off if compile time is exessive. Low true
save_S Save the intermediate cost-to-go expansions in the iLQR backward pass. Low false
bp_reg Enable iLQR backward pass regularization (WIP). Med false
bp_reg_initial Initial backward pass regularization. Low 0.0
bp_reg_increase_factor Multiplicative factor by which the regularization is increased. Low 1.6
bp_reg_max Maximum regularization. Low 1e8
bp_reg_min Minimum regularization. Low 1e-8
bp_reg_fp Amount of regularization added when foward pass fails Low 10.0
penalty_initial 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 1.0. Very High NaN
penalty_scaling 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. Very High NaN
iterations_outer Max number of outer loop (Augmented Lagrangian) iterations. Med 30
verbose_pn Turn on printing in the projected newton solver. Low false
n_steps Maximum number of projected newton steps. Low 2
projected_newton_tolerance Constraint tolerance at which the solver will exit the Augmented Lagrangian solve and start the projected newton solve. Typically sqrt(constraint_tolerance) High 1e-3
active_set_tolerance_pn 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. Med 1e-3
multiplier_projected Enable updating the dual variables during the projected newton solve. Also provides a calculation of the optimality residual in the stats output. Low true
ρ_chol Regularization on the projected newton Cholesky solve. Med 1e-2
ρ_primal Regularization on the primal variables during the projected newton solve. Required if cost Hessian is positive-semi-definite. Low 1e-8
ρ_dual Regularization on the dual variables during the multiplier projection step. Low 1e-8
r_threshold 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 Low 1.1
projected_newton 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. High true
iterations Max number of total iterations (iLQR + projected newton). Med 1000
verbose Controls output during solve. 0 is zero output, 1 outputs AL iterations, and 2 outputs both AL and iLQR iterations Low 0

More Repositories

1

TrajectoryOptimization.jl

A fast trajectory optimization library written in Julia
Julia
329
star
2

Algames.jl

ALGAMES: Game Theoretic Solver for Trajectory Optimization
Julia
105
star
3

ReLUQP-py

A GPU-Accelerated Quadratic Programming Solver for Model-Predictive Control
Python
76
star
4

ALTRO

C++ implementation of ALTRO (Augmented Lagrangian TRajectory Optimizer)
C++
48
star
5

legged_mpc_control

A legged robot controller for Unitree A1 and Go1 robot using different MPC algorithms
C++
42
star
6

RobotDynamics.jl

Julia
41
star
7

ReLUQP.jl

A GPU Accelerated Quadratic Programming Solver for Model-Predictive Control
Julia
37
star
8

LUCIDGames.jl

Jupyter Notebook
33
star
9

RobotZoo.jl

Julia
26
star
10

TinyMPC-AL

Model-predictive control based on augmented Lagrangian
C
25
star
11

Aquarium.jl

A differentiable fluid-structure interaction (FSI) solver for robotics applications.
Julia
11
star
12

mcu-solver-benchmarks

Benchmarking solvers on microcontrollers (MCU), within TinyMPC project
C
11
star
13

AltroTutorials.jl

Jupyter Notebook
10
star
14

L1CostOptimizer.jl

Fast Solution of Optimal Control Problems With L1 Cost
Jupyter Notebook
10
star
15

EntryGuidance.jl

Julia
8
star
16

tinympc-crazyflie-firmware

TinyMPC-integrated firmware for the Crazyflie Nano Quadcopter
C
8
star
17

FlexibleSpacecraftMPC

Repository accompanying the paper "Model-Predictive Attitude Control for Flexible Spacecraft During Thruster Firings"
MATLAB
8
star
18

TrajOptPlots.jl

Jupyter Notebook
7
star
19

MaximalCoordinateDynamics.jl

Julia
7
star
20

RExHopper

Hardware control and simulation of a monopodal hopping robot with reaction wheels.
C++
7
star
21

PlanningWithAttitude

TeX
7
star
22

sprite

KickSat Sprite (2019) running Circuitpython
HTML
7
star
23

roboticexplorationlab.github.io

Lab Website
HTML
7
star
24

EarthAlbedo.jl

Julia
5
star
25

odrive-communication-speed

C++
5
star
26

CGAC

Python
5
star
27

Deep-ILC

Python
5
star
28

TortoiseSat.jl

Under-actuated control of satellite attitude using magnetorquers and trajectory optimization
Julia
5
star
29

KSRelativeOrbits

Implementation of results in the 2023 IEEE Aerospace Paper "Convex Optimization of Relative Orbit Maneuvers Using the Kustaanheimo-Stiefel Transformation"
Julia
5
star
30

TinyMPC-ADMM

C++
5
star
31

altro-mpc-icra2021

Julia
4
star
32

RExQuadruped

Control system for quadruped written in Julia
Julia
4
star
33

tinympc-dev-julia

TinyMPC prototype and experiment development in Julia (unofficial)
C
4
star
34

DifferentialRotations.jl

Package for doing optimization on the space of rotations
Julia
4
star
35

PDAL-CPP

C++
4
star
36

JuliaiLQR

Jupyter Notebook
4
star
37

rex-hopper-python

Control and simulation of a monopodal hopping robot with reaction wheels in PyBullet.
Jupyter Notebook
4
star
38

KSLowThrust

Julia
4
star
39

sprite-decoder

MATLAB
3
star
40

Mercury.jl

A fleet-footed asynchronous messaging system, designed specifically for robotics applications
Julia
3
star
41

EntryVehicle.jl

Julia
3
star
42

SpacecraftSimulator

Julia based spacecraft simulator
Julia
2
star
43

SensorCalibration

Julia
2
star
44

EmbeddedLciMpc.jl

Julia
2
star
45

MaximalCoordinates_WAFR2020_Experiments

Julia
2
star
46

EntryVehicleModel.jl

Spacecraft entry vehicle dynamic model.
Julia
2
star
47

Distributed-Low-Communication-State-Estimation-Procedure-for-Cubesat-Formations

Julia
2
star
48

RExVicon

A simple interface to the Vicon SDK to relay data over ZMQ or serial
C++
1
star
49

IGRF

Low-fidelity Magnetic Field for Simulation Purposes
Julia
1
star
50

SatProp.jl

Satellite Propagator
Julia
1
star
51

JuliaIntro

Contains code and presentations for getting started with Julia (and other things)
Jupyter Notebook
1
star
52

DroneCad

Cad models for REx Lab drone
1
star
53

Lab-Logos

1
star
54

RosDockerWorkspace

Shell
1
star
55

Acrobot

Acrobot hardware design
1
star
56

SphereConeEntryVehicle.jl

Entry Vehicle Dynamics Model. We develop a 6D-model parametric for the dynamics of a sphere-cone entry vehicle.
Jupyter Notebook
1
star
57

TrackingControl.jl

Easily develop and test controllers for nonlinear dynamical systems
Julia
1
star
58

Px4MPC

C++
1
star
59

TrajOptCore.jl

Julia
1
star