How to link Pinocchio using GCC/G++

Pinocchio, which you can install using OpenRobots robotpkg (sudo apt -y install robotpkg-pinocchio once you have installed the repository), is split into a few different libraries:

Often, you will need multiple of those libraries

Additionally, since the OpenRobots libraries are located in /opt/openrobots/lib, you need to add this path to the linker search path using -L/opt/openrobots/lib.

Full example command:

g++ -o test test.cpp -lfranka -I/opt/openrobots/include  -lpinocchio_default -lpinocchio_parsers -L/opt/openrobots/lib