When I set up a model, I am getting:
StackOverflowError:
Stacktrace:
[1] SizedMatrix{6, 3, Float64, 2, Matrix{Float64}}(a::SparseArrays.SparseMatrixCSC{Float64, Int64}) (repeats 79984 times)
@ StaticArrays C:\Users\xxx\.julia\packages\StaticArrays\MSJcA\src\SizedArray.jl:15
Here is the code
function RocketModel(mass, grav, dt, ωPlanet = [0.0; 0.0; 0.0];
integration=RobotDynamics.Exponential)
# Define the dynamics matrices (including the affine term)
A = [
zeros(3,3) I(3);
-Rotations.skew(ωPlanet)^2 -2*Rotations.skew(ωPlanet);
]
B = [
zeros(3,3);
1/mass * I(3)
]
d = [
zeros(3);
grav
]
# Continuous Linear-Affine Model
cmodel = LinearModel(A,B,d)
# Discrete Model
model = LinearizedModel(cmodel, dt=dt, is_affine=true, integration=integration)
end
# Generate the model
mass = 10.0 # kg
ωPlanet = [0, 0, 0] # rad/s
gravity = [0, 0, -9.81] # m/s/s
N = 301 # number of knot points
dt = 0.05 # sec
tf = (N-1)*dt # sec
model = RocketModel(mass, gravity, dt, ωPlanet);
This code is from the example Rocket Model-Predictive Control,I am not able to debug it.
Could you help me?