Make sure you already have the following dependencies:
sudo apt install build-essential cmake git libpoco-dev libeigen3-dev ros-humble-pinocchio ros-humble-kinematics-interface-pinocchio
Create a directory as the one suggested and cd to it:
mkdir -p ~/local/src/repos/franka_emika
cd ~/local/src/repos/franka_emika
Then download the source code by cloning libfranka from GitHub:
git clone --recursive https://github.com/frankaemika/libfranka
cd libfranka
By default, this will check out the newest release of libfranka. To use the robot available at the lab, we have to build an older compatible version:
git submodule update
In the libfranka directory, create a build directory and run CMake:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF ..
cmake --build . -j$(nproc)
A libfranka Debian package can be built using the following command:
cpack -G DEB
sudo dpkg -i libfranka-*.deb
This creates libfranka--.deb.