From cf937cb2c051c020262454d4f2473c516169d360 Mon Sep 17 00:00:00 2001 From: Twan Koolen Date: Tue, 14 May 2019 23:12:13 -0400 Subject: [PATCH 1/5] Dependency version requirement updates. --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 401ab40..cd026aa 100644 --- a/Project.toml +++ b/Project.toml @@ -21,8 +21,8 @@ GeometryTypes = "≥ 0.4.0" InteractBase = "≥ 0.8.0" Interpolations = "≥ 0.9.0" LoopThrottle = "≥ 0.0.1" -MechanismGeometries = "≥ 0.2.0" -MeshCat = "≥ 0.6.0" +MechanismGeometries = "≥ 0.4.0" +MeshCat = "≥ 0.7.0" NBInclude = "≥ 1.1.0" OrderedCollections = "≥ 1.0.0" RigidBodyDynamics = "2" From 7038a975762768efc6681e141f440ebce5e16749 Mon Sep 17 00:00:00 2001 From: Twan Koolen Date: Wed, 15 May 2019 00:12:10 -0400 Subject: [PATCH 2/5] Temporarily undo MeshCat version bound changes. --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cd026aa..74227c9 100644 --- a/Project.toml +++ b/Project.toml @@ -22,7 +22,7 @@ InteractBase = "≥ 0.8.0" Interpolations = "≥ 0.9.0" LoopThrottle = "≥ 0.0.1" MechanismGeometries = "≥ 0.4.0" -MeshCat = "≥ 0.7.0" +MeshCat = "≥ 0.6.0" NBInclude = "≥ 1.1.0" OrderedCollections = "≥ 1.0.0" RigidBodyDynamics = "2" From 71d85d0da4be5ebcb46920aec1fe3180163ef99d Mon Sep 17 00:00:00 2001 From: Twan Koolen Date: Wed, 15 May 2019 00:10:23 -0400 Subject: [PATCH 3/5] Switch to using MeshCat.MeshFileGeometry and MechanismGeometries.MeshFile. --- src/MeshCatMechanisms.jl | 2 +- src/visualizer.jl | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/MeshCatMechanisms.jl b/src/MeshCatMechanisms.jl index be4f88d..bfba6aa 100644 --- a/src/MeshCatMechanisms.jl +++ b/src/MeshCatMechanisms.jl @@ -28,7 +28,7 @@ const rbd = RigidBodyDynamics using RigidBodyDynamics.Graphs: ancestors, edge_to_parent, source, vertices, root using Interpolations: interpolate, Gridded, Linear using LoopThrottle: @throttle -using MechanismGeometries: visual_elements, VisualElement, Skeleton, URDFVisuals, AbstractGeometrySource +using MechanismGeometries: visual_elements, VisualElement, Skeleton, URDFVisuals, AbstractGeometrySource, MeshFile using GeometryTypes: HyperSphere, Point include("visualizer.jl") diff --git a/src/visualizer.jl b/src/visualizer.jl index 11df5c8..c9915ec 100644 --- a/src/visualizer.jl +++ b/src/visualizer.jl @@ -79,14 +79,22 @@ end Attach the given geometry to the visualizer at the given frame, using its default material. """ -setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, geometry::GeometryLike, name::AbstractString="") = setelement!(mvis, frame, Object(geometry), name) +function setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, geometry::GeometryLike, name::AbstractString="") + setelement!(mvis, frame, Object(geometry), name) +end """ setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, geometry::GeometryLike, material::AbstractMaterial, name::AbstractString="") Construct an object with the given geometry and material and attach it to the visualizer """ -setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, geometry::GeometryLike, material::AbstractMaterial, name::AbstractString="") = setelement!(mvis, frame, Object(geometry, material), name) +function setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, geometry::GeometryLike, material::AbstractMaterial, name::AbstractString="") + setelement!(mvis, frame, Object(geometry, material), name) +end + +function setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, geometry::MeshFile, args...) + setelement!(mvis, frame, MeshFileGeometry(geometry.filename), args...) +end # Special cases for visualizing frames and points """ @@ -94,14 +102,18 @@ setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, geometry::Geomet Add a Triad geometry with the given scale to the visualizer at the specified frame """ -setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, scale::Real=0.5, name::AbstractString="") = setelement!(mvis, frame, Triad(scale), name) +function setelement!(mvis::MechanismVisualizer, frame::CartesianFrame3D, scale::Real=0.5, name::AbstractString="") + setelement!(mvis, frame, Triad(scale), name) +end """ setelement!(mvis::MechanismVisualizer, point::Point3D, radius::Real=0.05, name::AbstractString="") Add a HyperSphere geometry with the given radius to the visualizer at the given point """ -setelement!(mvis::MechanismVisualizer, point::Point3D, radius::Real=0.05, name::AbstractString="") = setelement!(mvis, point.frame, HyperSphere(Point(point.v[1], point.v[2], point.v[3]), convert(eltype(point.v), radius)), name) +function setelement!(mvis::MechanismVisualizer, point::Point3D, radius::Real=0.05, name::AbstractString="") + setelement!(mvis, point.frame, HyperSphere(Point(point.v[1], point.v[2], point.v[3]), convert(eltype(point.v), radius)), name) +end function _path(mechanism, body) body_ancestors = ancestors(body, mechanism.tree) From 788a3f40bc309ef1d1e0381be75596b332d1170d Mon Sep 17 00:00:00 2001 From: Twan Koolen Date: Mon, 8 Jul 2019 20:44:56 -0400 Subject: [PATCH 4/5] Bump MeshCat lower bound. --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 74227c9..cd026aa 100644 --- a/Project.toml +++ b/Project.toml @@ -22,7 +22,7 @@ InteractBase = "≥ 0.8.0" Interpolations = "≥ 0.9.0" LoopThrottle = "≥ 0.0.1" MechanismGeometries = "≥ 0.4.0" -MeshCat = "≥ 0.6.0" +MeshCat = "≥ 0.7.0" NBInclude = "≥ 1.1.0" OrderedCollections = "≥ 1.0.0" RigidBodyDynamics = "2" From fa1ef92e318e4ba5cebefe197c8a3e5f3c865efd Mon Sep 17 00:00:00 2001 From: Twan Koolen Date: Fri, 12 Jul 2019 08:24:46 -0400 Subject: [PATCH 5/5] Add missing Random test dependency. --- Project.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cd026aa..3d48dad 100644 --- a/Project.toml +++ b/Project.toml @@ -33,9 +33,10 @@ julia = "1" Blink = "ad839575-38b3-5650-b840-f874b8c74a25" NBInclude = "0db19996-df87-5ea3-a455-e3a50d440464" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" ValkyrieRobot = "c74b26e8-f247-5d24-b013-c11a2bbd97c6" [targets] -test = ["StaticArrays", "Pkg", "NBInclude", "Test", "Blink", "ValkyrieRobot"] +test = ["StaticArrays", "Pkg", "NBInclude", "Test", "Blink", "ValkyrieRobot", "Random"]