3 import pinocchio
as pin
7 print(
"This example requires hppfcl")
13 geom_model = pin.GeometryModel()
15 hppfcl.Capsule(0.1, 0.8),
18 hppfcl.Cylinder(0.1, 1.0),
19 hppfcl.Cone(0.5, 1.0),
21 for i, geom
in enumerate(geometries):
22 placement = pin.SE3(np.eye(3), np.array([i, 0, 0]))
23 geom_obj = pin.GeometryObject(
"obj{}".format(i), 0, 0, geom, placement)
24 color = np.random.uniform(0, 1, 4)
26 geom_obj.meshColor = color
27 geom_model.addGeometryObject(geom_obj)
33 viz.initViewer(open=
True)
34 except ImportError
as error:
39 viz.loadViewerModel(
"shapes")
40 except AttributeError
as error:
44 viz.display(np.zeros(0))
45 input(
"press enter to continue")