Search Unity

Introducing ARCore: An Android AR SDK for Unity

Discussion in 'AR' started by matthewpruitt, Aug 28, 2017.

  1. matthewpruitt

    matthewpruitt

    Unity Technologies

    Joined:
    Sep 15, 2016
    Posts:
    13
    Google ARCore SDK preview for Unity requires Unity 2017.20b9 or later and Android API SDK v24 or higher.

    ARCore enables AR development for the Android ecosystem. With ARCore you can create brand new AR experiences for Android or extend existing applications to take advantage of ARCore’s features. To learn more about the features or how you can use ARCore with your Unity project, check out our Unity ARCore blog post.

    All the features supported are available via the ARCore SDK for Unity available today. ARCore requires the following:
    • Pixel, Pixel XL, or Samsung Galaxy S8 running Android 7.0 Nougat and above
    • Unity 2017.2.0b9 or later
    To get started please follow these steps:

    In Google’s Unity Getting Started Guide:
    1. Download and import the ARCore SDK for Unity package.
    2. Install the Google ARCore service on your target device.
    3. Make sure you also get a copy of HelloAR. It’s an easy to understand project that demonstrates the ARCore SDK and makes it easy for developers to quickly build and run their first app.
    Configure Unity for ARCore development:
    1. In the Player Settings (Edit > Project Settings > Player), select the Android options, then look under XR Settings and make sure “Tango Supported” is checked.

    2. Under Other Settings, but sure Multithreaded Rendering is unchecked and your Minimum API Level is at least API Level 24 (Android 7.0).​


    Start experimenting today and get ready to build AR experiences for millions of Android devices.

    Don’t forget to share your thoughts and ask questions on every aspect of Unity development for ARCore!
     
    pixiwill, Samssonart and mimminito like this.
  2. Samssonart

    Samssonart

    Joined:
    Dec 14, 2011
    Posts:
    25
    I recently got a Zenfone AR to play around with Tango, will it be able to run the Unity ARCore project?
     
  3. matthewpruitt

    matthewpruitt

    Unity Technologies

    Joined:
    Sep 15, 2016
    Posts:
    13
  4. IgniteAVteam

    IgniteAVteam

    Joined:
    Nov 26, 2013
    Posts:
    3
    Does it support Sumsung S6 or Galaxy note 4
     
  5. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    ARCore is not currently supported on the Zenfone.

    Sorry, only the Pixel, Pixel XL and Samsung Galaxy S8 are supported for now.
     
  6. Tenebris_Lab

    Tenebris_Lab

    Joined:
    May 23, 2017
    Posts:
    35
    Awesome. This will rattle a couple of things.
     
  7. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    48
    Can this preview be used on Samsung Galaxy S8 Plus – european version? Thanks
     
  8. rjevans

    rjevans

    Joined:
    Sep 24, 2010
    Posts:
    24
    Running on a pixel xl with 7.1.2, unity 2017.2b9 and the downloadable unitypackage from the google site and I'm getting a crash on start, below is the ddms logs. I double checked and I think all the settings on my project are correct, any suggestions?

     
    MrMallIronmaker likes this.
  9. GroenBoer

    GroenBoer

    Joined:
    Nov 30, 2014
    Posts:
    46
    Even though this looks great, I just want to point out that limiting this to two types of phones (for what reason?) is not accomplishing what is stated as a goal for the technology:
    "One of the biggest challenges that developers face is ensuring that their apps and experiences are available to the widest possible audience. To overcome this challenge, AR needs to work on hardware that users already own, such as mobile devices."
    This looks like a marketing tactic to force upgrades to new phones.
     
    zero4444 likes this.
  10. MrMallIronmaker

    MrMallIronmaker

    Joined:
    Jul 25, 2016
    Posts:
    5
    I'm getting a very similar error to rjevans, with the key line being
    > A/tango(11616): jni_helper.cc:19 'vm' Must be non NULL

    I've built both the Unity example on Windows and the Java example from Mac on a Samsung S8 with Nougat 7.0 and both fail similarly.

    However, the same programs [both the same Java program and the same Unity program] work with a Pixel running 7.1.2.
     
  11. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    @MrMallIronmaker @rjevans Does the startup crash happen consistently? I believe there is a known issue involving a race condition at startup.
     
  12. austastic

    austastic

    Joined:
    Sep 30, 2016
    Posts:
    1
    If you have a project where you've imported Unity's ARKit plugin, and then you import the ARCore package and you get a purple screen instead of a camera feed. Go into player settings and make sure to select 'auto graphics api' rather than OpenGLES2. This will resolve the issue.
     
    Last edited: Aug 30, 2017
    ATMEthan likes this.
  13. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    I don't believe it works on the S8 Plus yet. You can check the exact model numbers here: https://developers.google.com/ar/discover/
     
  14. MrMallIronmaker

    MrMallIronmaker

    Joined:
    Jul 25, 2016
    Posts:
    5
    @timmunity 10/10 tries on the S8 lead to failures, 10/10 tries on the Pixel worked. It doesn't seem all that likely to be a race condition issue.

    If it's useful data, we just bought the Samsung S8 today, while one of our teammates has had the Pixel for a while [since January].
     
  15. rjevans

    rjevans

    Joined:
    Sep 24, 2010
    Posts:
    24
    10/10 on pixel xl for me
     
  16. MrMallIronmaker

    MrMallIronmaker

    Joined:
    Jul 25, 2016
    Posts:
    5
    just sanity checking - that means it fails 10/10 tries, right?
     
  17. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Did you install the ARCore service on your phone using "adb install -r -d arcore-preview.apk" ?
     
  18. rjevans

    rjevans

    Joined:
    Sep 24, 2010
    Posts:
    24
    I had, but as a test I tried re-installing it and now things appear to be working. Thanks!
     
    jimmya likes this.
  19. MrMallIronmaker

    MrMallIronmaker

    Joined:
    Jul 25, 2016
    Posts:
    5
    I hadn't installed it, that's where I flaked on the instructions. Thanks @jimmya!
     
    jimmya likes this.
  20. bigbangtop

    bigbangtop

    Joined:
    Aug 30, 2017
    Posts:
    1
    I'm on my s8+ device to open ARCORE flashback, what's up Does the startup crash happen consistently?
     
    Last edited: Aug 30, 2017
  21. niscotine

    niscotine

    Joined:
    Jan 31, 2015
    Posts:
    3
    okay tested with ZenphoneAR and it doesnt work ( as expected but still had to try )
     
  22. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Note to Zenphone AR users: after installation on a Pixel XL, the ARCore APK shows up as "Tango Core". In other words, ARCore really is just a light-version of Tango, which you already have. Furthermore, as you can see in the instructions, targeting ARCore from Unity works exactly like targeting Tango.
     
  23. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Crashing on my S8+. Logs state its not supported on my device?
     
    saarwii likes this.
  24. saarwii

    saarwii

    Joined:
    Mar 7, 2014
    Posts:
    24
    Yes, please s8+ support, had planed my day around testing out the tools. big nope!
     
  25. kiriyee

    kiriyee

    Joined:
    Jan 23, 2012
    Posts:
    15
    Crashing on Samsung S7 (Android 7.0)
    08-30 12:47:46.733: E/Unity(7786): Unable to find AudioPluginMsHRTF
    08-30 12:47:46.734: E/Unity(7786): Unable to find libaudioplugingvrunity
    08-30 12:47:46.734: E/Unity(7786): Unable to find AudioPluginOculusSpatializer
    08-30 12:47:46.735: E/Unity(7786): Unable to find audioplugingvrunity
    08-30 12:47:46.735: E/Unity(7786): Unable to find unitygar
    08-30 12:47:46.736: E/Unity(7786): Unable to find libAudioPluginOculusSpatializer
    08-30 12:47:46.737: E/Unity(7786): Unable to find libtango_3d_reconstruction_api
     
  26. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    S7 isn't supported.
    Looks like no one is actually reading the supported devices section. However I think that supporting more then S8 and Pixel phones would be nice for the beta as people who have an S7 aren't upgrading to S8 as the S7 it just powerful enough.
     
  27. Verm

    Verm

    Joined:
    Oct 23, 2014
    Posts:
    1
    Works fine in Samsung S8 (European version), the result is actually really close to the promo videos....
     
    Last edited: Aug 30, 2017
  28. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Ok, I mistook S8 support as it would support the S8+. It doesnt, which sucks. Let's hope they open up the preview to more devices soon.
     
  29. spagyric

    spagyric

    Joined:
    May 18, 2017
    Posts:
    4
    I have tried launching it on my S8+ a few times and I get the same message: "This phone does not support ARCore".
     
  30. kushG

    kushG

    Joined:
    May 25, 2017
    Posts:
    22
    Is there any support for Unity remote for ArCore(like ArKit) or in future? Any documentation available for the below Tracked Pose Driver?
     

    Attached Files:

    chantey, Beloudest and YohanB like this.
  31. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Not yet, but it's something we'd like to do. I know that it's an extremely useful feature that would provide a huge benefit.

    The scripting API docs for the TrackedPoseDriver are here: https://docs.unity3d.com/2017.2/Documentation/ScriptReference/SpatialTracking.TrackedPoseDriver.html which should be a good start. No manual docs yet, so let me know if you have any questions.
     
    chantey and kushG like this.
  32. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    S8+ is not supported during the initial preview, but more phones will be announced later. Check https://developers.google.com/ar/discover/ for exact model numbers of currently supported devices.
     
  33. kushG

    kushG

    Joined:
    May 25, 2017
    Posts:
    22
    To which object is the latest Pose applied to ? I tried printing out ARCore Device's position and rotation but they are all zeroes. When I move with the phone in my hand am I suppose to read the Frame.Pose to get my latest pose in physical world ?
     
  34. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    The pose is applied to the GameObject on which you put the TrackedPoseDriver. The TPD drives the GameObject using a similar logic to what Frame.Pose does, so it shouldn't be necessary to call Frame.Pose manually. If you're getting all zeros out then it sounds like ARCore either hasn't been initialized or tracking was lost. Is there info in the console? You could also use adb logcat from the command line for more information.
     
  35. spagyric

    spagyric

    Joined:
    May 18, 2017
    Posts:
    4
    Will ARCore work with 2D or just 3D objects?
     
  36. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Sorry, I'm not quite sure what you're asking. Can you explain what you'd like to do?
     
  37. kushG

    kushG

    Joined:
    May 25, 2017
    Posts:
    22
    08-30 17:09:25.015 11126-12167/? D/tango_tracker: tracker timeout
    08-30 17:09:25.116 11126-12167/? D/tango_tracker: tracker timeout
    08-30 17:09:25.217 11126-12167/? D/tango_tracker: tracker timeout
    08-30 17:09:25.323 11126-12167/? D/tango_tracker: tracker timeout
    08-30 17:09:25.423 11126-12167/? D/tango_tracker: tracker timeout
    08-30 17:09:25.484 11126-11141/? E/tango: TangoService.cc:320 Unable to connect to Tango because service is in a non-IDLEstate. There may be an existing client holding the connection. state = RUNNING
    08-30 17:09:25.486 15477-15496/? W/System.err: com.google.atap.tangoservice.TangoErrorException
    08-30 17:09:25.486 15477-15496/? W/System.err: at com.google.atap.tangoservice.Tango.throwTangoExceptionIfNeeded(Tango.java:1533)
    08-30 17:09:25.486 15477-15496/? W/System.err: at com.google.atap.tangoservice.Tango.connect(Tango.java:783)
    08-30 17:09:25.486 15477-15496/? W/System.err: at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    08-30 17:09:25.486 15477-15496/? W/System.err: at com.unity3d.player.UnityPlayer.c(Unknown Source)
    08-30 17:09:25.486 15477-15496/? W/System.err: at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
    08-30 17:09:25.486 15477-15496/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98)
    08-30 17:09:25.486 15477-15496/? W/System.err: at android.os.Looper.loop(Looper.java:154)
    08-30 17:09:25.486 15477-15496/? W/System.err: at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
    08-30 17:09:25.486 15477-15496/? E/Unity: Failed to connect to the Tango service with error code: -1



    I don't totally understand this error.
     
  38. kushG

    kushG

    Joined:
    May 25, 2017
    Posts:
    22
    Nvm, somehow the app installed by "adb install -r -d arcore-preview.apk" went missing and so the error. Running the command again fixed the issue
     
  39. spagyric

    spagyric

    Joined:
    May 18, 2017
    Posts:
    4
    Just wondering if it will work with 2d models, like CharacterRobotBoy in the standard assets pack 2D prefabs folder.
     
  40. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    ARCore is mostly about 6dof motion tracking of the phone and environmental awareness: detection of features in the real world, e.g. planes. The assets you choose to use in your scene shouldn't really matter. So if I'm understanding your question, then the answer is "yes" because ARCore isn't relevant to the type of assets you use.

    Sorry if I'm not understanding your question; I'm just not sure what it means for 2d models to "work with" ARCore, since one is a graphical asset in your scene and the other is a technology for sensor fusion. It sounds a bit like asking if a particular model will work with a keyboard, for example.
     
  41. zzajac

    zzajac

    Joined:
    Feb 20, 2015
    Posts:
    22
    Is it available also on front camera?
     
  42. Cromfeli

    Cromfeli

    Joined:
    Oct 30, 2014
    Posts:
    202
    So what you are trying to say is that Tango HW platform as such is now abandoned?

    So targeting Lenovo or Asus Tango HW is not anymore supported.
     
  43. Srewac

    Srewac

    Joined:
    Aug 31, 2017
    Posts:
    1
    So, when we move the phone too much, we lost the planes. Sometimes the planes get back,along with the GameObjects anchored on it, sometimes it don't. My question is how do we know whether the plane is gone for good? And how can we keep the GameObject in the right place?
     
    Last edited: Aug 31, 2017
  44. ashmad1411

    ashmad1411

    Joined:
    Aug 22, 2017
    Posts:
    1
    can we import this Arcore project to IOS devices which are running on IOS 11
     
  45. YuriiTkachenko

    YuriiTkachenko

    Joined:
    Mar 25, 2015
    Posts:
    4
    Hi all, I connect ARCore to my project and that works! You can see that here
    . But, I have a question. How I can change speed of camera movement. Because my scene is really big and I put it very far from camera. So I can't walk around the battleground, because it's very far from me. And I can't scale my battleground, because there is a lot of stuffs, particles and other.
     
  46. jack1mason

    jack1mason

    Joined:
    Jul 23, 2017
    Posts:
    2
    Being a Terminal-challenged, I found out that I had to add the path to adb to get the installation step to work:

    ~/Library/Android/sdk/platform-tools/adb install -r -d arcore-preview.apk

    Also, when I went to the Build & Run final step, I discovered I didn't have the Java SDK installed either, which seems to be a requirement as well.

    But I did get my Mac working with the Pixel and the sample project installed. What can I try next?


     
  47. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Hi @timmunity , are you guys planning to release more code samples soon? That would be super-helpful at this stage I think. While the motion tracking and light estimation seem pretty straightforward, I'd like to see especially more samples on environment understanding. For instance:
    • How to track multiple planes
    • How to gracefully handle planes that have shrunk
    • How to gracefully handle planes that disappeared, or that suddenly moved their center by a large amount
    Other areas where samples & guidelines would be appreciated (IMO) are:
    • Switching in and out of AR-mode (from 'standard mobile' mode)
    • Guiding the user through the initial environment scan
    • Designing AR-friendly UI
    • In general, making the whole AR experience as robust as possible from a UX point of view
    PS: If other people have more suggestions, speak up! ^^
     
    chantey and stigsfoot like this.
  48. pgeorges-dpt

    pgeorges-dpt

    Joined:
    Apr 7, 2016
    Posts:
    43
    Great work guys! Looking very forward to ARKit supporting the Unity XR interface the same way ARCore does so that all this can be normalized.

    A couple of questions for you guys:
    • Does ARCore implement a <uses-feature> tag in the AndroidManifest that we can latch onto in order to dispatch different APKs (one for higher end devices that uses ARCore, another for lower end devices that uses a hack of GoogleVR for gyro-style AR) on the Google Play Store? If not, can you suggest another way to direct an ARCore build to specific devices and a non-ARCore build to other devices?
    • Is there a way to detect if the ARCore Service is installed or not?
    • When can ARCore enabled apps be submitted to the Google Play Store?
    • Is it possible to use GoogleVR (for spatialized audio) and ARCore together? Here's my crash log:

     
    WendelinReich likes this.
  49. kushG

    kushG

    Joined:
    May 25, 2017
    Posts:
    22
    Is there a way of getting the rotation value (from Tracked Pose Driver) with respect to Magnetic North ? Right now, if I'm not wrong, I'm getting a relative rotation based on where you start.
     
    Last edited: Aug 31, 2017
  50. arjunkaul

    arjunkaul

    Joined:
    Aug 31, 2016
    Posts:
    1
    Does anyone have a recommendation for recording video from ARCore apps? Basically how ReplayKit works on iOS, but for Android instead. I have been struggling how to accomplish this in Unity