Installation Procedure
You can choose either to install a pre-compiled release of Pinocchio or just build it directly from source. Here is a list of supported installation methods:
For Linux system, Pinocchio uses the robotpkg framework to package the release versions and to resolve the dependencies.
What is robotpkg ?
robotpkg is a package manager tailored for robotics softwares. It greatly simplifies the release of new versions along with the management of their dependencies.
Ubuntu LTS 20.04, 22.04 and 24.04
The software binaries of the packages managed by robotpkg are directly available through the apt repository
of robotpkg for the Ubuntu LTS 20.04, 22.04 and 24.04. You just need to add the robotpkg apt repository to your
sources.list and typically use sudo apt install robotpkg- + packagename
to install a missing software and its
dependencies. Below, we recall the steps to first add the robotpkg apt repository and then install Pinocchio.
Add robotpkg apt repository
If you have never added robotpkg as a softwares repository, please follow first the instructions from 1 to 4. Otherwise, go directly to instruction 5. Those instructions are similar to the installation procedures presented in http://robotpkg.openrobots.org/debian.html.
-
Ensure you have some required installation dependencies
sudo apt install -qqy lsb-release curl
-
Register the authentication certificate of robotpkg:
sudo mkdir -p /etc/apt/keyrings curl http://robotpkg.openrobots.org/packages/debian/robotpkg.asc \ | sudo tee /etc/apt/keyrings/robotpkg.asc
-
Add robotpkg as source repository to apt:
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/robotpkg.asc] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg" \ | sudo tee /etc/apt/sources.list.d/robotpkg.list
-
You need to run at least once apt update to fetch the package descriptions:
sudo apt update
Install Pinocchio
-
The installation of Pinocchio and its dependencies is made through the line:
sudo apt install -qqy robotpkg-py3*-pinocchio
It will install all the systems and additional required dependences.
Configure environment variables
All the packages will be installed in the /opt/openrobots
directory. To make use of installed libraries and programs,
you must need to configure your PATH
, PKG_CONFIG_PATH
, PYTHONPATH
and other similar environment variables to
point inside this directory. For instance:
export PATH=/opt/openrobots/bin:$PATH
export PKG_CONFIG_PATH=/opt/openrobots/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/opt/openrobots/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/opt/openrobots/lib/python3.10/site-packages:$PYTHONPATH # Adapt your desired python version here
export CMAKE_PREFIX_PATH=/opt/openrobots:$CMAKE_PREFIX_PATH
You may directly add those lines to your $HOME/.bashrc
for a persistent configuration.
Other distributions
Nix and Arch packages are available, see the other tabs in this page.
For the other distributions, the easiest way to get Pinocchio is to install robotpkg and let it manage the Pinocchio installation (see From robotpkg for the instructions). You can check the compilation status on various distributions through pinocchio-status.
Mac OS X
We support the installation of Pinocchio through the Homebrew package manager. It is sufficient to write in Terminal:
brew tap gepetto/homebrew-gepetto
brew install pinocchio
It will install all the missing dependencies together with Pinocchio.
An alternative solution is to install Pinocchio either with robotpkg (see From robotpkg section for further details) or directly from sources (see From source section).
For Linux and Mac OS systems, Pinocchio is available on PyPI, and can be installed with its dependencies with:
python -m pip install pin
It is highly recommended to work in a virtual environment.
Pinocchio is available on conda forge, and can be installed with its dependencies with:
conda install pinocchio -c conda-forge
Pinocchio is available in ROS, and can be installed with its dependencies with:
sudo apt install ros-$ROS_DISTRO-pinocchio
Pinocchio is available in nixpkgs, and can be used with its dependencies with eg.:
nix-shell -p python3Packages.pinocchio
ref. https://search.nixos.org/packages?show=python312Packages.pinocchio
Pinocchio is available in AUR, and can be installed with your favorite AUR helper or:
git clone https://aur.archlinux.org/pinocchio.git
cd pinocchio
makepkg -i
ref. https://wiki.archlinux.org/title/Arch_User_Repository and: https://aur.archlinux.org/packages/pinocchio
Build with robotpkg
robotpkg is a package manager tailored for robotics softwares. It greatly simplifies the release of new versions along with the management of their dependencies.
Installation of robotpkg
robotpkg can be easily installed as a package manager on any Unix and BSD platforms. Please follow the installation procedure of robotpkg.
Installation of Pinocchio
Assuming that you have cloned robotpkg in $HOME
, you can directly move to the py-pinocchio
directory with cd
$HOME/robotpkg/math/py-pinocchio
. From here, make update
will try to build and install the latest release of Pinocchio and its dependencies in /opt/openrobots
.
The last thing you should do is configure the environment variables.
From source
This solution is the best choice if you want to work with the development version of Pinocchio or to contribute to the project with your fixes and improvements.
Dependencies
Pinocchio has only few required dependencies and some optional ones which add more features, making Pinocchio a versatile framework.
Required dependencies:
- Eigen3 for linear algebra. Version >= 3.0.5
- Boost with components filesystem, unit_test_framework and system. Version >= 1.34
Optional dependencies:
- Boost with component python. Version >= 1.34. Required for the python bindings.
- EigenPy An efficient binding between Numpy and Eigen using boost::python. Version >= 1.3.0. Required for the python bindings.
- HPP-FCL the Fast Collision Library. Version >= 0.4.1. Useful for collision detections.
- assimp for the reading of raw mesh files. Version >= 3.0.0.
- urdfdom for the reading of URDF models. Version >= 0.2.10.
Installation
- Clone the git repository:
git clone --recursive https://github.com/stack-of-tasks/pinocchio
- Switch between the master or the devel branch:
git checkout master
or
git checkout devel
- Move to pinocchio, create the build directory and move there:
cd pinocchio && mkdir build && cd build
- Source with cmake with Release mode and set your desired installation directory:
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
if you want to use another python version, please add -DPYTHON_EXECUTABLE=/usr/bin/python3
- Build the application:
make -j4
- Install pinocchio:
make install
Configure environment variables
All the packages will be installed in the CMAKE_INSTALL_PREFIX
path, setting by default to point to /usr/local
. To make use of installed libraries and programs, you must need to configure your PATH
, PKG_CONFIG_PATH
, PYTHONPATH
and other similar environment variables to point inside this directory. For instance:
export PATH=/usr/local/bin:$PATH
export PKG_CONFIG_PATH =/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
export CMAKE_PREFIX_PATH=/usr/local:$CMAKE_PREFIX_PATH
Please check the path you’re adding in PYTHONPATH. Depending on your system, it might use pythonX
or
pythonX.Y
, and site-packages
or dist-packages
.
You may directly add those lines to your $HOME/.bashrc
for a persistent configuration.