lagadic / visp

Open Source Visual Servoing Platform
https://visp.inria.fr/
GNU General Public License v2.0
725 stars 286 forks source link

İOS app with template tracking using Ogre3d #480

Open dpyheeau opened 5 years ago

dpyheeau commented 5 years ago

Hi, I’m trying to develop an iOS app with template tracking using Ogre3d (seen in the example https://www.youtube.com/watch?v=6IR9iomPF0E) I have no problem with template tracking part but facing problems with Ogre3d library. I downloaded both “OgreSDK“ and “iOSDependencies”, completed “Header Search Paths“ ve “Library Search Paths” configurations than tried to control whether “Ogre3d” library runs with the help of “HelloWorldOgre.cpp“ tutorial. Unfortunately, “xCode” cannot define “vpAROgre” object and returns error.

Alternatively, when I delete

ifdef VISP_HAVE_OGRE

condition in “ar/vpAROgre.h” class, in “visp3.framework”, than xCode defines object(vpAROgre) but this time getting errors in other areas. Therefore there needs to be a much more valid and correct methods.

I would glad if I can get any help addressing the use of Ogre3d in my issue. Any hint on a simple example like HelloWorldOgre.cpp for iOS would be highly appreciated.

fspindle commented 5 years ago

Your post is not clear.

What should be done first is to build Ogre from source for iOS. I tried and didn't succeed following the guide to building Ogre. I got cmake errors running:

$ cmake -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain/ios.toolchain.xcode.cmake -G Xcode .
CMake Error at CMakeLists.txt:45 (project):
  No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:45 (project):
  No CMAKE_CXX_COMPILER could be found.

I found some discussion, but didn't have time to investigate further on how to proceed. Moreover I don't know if essential and recommended dependencies need to be build first for iOS.

If you succeed building Ogre for iOS, the next step would be to build ViSP from source for iOS adapting this tutorial to ensure that Ogre framework is detected during cmake configuration. You should start to do exactly the same for ogre.framework than what is described for opencv2.framework in the Getting OpenCV framework section.

Now try to build ViSP from source for iOS following Building ViSP framework section.

Check if Ogre framework is detected running cmake using something similar to

$ cd ~/framework
$ python visp/platforms/ios/build_framework.py ios
$ cd ios/build/build-arm64-iphoneos
$ ccmake ../../../../visp

Here you should see USE_OGRE=ON

If you run the following and get yes it means also that Ogre is detected.

$ grep Ogre ~/framework/ios/build/build-arm64-iphoneos/ViSP-third-party.txt 
    Ogre simulator: 
    \- Use Ogre3D:               yes