Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Combine ARCore SDK and Vuforia 7.2 in the same project

Discussion in 'Vuforia' started by Snake9, Aug 2, 2018.

  1. Snake9

    Snake9

    Joined:
    Nov 18, 2016
    Posts:
    27
    Hello,

    Since yesterday I'm trying to use both ARCore SDK and Vuforia 7.2 in a same Unity Project.
    My goal is to use Vuforia for Image Recognition (because it has better results than ARCore Image Recognition), and ARCore for planes detection in order to place objects on surfaces (like in Ikea Place). I want to use ARCore instead of Vuforia Ground Plane because I want to access to some ARCore sdk components provided by their package : plane generator, pointcloud visualizer, environmental lightning, etc...

    As you may know, in Unity's PlayerSettings/XR Settings, when we check both ARCore Supported and Vuforia Augmented Reality Supported, we have a warning message by Unity : "Both ARCore and Vuforia XR Device cannot be selected at the same time. Please select only one XR Device that will manage the Android device." (see attached file)

    I am using Unity 2018.1.6. After having updated Vuforia to 7.2.24 and imported ARCore unitypackage 1.3.0, and after some debugging to build the application (I had to apply some changes to AndroidManifest.xml), I finally success to combine both sdk in a same project.

    So I have a project with 3 scenes : the main scene with only 2 buttons permitting to load scene 1 or scene 2.
    scene 1 is the example HelloAR from ARCore package, with a back button to go back to the main scene.
    scene 2 is a basic Vuforia scene with only ARCamera and an ImageTarget, with back button too.
    In XRSettings, both ARCore and Vuforia are checked.

    And surprise : the application seems to work well, and I didn't expect that because of the red message from Unity specifying we don't have to select both ARCore and Vuforia in the same project. I can switch between the scenes and everything works as it should.

    So, I don't get why there is such a warning message from Unity. What can be the issues having both ARCore supported and Vuforia Augmented Reality supported in the same project ?
     

    Attached Files:

  2. LearningM

    LearningM

    Joined:
    Aug 31, 2018
    Posts:
    4
    It seems that you separate ARCore and Vuforia in different scenes.

    Did you combine them into one scene successfully?

    I am doing something similar as you, though Vuforia integrate ARCore in latest release, it seems
    we can't get the sdk component such as pointcloud visualizaer and environmental lighting at the same time.

    The problem I came across is that both Vuforia and ARCore has its own camera, how to combine them into one camera in the same scene.
     
    Last edited: Sep 6, 2018
  3. jarileon

    jarileon

    Joined:
    Jun 2, 2017
    Posts:
    76
    I am curious about this too. The current version of Vuforia does not support camera autofocus with ARCore (which in turn DOES support autofocus, Vuforia just havent got to implement it yet). So I figured that I would install ARCore SDK alongside Vuforia and use the ARCore SDK to set the camer to autofocus mode. But creating the ARSession in the scene where Vuforia was used resulted in error. So I guess its not possible to bypass Vuforia.
     
  4. Abd92

    Abd92

    Joined:
    Jan 4, 2016
    Posts:
    5
    hi, thank you for this information,
    could you please tell me what changes did you make to the AndroidManifest.xml file in order to combine both SDKs
     
  5. Abd92

    Abd92

    Joined:
    Jan 4, 2016
    Posts:
    5
  6. LearningM

    LearningM

    Joined:
    Aug 31, 2018
    Posts:
    4
    Vuforia seems to integrate arcore with it's own implementation, I can't get the sdk component from arcore. Similar to your test, creating the ARSession in the scene where enables Vuforia support leads to error. So far I have no idea how to integrate them and get the component from arcore.
     
  7. LearningM

    LearningM

    Joined:
    Aug 31, 2018
    Posts:
    4
  8. Abd92

    Abd92

    Joined:
    Jan 4, 2016
    Posts:
    5
    How about combine both SDKs in the same projects but in two different scenes as you did>?
    What changes should be done in the Android Manifest file
     
  9. Snake9

    Snake9

    Joined:
    Nov 18, 2016
    Posts:
    27
    Hi,
    Sorry, I didn't view your question.

    I could not combine ARCore and Vuforia in a same scene, but it works on 2 differents scenes : one scene for Vuforia and one scene for ARCore.

    Here is the AndroidManifest.xml I used :

    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest
    3.     xmlns:android="http://schemas.android.com/apk/res/android"
    4.     package="com.unity3d.player"
    5.     xmlns:tools="http://schemas.android.com/tools"
    6.     android:installLocation="preferExternal">
    7.     <supports-screens
    8.         android:smallScreens="true"
    9.         android:normalScreens="true"
    10.         android:largeScreens="true"
    11.         android:xlargeScreens="true"
    12.         android:anyDensity="true"/>
    13.  
    14.     <application
    15.         android:theme="@style/UnityThemeSelector"
    16.         android:icon="@drawable/app_icon"
    17.         android:label="@string/app_name">
    18.       <meta-data tools:replace="android:value" android:name="com.google.ar.core" android:value="required"/>
    19.       <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
    20.       <activity android:name="com.unity3d.player.UnityPlayerActivity"
    21.                   android:label="@string/app_name">
    22.             <intent-filter>
    23.                 <action android:name="android.intent.action.MAIN" />
    24.                 <category android:name="android.intent.category.LAUNCHER" />
    25.             </intent-filter>
    26.             <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    27.         </activity>
    28.     </application>
    29. </manifest>
    30.  
    Put it in Assets/Plugins/Android folder.

    Does anyone have more information about Vuforia and ARCore integration ?
     
    henriqueranj likes this.
  10. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    157
    Hello,

    I believe the Vuforia core samples on the Unity Asset store are probably the best reference for how to integrate Vuforia and ARCore. As long as ARCore is installed on the target device, and the device is supported by ARCore, then the samples and Vuforia's features can be run on device without modification.

    Thanks,
    Vuforia Engine Support
     
  11. Snake9

    Snake9

    Joined:
    Nov 18, 2016
    Posts:
    27
    Thank you for this info, I will try that as soon as possible !
     
  12. Snake9

    Snake9

    Joined:
    Nov 18, 2016
    Posts:
    27
    Hi again,

    meedabit, I tried the Vuforia Core samples as you suggested, but I didn't find a way to get ARCore sdk components such as PointCloud visualizer or Environmental Lightning or even ARCloud Anchor. That is why I wanted to use both ARCore unitypackage and Vuforia in one project.
     
  13. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    157
    Hello @Snake9,

    Not all ARCore features are exposed by Vuforia, only the ones that best drive primary SDK use cases.

    Thanks,
    Vuforia Engine Support