Visual Servoing Platform  version 3.1.0
Tutorial: Installation from source for iOS devices

In this tutorial you will learn how to build ViSP framework from source on OSX in order to use it for iOS developments. These steps have been tested:

  • on OSX El Capitan 10.11.45 and 10.11.6, with CMake 3.5.2, Xcode 7.3.1 and 8.0, and Python 2.7.10
  • on OSX Sierra 10.12.5, with CMake 3.9.1, Xcode 8.3.3, and Python 2.7.10.
  • on OSX Sierra 10.12.6, with CMake 3.9.1, Xcode 9.0.1, and Python 2.7.10.
Note
Concerning ViSP installation, we provide also other Tutorials.

Install required software

  • CMake gui 2.8.12.2 for OSX or higher that could be download at : http://www.cmake.org
  • Xcode
  • Python 2.7 (not tested with Python 3)

Getting OpenCV framework (optional)

We suggest to follow these steps in order to install OpenCV framework in such a way that the resulting ViSP framework builds with OpenCV as 3rd party. This could be useful for users who want to use ViSP and OpenCV together. It will also allow to exploit keypoints throw ViSP classes (vpKltOpencv, vpKeyPoint) or the model-based tracker in his hybrid version (vpMbKltTracker). If you are not interested in capabilities leveraged by using OpenCV as 3rd party, just skip this section.

  • Download the latest OpenCV for iOS like opencv-3.3.1-ios-framework.zip
  • Unzip the archive in a directory denoted <framework_dir>/ios. If <framework_dir> is for example the following folder ~/framework just do the following:
    $ mkdir -p ~/framework/ios
    If the download was performed with Safari, do the following
    $ mv ~/Downloads/opencv2.framework ~/framework/ios/
    or if the download was either performed with Firefox, do the following
    $ unzip ~/Downloads/opencv-3.3.0-ios-framework.zip -d ~/framework/ios
  • Add opencv2.framework to iPhoneOS existing frameworks
    $ cd `xcrun --sdk iphoneos --show-sdk-platform-path`/Developer/Library/Frameworks
    $ sudo ln -s ~/framework/ios/opencv2.framework
  • Add opencv2.framework to iPhoneSimulator existing frameworks
    $ cd `xcrun --sdk iphonesimulator --show-sdk-platform-path`/Developer/Library/Frameworks
    $ sudo ln -s ~/framework/ios/opencv2.framework

Getting ViSP source code

Note
The following steps are only working with ViSP 3.0.1 or higher.

Here the goal is to get ViSP source code in a directory denoted <framework_dir>. If <framework_dir> is for example the following folder ~/framework there are different ways to get ViSP:

  • You can get the cutting-edge ViSP from GitHub repository using the following command
    $ cd ~/framework
    $ git clone https://github.com/lagadic/visp.git
  • You can also download a daily snapshot. Once downloaded, uncompress the file using
    $ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz -C ~/framework
  • Or you can download the latest release as a zip or a tarball. Once downloaded, uncompress the file using either
    $ tar xvzf visp-x.y.z.tar.gz -C ~/framework
    or
    $ unzip visp-x.y.z.zip -d ~/framework
  • We suppose now that ViSP source is in a directory denoted <framework_dir> besides ios folder.
    $ ls ~/framework
    ios visp

Building ViSP framework

  • Build ViSP framework
    $ cd ~/framework
    $ python visp/platforms/ios/build_framework.py ios
  • Once build, you will have ~/framework/ios/visp3.framework that could be added to a Xcode project for iOS devices. If you follow Getting OpenCV framework (optional) you have also ~/framework/ios/opencv2.framework that should also be added to the Xcode project.
    $ ls ~/framework/ios
    build opencv2.framework visp3.framework
Note
ViSP framework is build with capabilities that enables the usage of the following 3rd parties: XML, OpenCV, pthread, apriltag, lapack.

Next tutorial

You are now ready to see the next Tutorial: How to create a basic iOS application that uses ViSP that shows how to use ViSP as a 3rd party to build your own project for iOS devices.