JuliaRobotics / MeshCatMechanisms.jl

3D Visualization of mechanisms and URDFs using MeshCat.jl and RigidBodyDynamics.jl
Other
40 stars 10 forks source link

Adding Multiple URDFs #52

Closed aabouman closed 3 years ago

aabouman commented 3 years ago

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.

ferrolho commented 3 years ago

Yes, it is possible to load multiple robots into the scene. For example:

vis = Visualizer()

path_urdf = joinpath(@__DIR__, "..", "robots", "iiwa14.urdf")
path_package = joinpath(@__DIR__, "..", "iiwa_stack")

mechanism = parse_urdf(path_urdf, remove_fixed_tree_joints=false)
urdf_visuals = URDFVisuals(path_urdf, package_path = [path_package])

mvis_1 = MechanismVisualizer(mechanism, urdf_visuals, vis["robot_1"])
mvis_2 = MechanismVisualizer(mechanism, urdf_visuals, vis["robot_2"])

image

Does this answer your question, @aabouman? :slightly_smiling_face:

aabouman commented 3 years ago

Yeah, thanks so much!