# Failed to precompile TrajectoryOptimization

**URL:** <https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 26, 2024, 8:47am UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900 "2024-09-26T08:47:35Z")\
**Posts on this page:** 6\
**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:** [September 26, 2024, 8:47am UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900/1 "2024-09-26T08:47:36Z")

</div>

when I add TrajectoryOptimization , I got an error message:  
ERROR: LoadError: LoadError: UndefVarError: QuatRotation not defined

```julia
[Info: Precompiling TrajectoryOptimization [c79d492b-0548-5874-b488-5a62c1d9d0ca]
ERROR: LoadError: LoadError: UndefVarError: QuatRotation not defined
Stacktrace:
  [1] top-level scope
    @ C:\Users\xxx\.julia\packages\RobotDynamics\OMNjA\src\liestate.jl:42
  [2] include(mod::Module, _path::String)
    @ Base .\Base.jl:384
  [3] include(x::String)
    @ RobotDynamics C:\Users\xxx\.julia\packages\RobotDynamics\OMNjA\src\RobotDynamics.jl:1
  [4] top-level scope
    @ C:\Users\xxx\.julia\packages\RobotDynamics\OMNjA\src\RobotDynamics.jl:28
  [5] include
    @ .\Base.jl:384 [inlined]
  [6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base .\loading.jl:1235
  [7] top-level scope
    @ none:1
  [8] eval
    @ .\boot.jl:360 [inlined]
  [9] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [10] top-level scope
    @ none:1
in expression starting at C:\Users\xxx\.julia\packages\RobotDynamics\OMNjA\src\liestate.jl:42
in expression starting at C:\Users\xxx\.julia\packages\RobotDynamics\OMNjA\src\RobotDynamics.jl:1
ERROR: LoadError: Failed to precompile RobotDynamics [38ceca67-d8d3-44e8-9852-78a5596522e1] to C:\Users\xxx\.julia\compiled\v1.6\RobotDynamics\jl_86A1.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] include
    @ .\Base.jl:384 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base .\loading.jl:1235
  [9] top-level scope
    @ none:1
 [10] eval
    @ .\boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at C:\Users\xxx\.julia\packages\TrajectoryOptimization\cGEqd\src\TrajectoryOptimization.jl:1
ERROR: LoadError: Failed to precompile TrajectoryOptimization [c79d492b-0548-5874-b488-5a62c1d9d0ca] to C:\Users\xxx\.julia\compiled\v1.6\TrajectoryOptimization\jl_7B46.tmp.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
   @ Base .\loading.jl:1385
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base .\loading.jl:1329
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1043
 [5] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:936
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:923
 [7] include(fname::String)
   @ Base.MainInclude .\client.jl:444
 [8] top-level scope
   @ REPL[7]:1
in expression starting at xxx\Altro.jl-main\examples\quickstart.jl:2

```

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [September 26, 2024, 10:32am UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900/2 "2024-09-26T10:32:59Z")

</div>

Hello and welcome to the community 👋

This package hasn’t been maintained in a long time, I suggest you find another alternative. I suggest having a look at InfiniteOpt.jl

---

<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:** [September 26, 2024, 11:02am UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900/3 "2024-09-26T11:02:56Z")

</div>

Thanks for your answer.  
I am very interested in the Altro package, but it relies on TrajectoryOptimization. When I add the TrajectoryOptimization package, it shows the above error, how do I solve that problem?  
My guess is that the dependency Rotations version in TrajectoryOptimization is too low.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [September 26, 2024, 12:38pm UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900/4 "2024-09-26T12:38:38Z")

</div>

You could manually add a version of `Rotations` that is compatible, the compat bound on Rotations in TrajectoryOptimization is probably incorrect

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [September 26, 2024, 12:39pm UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900/5 "2024-09-26T12:39:45Z")

</div>

Someone has made an update here

> <https://github.com/justinberi/TrajectoryOptimization.jl/pull/1>

you could install that PR branch instead using

```julia
pkg> add TrajectoryOptimization#update_rotations

```

---

<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:** [September 27, 2024, 1:36pm UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900/6 "2024-09-27T13:36:11Z")

</div>

Thank you very much for your patient answer. My problem has been solved. Best wishes for you！
