Visual Servoing Platform
version 3.6.1 under development (2024-12-17)
|
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:
ctc-linux32-atom-2.3.1.23
) on Romeo robotctc-linux64-atom-2.4.3.28
) on Pepper robotDownload the cross-toolchain that is compatible with your robot from https://developer.softbankrobotics.com/. 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-2.4.3.28
cross toolchain.
Create a workspace that contains the cross toolchain:
$ mkdir $HOME/softbank
and unzip the toolchain:
$ cd $HOME/softbank $ unzip ctc-linux64-atom-2.4.3.28.zip
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:
$ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz --directory $HOME/soft
$ cd $HOME/soft $ git clone https://github.com/lagadic/visp.git
$ tar xvzf visp-x.y.z.tar.gz --directory $HOME/softor
$ unzip visp-x.y.z.zip -d $HOME/soft
We suppose now that ViSP source is in a directory denoted <source_dir>
, for example $HOME/soft/visp
<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-2.4.3.28
<binary_dir>
and configure the build: $ cd $HOME/soft/visp-build-ctc-linux64-atom-2.4.3.28 $ cmake -DCMAKE_TOOLCHAIN_FILE=$HOME/softbank/ctc-linux64-atom-2.4.3.28/toolchain.cmake ../visp
$ cmake -DCMAKE_TOOLCHAIN_FILE=$HOME/softbank/ctc-linux64-atom-2.4.3.28/toolchain.cmake ../visp -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DQI_WITH_TESTS=OFF
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-2.3.1.23
). This library is not present in Cross Toolchain 2.4.3 Linux 64 (ctc-linux64-atom-2.4.3.28
).$ make -j4 install
The resulting installation is available in $HOME/soft/visp-build-ctc-linux64-atom-2
.4.3.28.
The result of the cross-compilation could then be installed on Nao, Romeo or Pepper robot running NAOqi OS.
$ tar cvzf install.tar.gz install $ scp -r install.tar.gz nao@<your_robot_ip>:
$HOME/visp
. $ ssh nao@<your_robot_ip> nao~ $ tar xvzf ~/install.tar.gz nao~ $ mv install visp nao~ $ rm ~/install.tar.gz
LD_LIBRARY_PATH
environment var the path to ViSP libraries: nao~ $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/visp/lib
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.