6 import pinocchio
as pin
11 from os.path import dirname, join, abspath
22 VISUALIZER = GepettoVisualizer
24 VISUALIZER = MeshcatVisualizer
26 raise ValueError(
"Unrecognized option: " + opt)
30 pinocchio_model_dir = join(dirname(dirname(str(abspath(__file__)))),
"models")
32 model_path = join(pinocchio_model_dir,
"example-robot-data/robots")
33 mesh_dir = pinocchio_model_dir
34 urdf_filename =
"talos_reduced.urdf" 35 urdf_model_path = join(join(model_path,
"talos_data/robots"),urdf_filename)
37 robot = RobotWrapper.BuildFromURDF(urdf_model_path, mesh_dir, pin.JointModelFreeFlyer())
48 com2 = pin.centerOfMass(model,data,q0)
54 robot.loadViewerModel(
"pinocchio")