Skip to content

Commit

Permalink
fixed quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac Manchester committed Jul 12, 2020
1 parent 4a26dc5 commit 20f726e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/quickstart.jl
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)

Expand Down

0 comments on commit 20f726e

Please sign in to comment.