thowell / optimization_dynamics

Implementation and examples from Trajectory Optimization with Optimization-Based Dynamics https://arxiv.org/abs/2109.04928
MIT License
57 stars 3 forks source link

ERROR: type DataType has no field var #1

Closed zsz00 closed 1 year ago

zsz00 commented 1 year ago
 julia> include("examples/rocket.jl")

┌ Info: MeshCat server started. You can open the visualizer by visiting the following URL in your browser:
└ http://127.0.0.1:8708
ERROR: type DataType has no field var
Stacktrace:
  [1] getproperty @ ./Base.jl:33 [inlined]
  [2] call @ ~/.julia/packages/Cassette/34vIw/src/context.jl:456 [inlined]
  [3] fallback @ ~/.julia/packages/Cassette/34vIw/src/context.jl:454 [inlined]
  [4] overdub @ ~/.julia/packages/Cassette/34vIw/src/context.jl:279 [inlined]
  [5] overdub @ ./operators.jl:50 [inlined]
  [6] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(supertype), ::Type{Rotations.RotMatrix}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
  [7] overdub @ ./operators.jl:50 [inlined]
  [8] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(supertype), ::Type{Rotations.RotMatrix}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
  [9] overdub @ ./operators.jl:50 [inlined]
 [10] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(supertype), ::Type{Rotations.RotMatrix}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [11] overdub @ ./operators.jl:50 [inlined]
 [12] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(supertype), ::Type{Rotations.RotMatrix}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [13] StaticArraysCore.Size(::Type{Rotations.RotMatrix}) @ ~/.julia/packages/Rotations/QaTBi/src/core_types.jl:11 [inlined]
 [14] overdub @ ~/.julia/packages/Rotations/QaTBi/src/core_types.jl:11 [inlined]
 [15] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::Type{StaticArraysCore.Size}, ::Type{Rotations.RotMatrix}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [16] length(::Type{Rotations.RotMatrix}) @ ~/.julia/packages/StaticArrays/PUoe1/src/abstractarray.jl:2 [inlined]
 [17] overdub @ ~/.julia/packages/StaticArrays/PUoe1/src/abstractarray.jl:2 [inlined]
 [18] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(length), ::Type{Rotations.RotMatrix}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [19] need_rewrap(::Type{Rotations.RotMatrix}, ::Rotations.MRP{Float64}) @ ~/.julia/packages/StaticArrays/PUoe1/src/convert.jl:147 [inlined]
 [20] overdub @ ~/.julia/packages/StaticArrays/PUoe1/src/convert.jl:147 [inlined]
 [21] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(StaticArrays.need_rewrap), ::Type{Rotations.RotMatrix}, ::Rotations.MRP{Float64}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [22] overdub @ ~/.julia/packages/StaticArrays/PUoe1/src/convert.jl:167 [inlined]
 [23] *(::Rotations.MRP{Float64}, ::Rotations.RotX{Float64}) @ ~/.julia/packages/Rotations/QaTBi/src/core_types.jl:118 [inlined]
 [24] overdub @ ~/.julia/packages/Rotations/QaTBi/src/core_types.jl:118 [inlined]
 [25] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(*), ::Rotations.MRP{Float64}, ::Rotations.RotX{Float64}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [26] overdub @ ~/codes/optimization_dynamics/src/models/rocket/visuals.jl:40 [inlined]
 [27] overdub(overdub_context#320::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, overdub_arguments#321::OptimizationDynamics.var"#101#102"{Int64, Visualizer, Vector{Vector{Float64}}, Int64}) @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [28] atframe @ ~/.julia/packages/MeshCat/Ax8pH/src/atframe.jl:97 [inlined]
 [29] visualize!(vis::Visualizer, p::OptimizationDynamics.Rocket{Float64}, q::Vector{Vector{Float64}}; Δt::Float64, mesh::Bool, T_off::Int64) @ OptimizationDynamics ~/codes/optimization_dynamics/src/models/rocket/visuals.jl:34
 [30] top-level scope @ ~/codes/optimization_dynamics/examples/rocket.jl:120
(OptimizationDynamics) pkg> st
Project OptimizationDynamics v0.1.0
Status `~/codes/optimization_dynamics/Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1
  [5ae59095] Colors v0.12.8
  [150eb455] CoordinateTransformations v0.6.2
⌅ [a9f42406] DirectTrajectoryOptimization v0.1.3
⌅ [5c1252a2] GeometryBasics v0.3.13
  [615f187c] IfElse v0.1.1
⌅ [605048dd] IterativeLQR v0.1.1
  [033835bb] JLD2 v0.4.25
⌃ [283c5d60] MeshCat v0.14.1
  [6c8a4c8a] RelevanceStacktrace v0.1.8
  [2859eb88] RoboDojo v0.1.6
⌅ [6038ab10] Rotations v1.0.2
  [6c6a2e73] Scratch v1.1.1
⌅ [0c5d862f] Symbolics v0.1.29
  [37e2e46d] LinearAlgebra
julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 96 × Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, cascadelake)
  Threads: 1 on 96 virtual cores
Environment:
  LD_LIBRARY_PATH = /usr/local/cuda-11.1/lib64:/usr/local/cuda/extras/CUPTI/lib64
thowell commented 1 year ago

Do you have this problem with Julia 1.6?

zsz00 commented 1 year ago

I have same problem with Julia 1.6

julia> versioninfo()
Julia Version 1.6.7
Commit 3b76b25b64 (2022-07-19 15:11 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, cascadelake)

(OptimizationDynamics) pkg> st
     Project OptimizationDynamics v0.1.0
      Status `~/codes/optimization_dynamics/Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1
  [5ae59095] Colors v0.12.8
  [150eb455] CoordinateTransformations v0.6.2
  [a9f42406] DirectTrajectoryOptimization v0.1.3
  [5c1252a2] GeometryBasics v0.3.13
  [615f187c] IfElse v0.1.1
  [605048dd] IterativeLQR v0.1.1
  [033835bb] JLD2 v0.4.25
  [283c5d60] MeshCat v0.14.1
  [2859eb88] RoboDojo v0.1.6
  [6038ab10] Rotations v1.0.2
  [6c6a2e73] Scratch v1.1.1
  [0c5d862f] Symbolics v0.1.29
  [37e2e46d] LinearAlgebra

image

zsz00 commented 1 year ago

Is this a problem for MeshCat.jl or Cassette.jl, Can you test and give issue for MeshCat.jl or Cassette.jl ??

zsz00 commented 1 year ago

Or you can share the Manifest.toml that you can run properly, @thowell

thowell commented 1 year ago

I was able to fix the rendering by removing RotX(0.0) from this line