4 import pinocchio
as pin
9 print(
"This example requires hppfcl")
15 geom_model = pin.GeometryModel()
17 hppfcl.Capsule(0.1, 0.8),
20 hppfcl.Cylinder(0.1, 1.0),
21 hppfcl.Cone(0.5, 1.0),
23 for i, geom
in enumerate(geometries):
24 placement = pin.SE3(np.eye(3), np.array([i, 0, 0]))
25 geom_obj = pin.GeometryObject(f
"obj{i}", 0, 0, geom, placement)
26 color = np.random.uniform(0, 1, 4)
28 geom_obj.meshColor = color
29 geom_model.addGeometryObject(geom_obj)
35 viz.initViewer(open=
True)
36 except ImportError
as error:
41 viz.loadViewerModel(
"shapes")
42 except AttributeError
as error:
46 viz.display(np.zeros(0))
47 input(
"press enter to continue")