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)
30 model=model, collision_model=geom_model, visual_model=geom_model,
36 except ImportError
as error:
37 print(
"Error while initializing the viewer. It seems you should install gepetto-viewer")
42 viz.loadViewerModel(
"shapes")
43 except AttributeError
as error:
44 print(
"Error while loading the viewer model. It seems you should start gepetto-viewer")
48 viz.display(np.zeros(0))