6 from pathlib
import Path
9 import pinocchio
as pin
22 VISUALIZER = GepettoVisualizer
24 VISUALIZER = MeshcatVisualizer
26 raise ValueError(
"Unrecognized option: " + opt)
30 pinocchio_model_dir = Path(__file__).parent.parent /
"models"
32 model_path = pinocchio_model_dir /
"example-robot-data/robots"
33 mesh_dir = pinocchio_model_dir
34 urdf_filename =
"talos_reduced.urdf"
35 urdf_model_path = 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")