5 from pathlib
import Path
7 import pinocchio
as pin
12 pinocchio_model_dir = Path(__file__).parent.parent /
"models"
14 model_path = pinocchio_model_dir /
"example-robot-data/robots"
15 mesh_dir = pinocchio_model_dir
16 urdf_filename =
"talos_reduced.urdf"
17 urdf_model_path = model_path /
"talos_data/robots" / urdf_filename
19 model, collision_model, visual_model = pin.buildModelsFromUrdf(
20 urdf_model_path, mesh_dir, pin.JointModelFreeFlyer()
26 viz.loadViewerModel(
"pinocchio")
29 q0 = pin.neutral(model)
34 viz2.initViewer(viz.viewer)
35 viz2.loadViewerModel(rootNodeName=
"pinocchio2")
40 input(
"Press enter to exit...")