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, placement, geom)
26 color = np.random.uniform(0, 1, 4)
28 geom_obj.meshColor = color
29 geom_model.addGeometryObject(geom_obj)
33 collision_model=geom_model,
34 visual_model=geom_model,
40 except ImportError
as error:
42 "Error while initializing the viewer. "
43 "It seems you should install gepetto-viewer"
49 viz.loadViewerModel(
"shapes")
50 except AttributeError
as error:
52 "Error while loading the viewer model. "
53 "It seems you should start gepetto-viewer"
58 viz.display(np.zeros(0))