All Projects → thowell → IterativeLQR.jl

thowell / IterativeLQR.jl

Licence: MIT license
A Julia package for constrained iterative LQR (iLQR)

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to IterativeLQR.jl

Awesome Robotics Libraries
😎 A curated list of robotics libraries and software
Stars: ✭ 1,159 (+7626.67%)
Mutual labels:  optimization, motion-planning
Osqp
The Operator Splitting QP Solver
Stars: ✭ 689 (+4493.33%)
Mutual labels:  control, optimization
osqp
The Operator Splitting QP Solver
Stars: ✭ 929 (+6093.33%)
Mutual labels:  control, optimization
robot
Functions and classes for gradient-based robot motion planning, written in Ivy.
Stars: ✭ 29 (+93.33%)
Mutual labels:  motion-planning, trajectory-optimization
Pontryagin-Differentiable-Programming
A unified end-to-end learning and control framework that is able to learn a (neural) control objective function, dynamics equation, control policy, or/and optimal trajectory in a control system.
Stars: ✭ 111 (+640%)
Mutual labels:  motion-planning, trajectory-optimization
mader
Trajectory Planner in Multi-Agent and Dynamic Environments
Stars: ✭ 252 (+1580%)
Mutual labels:  optimization, trajectory-optimization
Spot mini mini
Dynamics and Domain Randomized Gait Modulation with Bezier Curves for Sim-to-Real Legged Locomotion.
Stars: ✭ 426 (+2740%)
Mutual labels:  control, optimization
TORA.jl
Trajectory Optimization for Robot Arms
Stars: ✭ 27 (+80%)
Mutual labels:  motion-planning, trajectory-optimization
dwl
The Dynamic Whole-body Locomotion library (DWL)
Stars: ✭ 70 (+366.67%)
Mutual labels:  motion-planning, trajectory-optimization
Acados
Fast and embedded solvers for nonlinear optimal control
Stars: ✭ 194 (+1193.33%)
Mutual labels:  control, optimization
Free gait
An Architecture for the Versatile Control of Legged Robots
Stars: ✭ 263 (+1653.33%)
Mutual labels:  control, motion-planning
FlyingCarUdacity
🛩️⚙️ 3D Planning, PID Control, Extended Kalman Filter for the Udacity Flying Car Nanodegree // FCND-Term1
Stars: ✭ 16 (+6.67%)
Mutual labels:  control, motion-planning
Grl
Robotics tools in C++11. Implements soft real time arm drivers for Kuka LBR iiwa plus V-REP, ROS, Constrained Optimization based planning, Hand Eye Calibration and Inverse Kinematics integration.
Stars: ✭ 105 (+600%)
Mutual labels:  control, optimization
ContactImplicitMPC.jl
Fast contact-implicit model-predictive control for robotic systems that make and break contact with their environments.
Stars: ✭ 51 (+240%)
Mutual labels:  control, motion-planning
the-Cooper-Mapper
An open source autonomous driving research platform for Active SLAM & Multisensor Data Fusion
Stars: ✭ 38 (+153.33%)
Mutual labels:  control, motion-planning
ScareCrow-CobaltStrike
Cobalt Strike script for ScareCrow payloads intergration (EDR/AV evasion)
Stars: ✭ 387 (+2480%)
Mutual labels:  control
auv gnc
Guidance, Navigation, and Control library for AUVs
Stars: ✭ 34 (+126.67%)
Mutual labels:  control
scikit-robot
A Flexible Framework for Robot Control in Python
Stars: ✭ 70 (+366.67%)
Mutual labels:  motion-planning
Quadcopter SimCon
Quadcopter Simulation and Control. Dynamics generated with PyDy.
Stars: ✭ 84 (+460%)
Mutual labels:  control
genx
Genx provides modular building blocks to run simulations of optimization and search problems using Genetic Algorithms
Stars: ✭ 31 (+106.67%)
Mutual labels:  optimization

IterativeLQR.jl

CI codecov

A Julia package for solving constrained trajectory optimization problems with iterative LQR (iLQR).

minimize        cost_T(state_T; parameter_T) + sum(cost_t(state_t, action_t; parameter_t))
states, actions
subject to      state_t+1 = dynamics_t(state_t, action_t; parameter_t), t = 1,...,T-1 
                state_1 = state_initial
                constraint_t(state_t, action_t; parameter_t) {<,=} 0,   t = 1,...,T
  • Fast and allocation-free gradients and Jacobians are automatically generated using Symbolics.jl for user-provided costs, constraints, and dynamics.

  • Constraints are handled using an augmented Lagrangian framework.

  • Cost, dynamics, and constraints can have varying dimensions at each time step.

  • Parameters are exposed (and gradients wrt these values coming soon!)

For more details, see our related paper: ALTRO: A Fast Solver for Constrained Trajectory Optimization

Installation

From the Julia REPL, type ] to enter the Pkg REPL mode and run:

pkg> add https://github.com/thowell/IterativeLQR.jl

Quick Start

using IterativeLQR 
using LinearAlgebra

# horizon 
T = 11 

# particle 
num_state = 2
num_action = 1 

function particle(x, u, w)
   A = [1.0 1.0; 0.0 1.0]
   B = [0.0; 1.0] 
   return A * x + B * u[1]
end

# model
dynamics = Dynamics(particle, num_state, num_action)
model = [dynamics for t = 1:T-1] 

# initialization
x1 = [0.0; 0.0] 
xT = [1.0; 0.0]
ū = [1.0e-1 * randn(num_action) for t = 1:T-1] 
x̄ = rollout(model, x1, ū)

# objective 
ot = (x, u, w) -> 0.1 * dot(x, x) + 0.1 * dot(u, u)
oT = (x, u, w) -> 0.1 * dot(x, x)
ct = Cost(ot, num_state, num_action)
cT = Cost(oT, num_state, 0)
objective = [[ct for t = 1:T-1]..., cT]

# constraints
goal(x, u, w) = x - xT

cont = Constraint()
conT = Constraint(goal, num_state, 0)
constraints = [[cont for t = 1:T-1]..., conT] 

# problem
prob = Solver(model, objective, constraints)
initialize_controls!(prob, ū)
initialize_states!(prob, x̄)

# solve
solve!(prob)

# solution
x_sol, u_sol = get_trajectory(prob)

Examples

Please see the following for examples using this package:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].