Visual Servoing Platform  version 3.3.0 under development (2020-02-17)
Tutorial: Cross-compilation for NAOqi OS from Ubuntu host

This tutorial summarizes how to cross-compile ViSP from source using NAOqi atom cross toolchain provided by SoftBank Robotics for Nao, Romeo or Pepper robots. The aim of this cross-compilation is then to use the cross-build resulting ViSP libraries on these robots.

This tutorial was tested on an Ubuntu 14.04 LTS host computer with:

  • Cross Toolchain 2.3.1 Linux 64 (ctc-linux32-atom- on Romeo robot
  • Cross Toolchain 2.4.3 Linux 64 (ctc-linux64-atom- on Pepper robot

Install cross toolchain

Download the cross-toolchain that is compatible with your robot from Depending on the robot the version of the cross toolchain might change.

In this tutorial we will illustrate how to build ViSP for Pepper with ctc-linux64-atom- cross toolchain.

Create a workspace that contains the cross toolchain:

$ mkdir $HOME/softbank

and unzip the toolchain:

$ cd $HOME/softbank
$ unzip

Get ViSP source code

Cross-compilation capabilities are fully supported since ViSP 3.0.1 release.

Create first a workspace dedicated to ViSP:

$ mkdir $HOME/soft

There are different ways to get ViSP source code in this workspace:

  • You can download a ViSP sources daily snapshot. Once downloaded, uncompress the file using
    $ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz --directory $HOME/soft
  • Or you get the cutting-edge ViSP from GitHub repository using the following command
    $ cd $HOME/soft
    $ git clone
  • Or you can download the latest release (should be at least 3.0.1) as a zip or a tarball. Once downloaded, uncompress the file using either
    $ tar xvzf visp-x.y.z.tar.gz --directory $HOME/soft
    $ unzip -d $HOME/soft

We suppose now that ViSP source is in a directory denoted <source_dir>, for example $HOME/soft/visp

Cross-compiling ViSP from source

  • Create first a directory denoted <binary_dir> where you want to cross-compile ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries that could be later used on the Raspberry Pi.
    $ mkdir $HOME/soft/visp-build-ctc-linux64-atom-
  • Enter <binary_dir> and configure the build:
    $ cd $HOME/soft/visp-build-ctc-linux64-atom-
    $ cmake -DCMAKE_TOOLCHAIN_FILE=$HOME/softbank/ctc-linux64-atom- ../visp
    To speed up the cross-compilation build step, you can turn off the build of the demos, examples, tests and tutorials using the following command:
  • At this step, the following third-parties should be found: OpenCV, v4l2, libjpeg, libpng, pthread, zbar. This could be checked in ViSP-third-party.txt file where the you should find something similar to:
    $ more ViSP-third-party.txt
    OpenCV : yes
    Video For Linux Two : yes
    libjpeg : yes
    libpng : yes
    pthread : yes
    zbar : yes
    zbar third-party is available with Cross Toolchain 2.3.1 Linux 64 (ctc-linux32-atom- This library is not present in Cross Toolchain 2.4.3 Linux 64 (ctc-linux64-atom-
  • Cross-compile ViSP
    $ make -j4 install

The resulting installation is available in $HOME/soft/visp-build-ctc-linux64-atom-

Install ViSP on NAOqi OS

The result of the cross-compilation could then be installed on Nao, Romeo or Pepper robot running NAOqi OS.

  • Copy the cross-build installation to Nao, Romeo or Pepper target:
    $ tar cvzf install.tar.gz install
    $ scp -r install.tar.gz nao@<your_robot_ip>:
  • Install ViSP: First move the libraries that were cross-build to a more friend location like $HOME/visp.
    $ ssh nao@<your_robot_ip>
    nao~ $ tar xvzf ~/install.tar.gz
    nao~ $ mv install visp
    nao~ $ rm ~/install.tar.gz
  • Add to LD_LIBRARY_PATH environment var the path to ViSP libraries:
    nao~ $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/visp/lib

Next tutorial

You are now ready to see the next Tutorial: How to create an application that uses ViSP on NAOqi OS that explains how to use ViSP as a 3rd party to build your own project on NAOqi OS for Nao, Romeo or Pepper robots.