2 Pose a Solo-12 robot on a surface defined through a function and displayed through an
7 import pinocchio
as pin
8 from example_robot_data
import load
40 vizer.initViewer(loadModel=
True)
46 + np.cos(xy[1] ** 2 * 3) / 20
47 + np.sin(xy[1] * xy[0] * 5) / 10
51 def vizGround(viz, elevation_fn, space, name="ground", color=[1.0, 1.0, 0.6, 0.8]):
52 xg = np.arange(-2, 2, space)
54 xy_g = np.meshgrid(xg, xg)
56 elev_g = np.zeros((nx, nx))
57 elev_g[:, :] = elevation_fn(xy_g)
61 elev_g[:, :] = elev_g[::-1, :]
64 heightField = hppfcl.HeightFieldAABB(sx, sy, elev_g, np.min(elev_g))
65 pl = pin.SE3.Identity()
66 obj = pin.GeometryObject(
"ground", 0, pl, heightField)
67 obj.meshColor[:] = color
68 viz.addGeometryObject(obj)
72 colorrgb = [128, 149, 255, 200]
73 colorrgb = np.array(colorrgb) / 255.0