Visual Servoing Platform  version 3.6.1 under development (2024-12-17)
Tutorial: How to create an application that uses ViSP on NAOqi OS

We assume in this tutorial that you have successfully cross-compiled ViSP following Tutorial: Cross-compilation for NAOqi OS from Ubuntu host. The aim of this tutorial is to explain how to create an application that uses ViSP cross-build for NAOqi OS as third-party and how to run this application on Nao, Romeo or Pepper robots.

To illustrate this tutorial, we will consider all the examples that are provided in the tutorial dedicated to images (ie. the one located in visp/tutorial/image folder). If you are not familiar with ViSP read first Tutorial: How to create and build a project that uses ViSP and CMake on Unix or Windows.

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

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

Create a workspace for your project

We assume that as described in Tutorial: Cross-compilation for NAOqi OS from Ubuntu host, your workspace dedicated to visp contains the following folders:

$ ls $HOME/soft
visp-build-ctc-linux64-atom-2.4.3.28
Definition: vpIoTools.h:61

Create a new folder to host the project you want to run on NAOqi OS

$ mkdir $HOME/soft/tutorial

Copy existing tutorial/image folder from ViSP source code or download it from here https://github.com/lagadic/visp/tree/master/tutorial/image.

$ ls $HOME/soft/tutorial/image
CMakeLists.txt monkey.png tutorial-draw-text.cpp tutorial-image-manipulation.cpp
camera.xml monkey.ppm tutorial-event-keyboard.cpp tutorial-image-reader.cpp
chessboard.jpg tutorial-canny.cpp tutorial-export-image.cpp tutorial-image-viewer.cpp
drawingHelpers.cpp tutorial-draw-circle.cpp tutorial-image-colormap.cpp tutorial-undistort.cpp
drawingHelpers.h tutorial-draw-cross.cpp tutorial-image-converter.cpp tutorial-video-manipulation.cpp
memorial.pfm tutorial-draw-frame.cpp tutorial-image-display-scaled-auto.cpp tutorial-viewer.cpp
monkey.bmp tutorial-draw-line.cpp tutorial-image-display-scaled-manu.cpp
monkey.jpeg tutorial-draw-point.cpp tutorial-image-display.cpp
monkey.pgm tutorial-draw-rectangle.cpp tutorial-image-filter.cpp

Cross-build your project

Create first a build folder associated to your Cross Toolchain like:

$ cd $HOME/soft/tutorial
$ mkdir image-build-ctc-linux64-atom-2.4.3.28

Configure your project setting VISP_DIR and CMAKE_TOOLCHAIN_FILE respectively to ViSP and Cross Toolchain location:

$ cd image-build-ctc-linux64-atom-2.4.3.28
$ cmake ../image -DVISP_DIR=$HOME/soft/visp-build-ctc-linux64-atom-2.4.3.28/install/lib/cmake/visp -DCMAKE_TOOLCHAIN_FILE=$HOME/softbank/ctc-linux64-atom-2.4.3.28/toolchain.cmake

Cross-build your project:

$ make -j4

Install the binaries on NAOqi

First create an archive for the binaries:

$ tar cvzf binary.tar.gz --exclude "*Make*" --exclude "cmake*" *

Then copy the binaries to NAOqi OS:

$ scp binary.tar.gz nao@<your_robot_ip>:

Move the binaries to a more friend location like $HOME/tutorial:

$ ssh nao@<your_robot_ip>
nao~ $ mkdir tutorial
nao~ $ tar xvzf binary.tar.gz --directory tutorial
nao~ $ rm binary.tar.gz

Run the binaries:

nao~ $ cd tutorial
nao~ $ ./tutorial-image-manipulation
nao~ $ ./tutorial-undistort

You are now ready to create your own project for Nao, Romeo or Pepper robots.

Next tutorial

You are now ready to see the Tutorial: How to import a CMake project that uses ViSP in Eclipse IDE.