I’m new to the RigidBodyDynamics package and wanted to follow this tutorial.
When I call the Mechanism type I get errors. Here is my code along with the errors. It appears based on the error that it is expecting a type defined by the “mechaism_struct” in the ConstrainedDynamics.jl package, and thus is expecting additional parameters to be defined (bodes, delta t).
using RigidBodyDynamics
using StaticArrays
using LinearAlgebra
g = -9.81 # gravitational acceleration in z-direction
world = RigidBody{Float64}("world")
doublependulum = Mechanism(world; gravity = SVector(0, 0, g))
ERROR: MethodError: no method matching Mechanism(::RigidBody{Float64}; gravity=[0.0, 0.0, -9.81])
Closest candidates are:
Mechanism(::Origin{T}, ::Array{Body{T}, 1}; Δt, g) where T at C:\Users\JuliaProctor\.julia\packages\ConstrainedDynamics\yq8xZ\src\main_components\mechanism_struct.jl:146 got unsupported keyword argument "gravity"
Mechanism(::Origin{T}, ::Array{Body{T}, 1}, ::Vector{<:EqualityConstraint{T}}; Δt, g) where T at C:\Users\JuliaProctor\.julia\packages\ConstrainedDynamics\yq8xZ\src\main_components\mechanism_struct.jl:127 got unsupported keyword argument "gravity" Mechanism(::Origin{T}, ::Array{Body{T}, 1}, ::Vector{<:EqualityConstraint{T}}, ::Vector{<:InequalityConstraint{T}}; Δt, g) where T at C:\Users\JuliaProctor\.julia\packages\ConstrainedDynamics\yq8xZ\src\main_components\mechanism_struct.jl:39 got unsupported keyword argument "gravity"
How is this happening if I’m not even using the ConstrainedDynamics package in this script? Any ideas to resolve this issue are much appreciated.