From 20f726ebf168107305b36c7c551029e031ba24d3 Mon Sep 17 00:00:00 2001 From: Zac Manchester Date: Sat, 11 Jul 2020 17:47:09 -0700 Subject: [PATCH] fixed quickstart --- examples/quickstart.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/quickstart.jl b/examples/quickstart.jl index ba17906f..531f9490 100644 --- a/examples/quickstart.jl +++ b/examples/quickstart.jl @@ -1,13 +1,16 @@ using TrajectoryOptimization +using Altro +using RobotDynamics using StaticArrays using LinearAlgebra const TO = TrajectoryOptimization +const RD = RobotDynamics -struct DoubleIntegrator{T} <: AbstractModel +struct DoubleIntegrator{T} <: TO.AbstractModel mass::T end -function TO.dynamics(model::DoubleIntegrator, x, u) +function RD.dynamics(model::DoubleIntegrator, x, u) SA[x[2], u[1] / model.mass] end @@ -28,7 +31,7 @@ R = Diagonal(@SVector ones(m)) obj = LQRObjective(Q, R, N*Q, xf, N) # Constraints -cons = TO.ConstraintSet(n,m,N) +cons = ConstraintList(n,m,N) add_constraint!(cons, GoalConstraint(xf), N:N) add_constraint!(cons, BoundConstraint(n,m, u_min=-10, u_max=10), 1:N-1)