Skip to content
Snippets Groups Projects
README.md 2.5 KiB
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
# Benchmarking Pinocchio

## Setup your environment

You need both eigen2 (for KDL) and eigen3 (for RBDL & Pinocchio):
```
sudo apt install -qqy libeigen{2,3}-dev
```

You have to choose the `PREFIX` in which you want to install Pinocchio, RBDL & KDL:


```
export PREFIX=$PWD/prefix  # with bash / zsh
Guilhem Saurel's avatar
Guilhem Saurel committed
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
Guilhem Saurel's avatar
Guilhem Saurel committed
# OR
set -x PREFIX $PWD/prefix  # with fish
Guilhem Saurel's avatar
Guilhem Saurel committed
set -x LD_LIBRARY_PATH $PREFIX/lib:$LD_LIBRARY_PATH
Guilhem Saurel's avatar
Guilhem Saurel committed
```

## Pinocchio

### Downloading

If you did not clone this repository with the `--recursive` options, you will have to get the submodules with:
```
git submodule update --init --recursive
```

### Installing

```
mkdir -p build/pinocchio
pushd build/pinocchio
Guilhem Saurel's avatar
Guilhem Saurel committed
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_PYTHON_INTERFACE=OFF -DBUILD_UNIT_TESTS=OFF ../../libs/pinocchio
Guilhem Saurel's avatar
Guilhem Saurel committed
make -j8 install
Guilhem Saurel's avatar
Guilhem Saurel committed
popd
```

## KDL

### Installing

```
mkdir -p build/kdl
pushd build/kdl
Guilhem Saurel's avatar
Guilhem Saurel committed
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_INSTALL_LIBDIR=lib ../../libs/kdl/orocos_kdl
Guilhem Saurel's avatar
Guilhem Saurel committed
make -j8 install
Guilhem Saurel's avatar
Guilhem Saurel committed
popd
```

## RBDL

### Downloading

RBDL uses mercurial, and git-hg can't clone it, so we can't provide a git submodule, and you have to download it:

```
wget https://bitbucket.org/rbdl/rbdl/get/default.zip
unzip default.zip
rm default.zip
mv rbdl-rbdl-* libs/rbdl
```

### Installing

```
mkdir -p build/rbdl
pushd build/rbdl
Guilhem Saurel's avatar
Guilhem Saurel committed
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DRBDL_BUILD_ADDON_URDFREADER=ON ../../libs/rbdl
make -j8 install
popd
```

## Google Benchmark

### Installing

```
mkdir -p build/google-benchmark
pushd build/google-benchmark
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DBENCHMARK_ENABLE_GTEST_TESTS=OFF ../../benchmark
Guilhem Saurel's avatar
Guilhem Saurel committed
make -j8 install
Guilhem Saurel's avatar
Guilhem Saurel committed
popd
```

## Benchmarks

### Installing

```
Guilhem Saurel's avatar
Guilhem Saurel committed
mkdir -p build/pinocchio-benchmarks
pushd build/pinocchio-benchmarks
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_PREFIX_PATH=$PREFIX ../..
Guilhem Saurel's avatar
Guilhem Saurel committed
make -j8 install
Guilhem Saurel's avatar
Guilhem Saurel committed
popd
```
Guilhem Saurel's avatar
Guilhem Saurel committed

### Running

```
./prefix/bin/rbdl-bench models/simple_humanoid.urdf
./prefix/bin/rbdl-bench models/romeo/romeo_description/urdf/romeo.urdf
Guilhem Saurel's avatar
Guilhem Saurel committed
./prefix/bin/pinocchio-bench models/simple_humanoid.urdf
./prefix/bin/pinocchio-bench models/romeo/romeo_description/urdf/romeo.urdf
sudo cpupower frequency-set --governor performance
./prefix/bin/pinocchio-benchmark
./prefix/bin/rbdl-benchmark
sudo cpupower frequency-set --governor powersave
Guilhem Saurel's avatar
Guilhem Saurel committed
```