# Pinocchio **Source:** https://github.com/stack-of-tasks/pinocchio **Fetched:** 2026-02-13 **Type:** GitHub Repository --- ## Description Pinocchio is a high-performance C++ library implementing state-of-the-art rigid body dynamics algorithms. Originally named after the "Rigid Body Algorithms for poly-articulated systems based on revisited Roy Featherstone's algorithms," it delivers analytical derivatives of core dynamics computations. While designed primarily for robotics, it also serves biomechanics, computer graphics, and vision applications. It is built on Eigen for linear algebra and FCL for collision detection, with full Python bindings for rapid prototyping. ## Key Features / Contents - **Forward Kinematics** with analytical derivatives - **Forward and Inverse Dynamics** with analytical derivatives - **Centroidal Dynamics** calculations - **Kinematic and Dynamic Regressors** - **Closed-loop Mechanism** support - **Frictional Contact Solvers** - **Constrained Articulated Body Algorithms** - **Sparse Constrained Dynamics** - **Robot Description Format Support**: URDF, SDF, MJCF, SRDF, and programmatic model definition - **Visualization**: Gepetto Viewer, MeshCat, Panda3D, RViz, and Viser - **Automatic Differentiation**: CppAD and CasADi support - **Multiple Precision**: MPFR arithmetic support - **Cache-friendly C++ template architecture** exploiting kinematic tree sparsity - **Full Python API** via bindings ## G1 Relevance Pinocchio is a foundational library for G1 whole-body control and motion planning: - **Inverse Kinematics (IK)**: Used to compute joint configurations for desired end-effector poses on the G1's arms and legs - **Dynamics Computation**: Forward and inverse dynamics needed for torque-based control of the G1's 29+ DOF - **Whole-Body Control**: Serves as the dynamics backend for control frameworks like TSID (Task Space Inverse Dynamics) which can be applied to the G1 - **URDF Loading**: Can directly load the G1 URDF description for model-based control - **Motion Planning**: Powers HPP (Humanoid Path Planning), directly applicable to G1 locomotion and manipulation planning - **Centroidal Dynamics**: Essential for balance and locomotion control on bipedal platforms like the G1 ## Installation / Usage ### Quick Install Options ```bash # Conda (recommended) conda install pinocchio -c conda-forge # Pip (Linux only) pip install pin # Docker docker run --rm -it ghcr.io/stack-of-tasks/pinocchio:devel # ROS 2 sudo apt install ros-$ROS_DISTRO-pinocchio ``` ### Basic Python Usage ```python import pinocchio as pin # Load robot model from URDF model = pin.buildModelFromUrdf("path/to/g1.urdf") data = model.createData() # Forward kinematics q = pin.neutral(model) pin.forwardKinematics(model, data, q) # Inverse dynamics v = np.zeros(model.nv) a = np.zeros(model.nv) tau = pin.rnea(model, data, q, v, a) ``` ### Core Dependencies - **Required**: Eigen, FCL - **Optional**: CppAD, CasADi (automatic differentiation), MPFR (multi-precision) ## Ecosystem Projects Built on Pinocchio - **Crocoddyl**: Model predictive control (MPC) framework - **TSID**: Task Space Inverse Dynamics solver - **HPP**: Humanoid Path Planning SDK - **Jiminy**: Physics simulator - **OCS2**: Optimal control toolbox ## Development Status Active development with 9,960+ commits. CI spans ROS, Linux (APT), macOS, Windows, and Robotpkg ecosystems. Development branch: `devel`.