![]() |
Visual Servoing Platform version 3.7.0
|
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 macOS Big Sur 11.6.2, with CMake 3.22.1, Xcode 13.2.1 and Python 2.7.16 or Python 3.9.9.
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.
$ mkdir -p $HOME/framework/iosIf the download was performed with Safari, do the following
$ mv $HOME/Downloads/opencv2.framework $HOME/framework/ios/or if the download was either performed with Firefox, do the following
$ unzip $HOME/Downloads/opencv-4.5.5-ios-framework.zip -d $HOME/framework/ios
$ cd `xcrun --sdk iphoneos --show-sdk-platform-path`/Developer/Library/Frameworks $ sudo ln -s ~/framework/ios/opencv2.framework
$ cd `xcrun --sdk iphonesimulator --show-sdk-platform-path`/Developer/Library/Frameworks $ sudo ln -s ~/framework/ios/opencv2.framework
Here the goal is to get ViSP source code in a directory denoted <framework_dir>. If <framework_dir> is for example the following folder $HOME/framework there are different ways to get ViSP:
$ cd $HOME/framework $ git clone https://github.com/lagadic/visp.git
$ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz -C $HOME/framework
$ tar xvzf visp-x.y.z.tar.gz -C $HOME/frameworkor
$ unzip visp-x.y.z.zip -d $HOME/framework
$ ls $HOME/framework ios visp
$ cd $HOME/framework $ python3 visp/platforms/ios/build_framework.py ios
$ ls $HOME/framework/ios build opencv2.framework visp3.framework
$ cd $HOME/framework $ python3 visp/platforms/ios/build_framework.py ios --iphoneos_deployment_target 11.0 --iphoneos_archs arm64 --build_only_specified_archs True
If you encounter the following issue:
$ cd `xcrun --sdk iphoneos --show-sdk-platform-path`/Developer/Library/Frameworks xcrun: error: SDK "iphoneos" cannot be located xcrun: error: SDK "iphoneos" cannot be located xcrun: error: unable to lookup item 'PlatformPath' in SDK 'iphoneos' -bash: cd: /Developer/Library/Frameworks: No such file or directory
It means that the Xcode command line tools are not installed.
Launch Xcode and go to Preferences, then Locations, and make sure the command line tools is set to the version of Xcode you’re using.
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.