Giter Club home page Giter Club logo

meshcatmechanisms.jl's Introduction

MeshCatMechanisms

Build Status codecov.io

MeshCatMechanisms.jl adds support for visualizing mechanisms and robots from RigidBodyDynamics.jl with MeshCat.jl. All geometries are constructed using MechanismGeometries.jl.

Features:

  • Parsing geometry directly from URDF files
  • Animation of robot trajectories from RigidBodyDynamics.jl simulations
  • Live rendering of simulation progress using the OdeIntegrators.OdeResultsSink interface
  • Interactive manipulation of the mechanism configuration using InteractBase.jl

Related Projects

MeshCatMechanisms.jl provides similar functionality to RigidBodyTreeInspector.jl, but is built on top of the lighter-weight MeshCat viewer instead of DrakeVisualizer.jl.

Installation

Stable release:

Pkg.add("MeshCatMechanisms")

Latest and greatest:

Pkg.add("MeshCatMechanisms")
Pkg.clone("https://github.com/rdeits/MechanismGeometries.jl")
Pkg.checkout("MeshCatMechanisms")
Pkg.checkout("MeshCat")

Usage

See examples/demo.ipynb

Examples

meshcatmechanisms.jl's People

Contributors

ambyld avatar femtocleaner[bot] avatar ferrolho avatar github-actions[bot] avatar juliatagbot avatar rdeits avatar tkoolen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

meshcatmechanisms.jl's Issues

Load robot urdf with .obj meshes and their corresponding textures from .mtl files

When loading a urdf with .obj meshes, the corresponding mesh textures from the .mtl files aren't displayed in the MeshCat visualization.

I load the urdf file using this code snippet:

using MeshCat, RigidBodyDynamics, MeshCatMechanisms
vis = Visualizer() 
urdf = "/home/alphonsus/models/robot.urdf"
robot = parse_urdf(urdf)
mvis = MechanismVisualizer(robot, URDFVisuals(urdf), vis)
set_configuration!(mvis, [0.0, 0.0])
render(vis)

The robot shows up without the textures:
problem

The robot is expected to look like this:
expected

Is there a way to load urdfs with .obj meshes in a manner that allows the corresponding textures from .mtl files to show up?

PR2 URDF - missing textures

Hi,

I am trying to work with the PR2 URDF in MeshCat + RigidBodyDynamics. The URDF is from this ROS package, which has a .xacro file that I first converted to a singular .urdf file via rosrun xacro xacro pr2.urdf.xacro --inorder KINECT1:=false KINECT2:=false > pr2_0.urdf.

When I use the Visualizer in my browser window, the textures are missing. Except for the caster wheels (which have texture PNGs), everything uses a solid RGBA colour as the material, but none seem to show up.

This is what I see in the visualizer:
image

This is what I expect to see (from PyBullet; ignore the "table"):
image (1)

The URDFVisuals structure seems to contain the right information (mesh paths, material colours etc.) but they are obviously not getting visualised correctly. Is there a good way to debug this? Here's an example of a VisualElement in the URDFVisuals struct:
VisualElement{MechanismGeometries.MeshFile, CoordinateTransformations.AffineMap{StaticArrays.SMatrix{3, 3, Float64, 9}, StaticArrays.SVector{3, Float64}}}(CartesianFrame3D: "after_head_pan_joint" (id = 66), MechanismGeometries.MeshFile("/opt/ros/kinetic/share/pr2_description/meshes/head_v0/head_pan.dae"), RGBA{Float32}(0.0f0,0.0f0,0.8f0,1.0f0), AffineMap([1.0 0.0 0.0; 0.0 1.0 0.0; -0.0 0.0 1.0], [0.0, 0.0, 0.0]))

The URDF I am using is at this Github gist.

Better documentation

It is unclear from the demo and code comments how to manipulate an arbitrary robot model. I have a single body, single joint (base to world) model loaded. My intent is to run a dynamics model in a networked server and use MeshCatMechanisms as a display. My goal is simply to load the model and then apply arbitrary transforms onto it as the display refreshes. The demos work fine, so that is not the issue.

When it comes to setting up the model, it is unclear how to do things like: set origin at center of display, set model transformations. It is also unclear what variables are involved in set_configuration!() function. It seems like the mechanism visualizer, the joints, and some transform parameter are the inputs. However, it is not clear what the transform parameter is. The third parameter is a list of Float64 numbers corresponding to joints. I can't think of a transform that can be fully described by a single number, though.

After digging, it seems like the key may be in the RigidBodyDynamics package, but it has taken a long time to figure this out.

Apologies if this response is unorganized, but I am a bit rushed to write this and am still quite confused in how a robot can be arbitrarily assigned a transformation. Perhaps adding documentation for just this will be of use to others as well. My current attempt is shown below:

`
homog(t::Translation) = homog(AffineMap(eye(3),t.v))

vis = Visualizer()
urdf = joinpath(pwd(), "resources", "quadrotor.urdf")
#urdf = joinpath(pwd(), "resources", "Acrobot.urdf")
robot = parse_urdf(Float64, urdf)
delete!(vis)
mvis = MechanismVisualizer(robot, URDFVisuals(urdf), vis)
body = bodies(robot)[end]
body_frame = default_frame(body)
setelement!(mvis,body_frame)
at = homog(Translation(0,0,-1))
set_configuration!(mvis,
findjoint(mvis.state.mechanism,
"base_link_to_world"),
[1.0])

open(vis)
`
Edit: Above example fails with: ERROR: LoadError: BoundsError: attempt to access 0-element SubArray{Float64,1,Array{Float64,1},Tuple{UnitRange{Int64}},true} at index [Base.OneTo(1)]

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Guard against ridiculously long animations?

Accidentally trying to animate a trajectory of thousands or tens of thousands of seconds takes locks up both Julia and the viewer, as we end up producing an incredible number of samples. Maybe we can guard against this? Perhaps by limiting the animation sampling rate to some constant factor above the sample rate of the ts vector?

Adding Multiple URDFs

Is it possible to add multiple URDFs to the same MeshCat window?
I looked through the documentation of both RigidBodyDynamics.jl and MeshCatMechanisms.jl and was unable to find any mention of this.

Creating a MechanismVisualizer now takes over a minute?

using RigidBodyDynamics
urdf = joinpath(dirname(pathof(RigidBodyDynamics)), "..", "test", "urdf", "Acrobot.urdf")
mechanism = parse_urdf(urdf)

using MeshCat, MeshCatMechanisms
@time mvis = MechanismVisualizer(mechanism, URDFVisuals(urdf))

results in 70.614526 seconds (143.61 M allocations: 7.937 GiB, 5.79% gc time). Something is very wrong.

julia> versioninfo()
Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)

Toml files.

`Animation()` not working

Hi,

Ive been trying to follow the example at

https://github.com/JuliaRobotics/MeshCatMechanisms.jl/blob/master/examples/demo.ipynb

but the animations don't work.

The error message is below. Tested on a Mac, in IJulia, running Julia 1.7.2

If anyone could help point me towards the issue I can try to help fix the bug.

Thanks
Dev

MethodError: no method matching StaticArrays.Size(::TypeVar)
Closest candidates are:
  StaticArrays.Size(::Union{StaticArrays.Dynamic, Int64}...) at ~/.julia/packages/StaticArrays/0T5rI/src/traits.jl:67
  StaticArrays.Size(::StaticArrays.TSize{S}) where S at ~/.julia/packages/StaticArrays/0T5rI/src/matrix_multiply_add.jl:194
  StaticArrays.Size(::Tuple{Vararg{Union{StaticArrays.Dynamic, Int64}}}) at ~/.julia/packages/StaticArrays/0T5rI/src/traits.jl:66
  ...

Stacktrace:
  [1] call
    @ ~/.julia/packages/Cassette/34vIw/src/context.jl:456 [inlined]
  [2] fallback
    @ ~/.julia/packages/Cassette/34vIw/src/context.jl:454 [inlined]
  [3] _overdub_fallback(::Any, ::Vararg{Any})
    @ ~/.julia/packages/Cassette/34vIw/src/overdub.jl:586 [inlined]
  [4] overdub
    @ ~/.julia/packages/Cassette/34vIw/src/overdub.jl:586 [inlined]
  [5] StaticArrays.Size(::Type{StaticArrays.SVector})
    @ ~/.julia/packages/StaticArrays/0T5rI/src/traits.jl:90 [inlined]
  [6] overdub
    @ ~/.julia/packages/StaticArrays/0T5rI/src/traits.jl:90 [inlined]
  [7] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::Type{StaticArrays.Size}, ::Type{StaticArrays.SVector})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
  [8] size(::Type{StaticArrays.SVector})
    @ ~/.julia/packages/StaticArrays/0T5rI/src/abstractarray.jl:4 [inlined]
  [9] overdub
    @ ~/.julia/packages/StaticArrays/0T5rI/src/abstractarray.jl:4 [inlined]
 [10] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(size), ::Type{StaticArrays.SVector})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [11] overdub
    @ ~/.julia/packages/StaticArrays/0T5rI/src/convert.jl:114 [inlined]
 [12] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(StaticArrays.length_match_size), ::Type{StaticArrays.SVector}, ::StaticArrays.Args{Tuple{Float64, Float64, Float64}})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [13] adapt_size(::Type{StaticArrays.SVector}, ::StaticArrays.Args{Tuple{Float64, Float64, Float64}})
    @ ~/.julia/packages/StaticArrays/0T5rI/src/convert.jl:86 [inlined]
 [14] overdub
    @ ~/.julia/packages/StaticArrays/0T5rI/src/convert.jl:86 [inlined]
 [15] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(StaticArrays.adapt_size), ::Type{StaticArrays.SVector}, ::StaticArrays.Args{Tuple{Float64, Float64, Float64}})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [16] construct_type(::Type{StaticArrays.SVector}, ::StaticArrays.Args{Tuple{Float64, Float64, Float64}})
    @ ~/.julia/packages/StaticArrays/0T5rI/src/convert.jl:79 [inlined]
 [17] overdub
    @ ~/.julia/packages/StaticArrays/0T5rI/src/convert.jl:79 [inlined]
 [18] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(StaticArrays.construct_type), ::Type{StaticArrays.SVector}, ::StaticArrays.Args{Tuple{Float64, Float64, Float64}})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [19] (StaticArrays.SVector)(::Float64, ::Float64, ::Float64)
    @ ~/.julia/packages/StaticArrays/0T5rI/src/convert.jl:152 [inlined]
 [20] overdub
    @ ~/.julia/packages/StaticArrays/0T5rI/src/convert.jl:152 [inlined]
 [21] translation(::Transform3D{Float64})
    @ ~/.julia/packages/RigidBodyDynamics/8B04X/src/spatial/transform3d.jl:50 [inlined]
 [22] overdub
    @ ~/.julia/packages/RigidBodyDynamics/8B04X/src/spatial/transform3d.jl:50 [inlined]
 [23] overdub
    @ ~/.julia/packages/RigidBodyDynamics/8B04X/src/spatial/transform3d.jl:68 [inlined]
 [24] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(inv), ::Transform3D{Float64})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [25] overdub
    @ ~/.julia/packages/RigidBodyDynamics/8B04X/src/mechanism_state.jl:1013 [inlined]
 [26] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(relative_transform), ::MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}}, ::CartesianFrame3D, ::CartesianFrame3D)
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [27] overdub
    @ ~/.julia/packages/MeshCatMechanisms/PfrGE/src/visualizer.jl:146 [inlined]
 [28] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(MeshCatMechanisms._render_state!), ::MechanismVisualizer{MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}}, Visualizer}, ::MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [29] _render_state!(::MechanismVisualizer{MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}}, Visualizer})
    @ ~/.julia/packages/MeshCatMechanisms/PfrGE/src/visualizer.jl:135 [inlined]
 [30] overdub
    @ ~/.julia/packages/MeshCatMechanisms/PfrGE/src/visualizer.jl:135 [inlined]
 [31] overdub
    @ ~/.julia/packages/MeshCatMechanisms/PfrGE/src/visualizer.jl:168 [inlined]
 [32] overdub(::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, ::typeof(set_configuration!), ::MechanismVisualizer{MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}}, Visualizer}, ::Vector{Float64})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [33] (::MeshCatMechanisms.var"
    @ ~/.julia/packages/MeshCatMechanisms/PfrGE/src/animate.jl:45 [inlined]
 [34] overdub
    @ ~/.julia/packages/MeshCatMechanisms/PfrGE/src/animate.jl:45 [inlined]
 [35] overdub(overdub_context#299::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#301", Nothing, Nothing}, overdub_arguments#300::MeshCatMechanisms.var"#5#6"{MechanismVisualizer{MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}}, Visualizer}, Interpolations.GriddedInterpolation{Vector{Float64}, 1, SegmentedVector{JointID, Float64, Base.OneTo{JointID}, Vector{Float64}}, Interpolations.Gridded{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Vector{Float64}}}, Float64})
    @ Cassette ~/.julia/packages/Cassette/34vIw/src/overdub.jl:0
 [36] atframe
    @ ~/.julia/packages/MeshCat/oC0sL/src/atframe.jl:100 [inlined]
 [37] Animation(mvis::MechanismVisualizer{MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}}, Visualizer}, times::Vector{Float64}, configurations::Vector{SegmentedVector{JointID, Float64, Base.OneTo{JointID}, Vector{Float64}}}; fps::Int64)
    @ MeshCatMechanisms ~/.julia/packages/MeshCatMechanisms/PfrGE/src/animate.jl:44
 [38] Animation(mvis::MechanismVisualizer{MechanismState{Float64, Float64, Float64, TypeSortedCollections.TypeSortedCollection{Tuple{Vector{Joint{Float64, Revolute{Float64}}}}, 1}}, Visualizer}, times::Vector{Float64}, configurations::Vector{SegmentedVector{JointID, Float64, Base.OneTo{JointID}, Vector{Float64}}})
    @ MeshCatMechanisms ~/.julia/packages/MeshCatMechanisms/PfrGE/src/animate.jl:37
 [39] top-level scope
    @ In[10]:1
 [40] eval
    @ ./boot.jl:373 [inlined]
 [41] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:1196

1


Precompiling error

The package displays the following error:

INFO: Precompiling module MeshCatMechanisms.
ERROR: LoadError: UndefVarError: MeshMaterial not defined
Stacktrace:
 [1] anonymous at ./<missing>:2
while loading /home/phelipe/.julia/v0.6/MeshCatMechanisms/src/MeshCatMechanisms.jl, in expression starting on line 13
ERROR: Failed to precompile MeshCatMechanisms to /home/phelipe/.julia/lib/v0.6/MeshCatMechanisms.ji.
Stacktrace:
 [1] macro expansion at ./REPL.jl:97 [inlined]
 [2] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73

Precompilation error

I just tried to install this package under julia v1.5.1 and got the following error (after the pkg log)

(@v1.5) pkg> add MeshCatMechanisms
   Updating registry at `~/.julia/registries/General`
  Resolving package versions...
  Installed Mux ─────────────────────── v0.7.2
  Installed MeshCatMechanisms ───────── v0.7.1
  Installed OffsetArrays ────────────── v1.1.3
  Installed DiffEqBase ──────────────── v6.46.1
  Installed Pluto ───────────────────── v0.11.10
  Installed Atom ────────────────────── v0.12.21
  Installed RigidBodyDynamics ───────── v2.1.1
  Installed OrdinaryDiffEq ──────────── v5.42.5
  Installed SentinelArrays ──────────── v1.2.14
  Installed Requires ────────────────── v1.0.2
  Installed CSSUtil ─────────────────── v0.1.1
  Installed GPUCompiler ─────────────── v0.6.1
  Installed Compat ──────────────────── v3.15.0
  Installed DataStructures ──────────── v0.18.2
  Installed GeometryTypes ───────────── v0.7.6
  Installed StochasticDiffEq ────────── v6.25.1
  Installed FFMPEG ──────────────────── v0.3.0
  Installed Knockout ────────────────── v0.2.4
  Installed PlotUtils ───────────────── v1.0.6
  Installed Rotations ───────────────── v1.0.1
  Installed DiffEqCallbacks ─────────── v2.14.1
  Installed LightGraphs ─────────────── v1.3.0
  Installed FlameGraphs ─────────────── v0.2.4
  Installed Polynomials ─────────────── v1.1.6
  Installed DistributionsAD ─────────── v0.6.7
  Installed MechanismGeometries ─────── v0.5.0
  Installed FuzzyCompletions ────────── v0.2.3
  Installed DelayDiffEq ─────────────── v5.24.2
  Installed Lazy ────────────────────── v0.14.0
  Installed InteractBase ────────────── v0.10.5
  Installed CoordinateTransformations ─ v0.6.0
  Installed MeshCat ─────────────────── v0.11.2
  Installed LightXML ────────────────── v0.9.0
  Installed ChainRules ──────────────── v0.7.15
  Installed StatsBase ───────────────── v0.32.0
  Installed CommonMark ──────────────── v0.6.3
Updating `~/.julia/environments/v1.5/Project.toml`
  [c52e3926]  Atom v0.12.20  v0.12.21
  [6ad125db] + MeshCatMechanisms v0.7.1
  [1dea7af3]  OrdinaryDiffEq v5.42.3  v5.42.5
  [c3e4b0f8]  Pluto v0.11.9  v0.11.10
  [366cf18f]  RigidBodyDynamics v2.2.0  v2.1.1
Updating `~/.julia/environments/v1.5/Manifest.toml`
  [c52e3926]  Atom v0.12.20  v0.12.21
  [70588ee8] + CSSUtil v0.1.1
  [082447d4]  ChainRules v0.7.14  v0.7.15
  [a80b9123]  CommonMark v0.6.2  v0.6.3
  [34da2185]  Compat v3.14.0  v3.15.0
  [150eb455] + CoordinateTransformations v0.6.0
  [864edb3b]  DataStructures v0.17.20  v0.18.2
  [bcd4f6db]  DelayDiffEq v5.24.1  v5.24.2
  [2b5f629d]  DiffEqBase v6.44.3  v6.46.1
  [459566f4]  DiffEqCallbacks v2.13.5  v2.14.1
  [c894b116]  DiffEqJump v6.10.0  v6.10.1
  [ced4e74d]  DistributionsAD v0.6.6  v0.6.7
  [c87230d0]  FFMPEG v0.4.0  v0.3.0
  [08572546]  FlameGraphs v0.2.3  v0.2.4
  [fb4132e2]  FuzzyCompletions v0.2.1  v0.2.3
  [61eb1bfa]  GPUCompiler v0.6.0  v0.6.1
  [4d00f742]  GeometryTypes v0.8.3  v0.7.6
  [d3863d7c] + InteractBase v0.10.5
  [bcebb21b] + Knockout v0.2.4
  [50d2b5c4]  Lazy v0.15.1  v0.14.0
  [093fc24a]  LightGraphs v1.3.3  v1.3.0
  [9c8b4983]  LightXML v0.8.1  v0.9.0
  [931e9471] + MechanismGeometries v0.5.0
  [283c5d60] + MeshCat v0.11.2
  [6ad125db] + MeshCatMechanisms v0.7.1
  [a975b10e]  Mux v0.7.0  v0.7.2
  [6fe1bfb0]  OffsetArrays v1.1.2  v1.1.3
  [1dea7af3]  OrdinaryDiffEq v5.42.3  v5.42.5
  [995b91a9]  PlotUtils v1.0.5  v1.0.6
  [c3e4b0f8]  Pluto v0.11.9  v0.11.10
  [f27b6e38]  Polynomials v1.1.5  v1.1.6
  [ae029012]  Requires v1.0.1  v1.0.2
  [366cf18f]  RigidBodyDynamics v2.2.0  v2.1.1
  [6038ab10]  Rotations v0.13.0  v1.0.1
  [91c51154]  SentinelArrays v1.2.13  v1.2.14
  [2913bbd2]  StatsBase v0.33.1  v0.32.0
  [789caeaf]  StochasticDiffEq v6.25.0  v6.25.1
   Building RigidBodyDynamics  `~/.julia/packages/RigidBodyDynamics/XgNGG/deps/build.log`
   Building Knockout ───────── `~/.julia/packages/Knockout/IP1uR/deps/build.log`
   Building MeshCat ────────── `~/.julia/packages/MeshCat/ECbzr/deps/build.log`
   Building InteractBase ───── `~/.julia/packages/InteractBase/sOe2Z/deps/build.log`


[ Info: Precompiling MeshCatMechanisms [6ad125db-dd91-5488-b820-c1df6aab299d]
ERROR: LoadError: UndefVarError: UnitQuaternion not defined
Stacktrace:
 [1] include(::Function, ::Module, ::String) at ./Base.jl:380
 [2] include(::Module, ::String) at ./Base.jl:368
 [3] top-level scope at none:2
 [4] eval at ./boot.jl:331 [inlined]
 [5] eval(::Expr) at ./client.jl:467
 [6] top-level scope at ./none:3
in expression starting at /home/fredrikb/.julia/packages/MeshCat/ECbzr/src/MeshCat.jl:4
ERROR: LoadError: Failed to precompile MeshCat [283c5d60-a78f-5afe-a0af-af636b173e11] to /home/fredrikb/.julia/compiled/v1.5/MeshCat/CZdjb_OIo6V.ji.

mvis without any geometries

Hi,

Is there a way to initialize a MechanismVisualizer without any geometry elements? To give an example I have created a mechanism and I want only elements added using the setelement! method to be visible.

I know elements can be loaded from an URDF file (without auto-generated elements?), but I use for loops when creating my mechanism so that wouldn't be very practical.

I suppose other options would be to make all geometry elements invisible at some point and add my elements afterwards or make elements whose name matches r"^geometry_\d*$" invisible (or remove them).

I wanted to ask here before I go dive into the source code, all help will be appreciated.

Incompatibilities with MeshCat: QuatRotation has no field x

When running the examples:

julia> animation = Animation(mvis, t, q)
ERROR: type QuatRotation has no field x
Stacktrace:
  [1] getproperty
    @ ./Base.jl:42 [inlined]
  [2] js_quaternion(q::Rotations.QuatRotation{Float64})
    @ MeshCat ~/.julia/packages/MeshCat/Ax8pH/src/atframe.jl:33
  [3] js_quaternion(r::Rotations.RotMatrix3{Float64})
    @ MeshCat ~/.julia/packages/MeshCat/Ax8pH/src/atframe.jl:35
  [4] js_quaternion(tform::CoordinateTransformations.AffineMap{Rotations.RotMatrix3{Float64}, StaticArrays.SVector{3, Float64}})
    @ MeshCat ~/.julia/packages/MeshCat/Ax8pH/src/atframe.jl:36
  [5] overdub(ctx::Cassette.Context{nametype(AnimationCtx), Tuple{Animation, Int64}, Nothing, Cassette.var"##PassType#276", Nothing, Nothing}, #unused#::typeof(settransform!), vis::Visualizer, tform::CoordinateTransformations.AffineMap{Rotations.RotMatrix3{Float64}, StaticArrays.SVector{3, Float64}})
    @ MeshCat ~/.julia/packages/MeshCat/Ax8pH/src/atframe.jl:54
  [6] overdub
    @ ~/.julia/packages/MeshCatMechanisms/QczZo/src/visualizer.jl:147 [inlined]

Issue running MeshCat example

Hi all,

I've attempted to run the example given in the README line-by-line on the REPL but upon executing:
t, q, v = simulate(state, 5.0); have come across this massive Stacktrace (listed at the end of the message due to its length). I tried making sure all packages are up to date and that all prerequisites are installed but no luck. Any ideas what might be causing the issue?

julia> t, q, v = simulate(state, 5.0);
ERROR: MethodError: no method matching GeometricJacobian(::CartesianFrame3D, ::CartesianFrame3D, ::CartesianFrame3D, ::StaticArrays.SArray{Tuple{3,0},Float64,2,0}, ::StaticArrays.SArray{Tuple{3,0},Union{},2,0})
Closest candidates are:
  GeometricJacobian(::CartesianFrame3D, ::CartesianFrame3D, ::CartesianFrame3D, ::A<:(AbstractArray{T,2} where T), ::A<:(AbstractArray{T,2} where T)) where A<:(AbstractArray{T,2} where T) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/spatial/spatialmotion.jl:15
Stacktrace:
 [1] transform(::GeometricJacobian{StaticArrays.SArray{Tuple{3,0},Float64,2,0}}, ::Transform3D{Float64}) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/spatial/spatialmotion.jl:47
luticorn/.julia/packages/RigidBodyDynamics/0saII/src/spatial/spatialmotion.jl:47
 [2] _motion_subspace at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/mechanism_state.jl:711 [inlined]
 [3] (::getfield(RigidBodyDynamics, Symbol("##65#66")))(::MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}}, ::Joint{Float64,Fixed{Float64}}, ::SubArray{Float64,1,Array{Float64,1},Tuple{UnitRange{Int64}},true}) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/mechanism_state.jl:717
 [4] _update_motion_subspaces!(::MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}}) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/custom_collections.jl:42
 [5] update_motion_subspaces! at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/mechanism_state.jl:705 [inlined]
 [6] mass_matrix!(::LinearAlgebra.Symmetric{Float64,Array{Float64,2}}, ::MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}}) at /home/polluticorn/.julia/pac{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}}) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/mechanism_algorithms.jl:251
 [7] mass_matrix! at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/mechanism_algorithms.jl:281 [inlined]
 [8] #dynamics!#114(::RigidBodyDynamics.CustomCollections.ConstDict{JointID,RigidBodyDynamics.PDControl.SE3PDGains{RigidBodyDynamics.PDControl.PDGains{Float64,Float64},RigidBodyDynamics.PDControl.PDGains{Float64,Float64}}}, ::Function, ::DynamicsResult{Float64,Float64}, ::MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}}, ::SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}}, ::RigidBodyDynamics.CustomCollections.NullDict{BodyID,Wrench{Float64}}) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/mechanism_algorithms.jl:877
 [9] #dynamics! at ./none:0 [inlined] (repeats 2 times)
 [10] (::getfield(RigidBodyDynamics, Symbol("##117#118")){typeof(RigidBodyDynamics.zero_torque!),DynamicsResult{Float64,Float64},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},RigidBodyDynamics.CustomCollections.ConstDict{JointID,RigidBodyDynamics.PDControl.SE3PDGains{RigidBodyDynamics.PDControl.PDGains{Float64,Float64},RigidBodyDynamics.PDControl.PDGains{Float64,Float64}}}})(::SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}}, ::Array{Float64,1}, ::Float64, ::MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}}) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/simulate.jl:44
 [11] step(::RigidBodyDynamics.OdeIntegrators.MuntheKaasIntegrator{4,Float64,getfield(RigidBodyDynamics, Symbol("##117#118")){typeof(RigidBodyDynamics.zero_torque!),DynamicsResult{Float64,Float64},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},RigidBodyDynamics.CustomCollections.ConstDict{JointID,RigidBodyDynamics.PDControl.SE3PDGains{RigidBodyDynamics.PDControl.PDGains{Float64,Float64},RigidBodyDynamics.PDControl.PDGains{Float64,Float64}}}},RigidBodyDynamics.OdeIntegrators.ExpandingStorage{Float64,SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}}},MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}},16,RigidBodyDynamics.OdeIntegrators.MuntheKaasStageCache{4,Float64,SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},Array{Float64,1}}}, ::Float64, ::Float64) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/ode_integrators.jl:273
 [12] macro expansion at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/ode_integrators.jl:312 [inlined]
 [13] macro expansion at /home/polluticorn/.julia/packages/LoopThrottle/KOwMl/src/LoopThrottle.jl:89 [inlined]
 [14] #integrate#17(::Float64, ::Function, ::RigidBodyDynamics.OdeIntegrators.MuntheKaasIntegrator{4,Float64,getfield(RigidBodyDynamics, Symbol("##117#118")){typeof(RigidBodyDynamics.zero_torque!),DynamicsResult{Float64,Float64},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},RigidBodyDynamics.CustomCollections.ConstDict{JointID,RigidBodyDynamics.PDControl.SE3PDGains{RigidBodyDynamics.PDControl.PDGains{Float64,Float64},RigidBodyDynamics.PDControl.PDGains{Float64,Float64}}}},RigidBodyDynamics.OdeIntegrators.ExpandingStorage{Float64,SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}}},MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}},16,RigidBodyDynamics.OdeIntegrators.MuntheKaasStageCache{4,Float64,SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},Array{Float64,1}}}, ::Float64, ::Float64) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/ode_integrators.jl:311
 [15] integrate(::RigidBodyDynamics.OdeIntegrators.MuntheKaasIntegrator{4,Float64,getfield(RigidBodyDynamics, Symbol("##117#118")){typeof(RigidBodyDynamics.zero_torque!),DynamicsResult{Float64,Float64},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},RigidBodyDynamics.CustomCollections.ConstDict{JointID,RigidBodyDynamics.PDControl.SE3PDGains{RigidBodyDynamics.PDControl.PDGains{Float64,Float64},RigidBodyDynamics.PDControl.PDGains{Float64,Float64}}}},RigidBodyDynamics.OdeIntegrators.ExpandingStorage{Float64,SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}}},MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}},16,RigidBodyDynamics.OdeIntegrators.MuntheKaasStageCache{4,Float64,SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}},Array{Float64,1}}}, ::Float64, ::Float64) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/ode_integrators.jl:308
 [16] #simulate#116(::Float64, ::RigidBodyDynamics.CustomCollections.ConstDict{JointID,RigidBodyDynamics.PDControl.SE3PDGains{RigidBodyDynamics.PDControl.PDGains{Float64,Float64},RigidBodyDynamics.PDControl.PDGains{Float64,Float64}}}, ::Function, ::MechanismState{Float64,Float64,Float64,TypeSortedCollections.TypeSortedCollection{Tuple{Array{Joint{Float64,Fixed{Float64}},1},Array{Joint{Float64,Revolute{Float64}},1}},2}}, ::Float64, ::typeof(RigidBodyDynamics.zero_torque!)) at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/simulate.jl:53
 [17] simulate at /home/polluticorn/.julia/packages/RigidBodyDynamics/0saII/src/simulate.jl:38 [inlined] (repeats 2 times)
 [18] top-level scope at none:0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.