stack-of-tasks/pinocchio
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
Pinocchio: A Fast Physics Engine for Robots and Moving Machines
What it is: Pinocchio is an open-source C++ software library for computing the physics of poly-articulated systems — machines made of multiple rigid parts connected by joints, like robot arms, humanoid robots, or even biomechanical models of the human body. It was created by the Willow team at Inria in Paris.
What it does: At its core, Pinocchio implements rigid body dynamics — the math that describes how connected rigid parts move and respond to forces. It goes beyond the classic textbook algorithms (originally developed by Roy Featherstone) by adding modern capabilities:
- Handles closed loops — mechanisms where parts connect in a circle, not just a simple chain (e.g., a four-bar linkage).
- Solves contact problems — computes what happens when parts touch each other with friction, which is essential for walking robots or grasping.
- Computes derivatives — it can calculate how the physics changes when inputs change. This is crucial for gradient-based optimization, which powers modern robot control, learning, and simulation.
Why it's fast: Pinocchio is a C++ template library that exploits the natural "tree" structure of robot kinematics. It does much of the computation at compile time (rather than runtime), which makes it extremely efficient. It's also cache-friendly and supports custom number types.
Key features from the README:
- Algorithms: forward kinematics, forward/inverse dynamics, centroidal dynamics (how the whole system's center of mass behaves), and more — each with analytical derivatives.
- Formats: reads robot descriptions in URDF, SDF, MJCF, and SRDF formats, or can be built programmatically.
- Flexibility: header-only, works with C++ 17/20/23, multi-thread friendly, and tested on Windows, macOS, Unix, and Linux.
- Extras: supports multiple-precision floating-point arithmetic (MPFR) and automatic differentiation frameworks like CppAD and CasADi.
How to install:
- Conda:
conda install pinocchio -c conda-forge - pip:
pip install pin(Linux only) - Docker:
docker run --rm -it ghcr.io/stack-of-tasks/pinocchio:devel - ROS:
sudo apt install ros-$ROS_DISTRO-pinocchio
Who uses it: Pinocchio is the foundation for several major robotics software projects, including:
- Crocoddyl — a solver for optimal control in robotics
- Aligator — a differential dynamic programming solver
- Stack-of-Tasks — a hierarchical controller framework
- Humanoid Path Planner — motion and manipulation planning software
It also inspired Disney Research's Kamino simulator.
Visualization: Pinocchio supports several free visualizers: Gepetto Viewer, Meshcat (browser-based), Panda3d, RViz (ROS), and Viser.
Documentation and learning: The project provides online documentation, a cheat sheet PDF, example scripts, and Jupyter notebook tutorials.
License: BSD 2-Clause (permissive open source).
Bottom line: If you need to simulate or control any machine made of linked rigid parts — a robot, a vehicle, or even a human skeleton — Pinocchio gives you fast, accurate, and differentiable physics calculations, with a Python interface for quick prototyping.
Related
- Project
- Project
- Project
- Project
- Project