I’m using RigidBodyDynamics and am trying to get my mechanism to be floating rather than fixed-base. However, when I set floating=true in parse_urdf, I get a “type QuatRotation has no field w” error after running MechanismState.
I’ve seen an example of this work, so it’s odd: example
I also tried using an earlier version of RigidBodyDynamics (v2.0.0), which didn’t throw any errors, but in this case the model is inexplicably missing from the visualization (And yes, I checked the first timestep).
curdir = pwd()
urdfpath = joinpath(curdir, "../res/flyhopper_robot/urdf/flyhopper_robot.urdf")
doublependulum = parse_urdf(urdfpath, floating=true)
state = MechanismState(doublependulum)
type QuatRotation has no field w
Stacktrace:
  [1] getproperty(x::Rotations.QuatRotation{Float64}, f::Symbol)
    @ Base ./Base.jl:33
  [2] set_rotation!
    @ ~/.julia/packages/RigidBodyDynamics/8B04X/src/joint_types/quaternion_floating.jl:37 [inlined]
  [3] zero_configuration!
    @ ~/.julia/packages/RigidBodyDynamics/8B04X/src/joint_types/quaternion_floating.jl:169 [inlined]
  [4] zero_configuration!
    @ ~/.julia/packages/RigidBodyDynamics/8B04X/src/joint.jl:353 [inlined]
  [5] (::RigidBodyDynamics.var"#57#58")(joint::Joint{Float64, QuaternionFloating{Float64}}, qjoint::SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true})
    @ RigidBodyDynamics ~/.julia/packages/RigidBodyDynamics/8B04X/src/mechanism_state.jl:294
  [6] macro expansion
    @ ~/.julia/packages/TypeSortedCollections/Z4ytl/src/TypeSortedCollections.jl:196 [inlined]
  [7] foreach
    @ ~/.julia/packages/TypeSortedCollections/Z4ytl/src/TypeSortedCollections.jl:187 [inlined]
  [8] zero_configuration!(state::MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, QuaternionFloating{Float64}}}, Vector{Joint{Float64, Revolute{Float64}}}}, 2}})
    @ RigidBodyDynamics ~/.julia/packages/RigidBodyDynamics/8B04X/src/mechanism_state.jl:293
  [9] zero!(state::MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, QuaternionFloating{Float64}}}, Vector{Joint{Float64, Revolute{Float64}}}}, 2}})
    @ RigidBodyDynamics ~/.julia/packages/RigidBodyDynamics/8B04X/src/mechanism_state.jl:318
 [10] (MechanismState{Float64, M, C, JointCollection} where {M, C, JointCollection})(mechanism::Mechanism{Float64})
    @ RigidBodyDynamics ~/.julia/packages/RigidBodyDynamics/8B04X/src/mechanism_state.jl:189
 [11] MechanismState(mechanism::Mechanism{Float64})
    @ RigidBodyDynamics ~/.julia/packages/RigidBodyDynamics/8B04X/src/mechanism_state.jl:198
 [12] top-level scope
    @ In[80]:6
 [13] eval
    @ ./boot.jl:360 [inlined]
 [14] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:1116
Edit: It seems with v2.0.0, the issue is caused when running set_configuration!(mvis, zeros(11)). Before this, the visualization appears as normal. I’m not sure how to set the starting position of the body at the origin if using zeros isn’t the answer.