# StackOverflowError in AltroTutorials.jl

**URL:** <https://discourse.julialang.org/t/stackoverflowerror-in-altrotutorials-jl/121448>\
**Category:** General Usage\
**Tags:** question, package, altrotutorials, altro\
**Created:** [October 18, 2024, 10:16am UTC](https://discourse.julialang.org/t/stackoverflowerror-in-altrotutorials-jl/121448 "2024-10-18T10:16:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay\_Gao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jay_gao/32/212251_2.png) [@jay\_Gao](https://discourse.julialang.org/u/jay_Gao)\
**Post date:** [October 18, 2024, 10:16am UTC](https://discourse.julialang.org/t/stackoverflowerror-in-altrotutorials-jl/121448/1 "2024-10-18T10:16:34Z")

</div>

When I set up a model, I am getting：

```julia
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

```julia
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](https://github.com/RoboticExplorationLab/AltroTutorials.jl/blob/main/src/RocketMPC.ipynb),I am not able to debug it.  
Could you help me?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [October 18, 2024, 10:43am UTC](https://discourse.julialang.org/t/stackoverflowerror-in-altrotutorials-jl/121448/2 "2024-10-18T10:43:40Z")

</div>

Perhaps related: [Installation fails · Issue #52 · RoboticExplorationLab/Altro.jl · GitHub](https://github.com/RoboticExplorationLab/Altro.jl/issues/52)

---

<div class="post-metadata">

**Author:** ![jay\_Gao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jay_gao/32/212251_2.png) [@jay\_Gao](https://discourse.julialang.org/u/jay_Gao)\
**Post date:** [October 18, 2024, 11:23am UTC](https://discourse.julialang.org/t/stackoverflowerror-in-altrotutorials-jl/121448/3 "2024-10-18T11:23:43Z")

</div>

Thank you very much for your reply. But I can install Altro.jl and use it. Here is my package:

```julia
using Altro
using TrajectoryOptimization
using RobotDynamics
using StaticArrays
using LinearAlgebra
using Rotations

```
