Pinocchio

New
License: BSD 2-Clause License · Updated 2026-11-12
My rating

1. Overview

Pinocchio is an open-source C++ library that implements state-of-the-art rigid-body dynamics algorithms for poly-articulated systems, developed by the Willow team at Inria Paris in collaboration with the Gepetto team at LAAS-CNRS and released under the BSD-2-Clause licence. It revisits the foundational algorithms of Roy Featherstone and adds modern building blocks needed by contemporary robotics and physics-based simulation: it computes forward and inverse dynamics, their analytical derivatives, centroidal dynamics, regressors, closed-loop kinematics, and frictional-contact quantities. The library is a header-only C++ template layer built on Eigen for linear algebra and on coal for collision geometry, with first-class Python bindings distributed through Conda and pip, which makes it a popular choice for rapid prototyping. For a physics-AI programme the significance is that Pinocchio turns the equations of motion into differentiable functions, so that trajectory optimisers, controllers and learning loops can obtain exact gradients instead of finite differences. It is used as the dynamics backbone of Crocoddyl, TSID, HPP, Aligator, Jiminy and many other frameworks.

2. How It Works

The analytical-derivative layer is the centre of the library. Pinocchio implements the Recursive Newton-Euler Algorithm and the Articulated-Body Algorithm for forward and inverse dynamics, and it additionally provides the partial derivatives of every quantity with respect to joint configuration, velocity, acceleration and external forces. Forward kinematics, the Jacobian of any frame, the centre-of-mass position and velocity, the centroidal momentum matrix, and the regressor matrices are all available together with their first-order derivatives. Closed-loop mechanisms are supported through constrained articulated-body algorithms, and frictional-contact problems are solved with the bundled contact solvers. Because the algorithms are expressed in Lie groups, operations such as integrating an increment on the configuration manifold or composing rigid transforms are handled consistently. The library is compatible with automatic-differentiation back ends such as CppAD and CasADi, and with code-generation tools such as CppADCodeGen, so the same model can feed either numeric differentiation, symbolic differentiation or compiled C code.

3. Scope and Assumptions

Pinocchio targets rigid multibody systems assembled from joints and bodies, including tree structures and closed loops, and it assumes that the model is described by a standard articulated-body formulation. It loads models from URDF, SDF, MJCF and SRDF files or from programmatic builders, and it requires Eigen and coal as dependencies. It is cross-platform and tested on Windows, macOS, Linux and Unix, and it follows the C++17, C++20 and C++23 standards with a header-only template design that supports custom scalar types. The library is an algorithm and differentiation layer, not a standalone simulator: it computes the quantities a controller or optimiser needs, but integration of the equations of motion, contact-rich simulation and visualisation are delegated to companion tools such as Jiminy or to a full physics engine. It does not model soft bodies, fluids or continuum media, and the analytical derivatives are only as correct as the model supplied, so degenerate or singular configurations still require care.

4. Getting Started

The recommended installation path is Conda: conda install pinocchio -c conda-forge places the C++ headers and the Python module together. A Linux-only wheel is available through pip install pin, a Docker image is published as ghcr.io/stack-of-tasks/pinocchio:devel, and a system package exists for ROS via apt install ros-$ROS_DISTRO-pinocchio. In Python the shortest useful session builds a model from a URDF with pin.buildModelFromUrdf, then calls pin.forwardKinematics, pin.computeJointJacobians, pin.computeForwardDynamics or pin.computeCentroidalMomentum, all of which also return their analytical derivatives when the corresponding functions are invoked. The project ships a cheat-sheet PDF, Doxygen documentation and runnable examples that cover model loading, derivatives and contact solving. The fastest validation is to load a small URDF, print a frame Jacobian and an inverse-dynamics torque vector, confirm the numbers match a hand-check, and only then move to a controller or optimiser.

5. Comparison with Alternatives

Against a full physics engine such as MuJoCo, the distinction is division of labour: MuJoCo integrates contact dynamics and runs simulation, while Pinocchio provides the rigid-body algorithms and exact derivatives that optimisation and control layers consume, and the two are frequently used together rather than as substitutes. Against NVIDIA Warp, Pinocchio is a domain-specific rigid-body library written in C++ rather than a GPU kernel programming substrate. Against newer autodiff-native Python libraries such as Frax and differentiable stacks such as SuperMimic, Pinocchio's strength is its maturity, its analytical derivatives and its role as the de-facto dynamics backbone of the robotics ecosystem, whereas those projects trade some of that breadth for JAX-native differentiability and tighter learning-loop integration. Relative to general-purpose autodiff frameworks, Pinocchio encodes the rigid-body equations directly, so it is typically faster and more numerically stable for the specific task of computing dynamics and their gradients.

6. Benchmarks and Evidence

The accompanying software paper (Carpentier et al., IEEE SII 2019, HAL hal-01866228) reports the library's computational performance on standard rigid-body benchmarks and demonstrates that the analytical-derivative routines are competitive with, and often faster than, alternative implementations while remaining numerically robust. The design emphasises cache-friendly memory access, multithread friendliness and support for custom scalar types, which lets the same code run on single-precision, double-precision or autodiff scalar types without rewrites. In practice Pinocchio is the dynamics kernel underneath several widely used projects: Crocoddyl's differential dynamic programming, TSID's task-space inverse-dynamics quadratic programme, HPP's humanoid motion planner, Aligator's constrained trajectory optimiser and Jiminy's simulator. These downstream adoptions are the strongest evidence of its correctness and performance, because each of them depends on exact gradients for convergence. The performance claims in this entry are taken from the project's own publications and should be read as the authors' validation rather than as an independent benchmark re-run here.

7. Role in Physics-AI Workflows

Pinocchio sits at the foundation of any physics-AI workflow that needs exact equations of motion. Its analytical derivatives are what make gradient-based trajectory optimisation, model predictive control and system identification practical, because they replace noisy finite differences with exact first-order information. It complements a physics engine such as MuJoCo, supplies the dynamics that an upper-layer motion framework such as ProtoMotions assumes, and pairs with a GPU kernel substrate such as NVIDIA Warp when workloads move to the GPU. For differentiable surrogate modelling it is a natural companion to physics-informed approaches, and it is featured on the physics-AI learning path as the dynamics primitive that learning controllers build upon. The physics simulation primer explains the modelling assumptions behind these rigid-body formulations, and the classical solver cost-boundary guide clarifies when exact analytic derivatives still beat learned surrogates. A JAX-native counterpart such as Frax shows the newer direction of autodiff-first dynamics, while SuperMimic demonstrates what becomes possible once those gradients close a learning loop.

8. Limitations and Failure Modes

The first limitation is that Pinocchio models rigid multibody systems only: soft contacts, deformable bodies, fluids and continuum mechanics are out of scope, and contact-rich simulation must be handled by a dedicated engine or by Jiminy on top of Pinocchio. The second is numerical conditioning: at kinematic singularities or near-degenerate joint configurations the Jacobian and the articulated-body quantities can degrade, so operational-space and optimisation codes still need regularisation and clamping. The third is that the analytical derivatives are correct only with respect to the supplied model, so an inaccurate URDF, an unmodelled actuator or a wrong frame will propagate silently into the gradients. The fourth is that, although Python bindings are convenient, the heavy numerical work stays in C++, so very large models still incur memory and compilation considerations, and the header-only templates can lengthen build times when many scalar types are instantiated. The library is a building block, not an end-to-end controller, so safe deployment still requires the surrounding control and verification stack.

9. Version and Source Notes

Pinocchio was started around 2015 and has been developed principally by the Willow team at Inria Paris (in partnership with ENS Paris through the Willow joint team) together with the Gepetto team at LAAS-CNRS; the project was initiated by Nicolas Mansard. It is released under the BSD-2-Clause licence, and the official site is stack-of-tasks.github.io/pinocchio with Doxygen documentation hosted by the Gepetto team. The reference software paper is Carpentier, Valenza, Mansard, "Pinocchio: An Efficient and Versatile Rigid Body Dynamics Library for Robot Analysis, Simulation and Control", IEEE SII 2019 (HAL hal-01866228). The repository is actively maintained on the devel branch with more than thirteen thousand commits and continuous integration covering ROS, Linux, macOS, Windows and Robotpkg. Crocoddyl, TSID, HPP, Aligator and Jiminy are among the well-known projects that depend on it, and Disney Research's Kamino cites it as a main inspiration for the Newton physics engine. The BSD-2-Clause licence covers the source code; performance and adoption figures in this entry are drawn from the project's own publications and are not independently re-benchmarked here.

10. References

  1. Pinocchio repository README, GitHub (stack-of-tasks/pinocchio), framework overview, installation and examples.
  2. Carpentier, Valenza, Mansard, "Pinocchio: An Efficient and Versatile Rigid Body Dynamics Library for Robot Analysis, Simulation and Control", IEEE SII 2019, HAL hal-01866228.
  3. Pinocchio official site, stack-of-tasks.github.io/pinocchio, project description and releases.
  4. Pinocchio Doxygen documentation, gepetto.github.io/doc/pinocchio/doxygen-html, API reference.
  5. Pinocchio cheat-sheet PDF, repository doc folder, quick-reference for algorithms and derivatives.
  6. Featherstone, "Rigid Body Dynamics Algorithms", Springer, 2008, the foundational algorithms that Pinocchio revisits.
  7. Crocoddyl repository, a differential dynamic programming and trajectory optimisation framework built on Pinocchio.
  8. TSID repository, a task-space inverse-dynamics quadratic-programme controller built on Pinocchio.
  9. HPP (Humanoid Path Planner), a humanoid motion-planning SDK that uses Pinocchio for dynamics.
  10. Jiminy repository, a Pinocchio-based physics simulator for robot learning and control.
Tags: