Visual Servoing Platform
version 3.6.1 under development (2024-11-16)
|
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.
brew install cmake
brew install python
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.
opencv-4.5.5-ios-framework.zip
<framework_dir>/ios
. If <framework_dir>
is for example the following folder $HOME/framework
just do the following: $ 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
opencv2.framework
to iPhoneOS existing frameworks $ cd `xcrun --sdk iphoneos --show-sdk-platform-path`/Developer/Library/Frameworks $ sudo ln -s ~/framework/ios/opencv2.framework
opencv2.framework
to iPhoneSimulator existing frameworks $ cd `xcrun --sdk iphonesimulator --show-sdk-platform-path`/Developer/Library/Frameworks $ sudo ln -s ~/framework/ios/opencv2.framework
xcrun
, check xcrun: error: SDK cannot be locatedHere 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
<framework_dir>
besides ios folder. $ ls $HOME/framework ios visp
$ cd $HOME/framework $ python3 visp/platforms/ios/build_framework.py ios
$HOME/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 $HOME/framework/ios/opencv2.framework
that should also be added to the Xcode project. $ 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.