2 import pinocchio
as pin
10 material = meshcat.geometry.MeshPhongMaterial()
11 material.color = int(r * 255) * 256**2 + int(g * 255) * 256 + int(b * 255)
17 return np.array(pin.XYZQUATToSE3([x, y, z, q, u, a, t]))
24 if isinstance(viz, pin.visualize.MeshcatVisualizer):
27 viz.viewer[name].set_object(
30 elif isinstance(viz, pin.visualize.GepettoVisualizer):
31 viz.viewer.gui.addBox(name, sizex, sizey, sizez, rgba)
33 raise AttributeError(
"Viewer %s is not supported." % viz.__class__)
37 if isinstance(viz, pin.visualize.MeshcatVisualizer):
40 viz.viewer[name].set_object(
43 elif isinstance(viz, pin.visualize.GepettoVisualizer):
44 viz.viewer.gui.addSphere(name, size, rgba)
46 raise AttributeError(
"Viewer %s is not supported." % viz.__class__)
50 if isinstance(viz, pin.visualize.MeshcatVisualizer):
52 elif isinstance(viz, pin.visualize.GepettoVisualizer):
53 viz.viewer.gui.applyConfiguration(name, xyzquat)
54 viz.viewer.gui.refresh()
56 raise AttributeError(
"Viewer %s is not supported." % viz.__class__)
62 viz.viewer['world/ball'].set_object(meshcat.geometry.Sphere(.1), 63 meshcat_material(.2, .2, 1., .5)) 64 viz.viewer['world/box'].set_transform(meshcat_transform(.5, .2, .2, 1, 0, 0, 0)) 65 viz.viewer['world/ball'].set_transform(meshcat_transform(-.5, .2, .2, 1, 0, 0, 0)) def meshcat_transform(x, y, z, q, u, a, t)
def meshcat_material(r, g, b, a)
def applyViewerConfiguration(viz, name, xyzquat)
def addViewerSphere(viz, name, size, rgba)
def addViewerBox(viz, name, sizex, sizey, sizez, rgba)