Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    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. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Don't miss out on the Unite LA Keynote for the latest information from Unity! Set a reminder!
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Introducing ARCore: An Android AR SDK for Unity

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

  1. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    733
    arjunkaul likes this.
  2. luisforque

    luisforque

    Joined:
    Nov 25, 2014
    Posts:
    8
    Hello.
    I am working with a S8.

    I am having such problem:

    02-07 17:55:14.036: E/Unity(13088): OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range
    02-07 17:55:14.036: E/Unity(13088):
    02-07 17:55:14.036: E/Unity(13088): (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 368)

    it keeps popping on the log endlessly, including on the HelloAR sample project.
    Do anyone know why?

    Thank you.


    edit: Now I found the post https://forum.unity3d.com/threads/arcore-opengl-native-plug-in-error-gl_invalid_enum-error.491861/
     
  3. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    185
    I'm using AZ Screen Recorder, haven't had a problem...
     
    arjunkaul likes this.
  4. roycn

    roycn

    Joined:
    Dec 24, 2013
    Posts:
    7
    Please Help me!

    DllNotFoundException: tango_client_api2
    GoogleARCoreInternal.TangoClientApi.TangoService_IsSupported (System.Boolean& isSupported) (at Assets/GoogleARCore/SDK/Scripts/Api/TangoClientApi.cs:125)
    GoogleARCore.SessionComponent.Connect (GoogleARCore.SessionConfig sessionConfig) (at Assets/GoogleARCore/SDK/Scripts/SessionComponent.cs:166)
    GoogleARCore.SessionComponent.Connect () (at Assets/GoogleARCore/SDK/Scripts/SessionComponent.cs:145)
    GoogleARCore.SessionComponent.Awake () (at Assets/GoogleARCore/SDK/Scripts/SessionComponent.cs:96)
    DllNotFoundException: tango_client_api2
    GoogleARCoreInternal.TangoClientApi.CallsToConnectWithoutMatchingDisconnect () (at Assets/GoogleARCore/SDK/Scripts/Api/TangoClientApi.cs:130)
    GoogleARCore.SessionComponent+<_AttemptRecoverIfInvalidState>c__Iterator0.MoveNext () (at Assets/GoogleARCore/SDK/Scripts/SessionComponent.cs:306)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    GoogleARCore.SessionComponent:Awake() (at Assets/GoogleARCore/SDK/Scripts/SessionComponent.cs:92)
     
  5. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    733
    Read previous posts.
     
  6. Samssonart

    Samssonart

    Joined:
    Dec 14, 2011
    Posts:
    25
    Apologies if this is off-topic but I couldn't find a better thread to ask. Using 2017.2.0b9 to build the Tango demos on a Tango-enabled device. If I check the Tango enabled box in XR settings the build fails with this error:
    Code (Boo):
    1. CommandInvokationFailure: Unable to convert classes into dex format.
    2. /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/samssonart/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
    3.  
    4. stderr[
    5. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tango/TangoClientLibLoader;
    6. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tango/TangoJNINative;
    7. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tangohelperlib/BuildConfig;
    8. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tangoservice/Tango;
    9. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tangoservice/Tango$1;
    10. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tangoservice/Tango$OnFrameAvailableListener;
    11. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tangoservice/Tango$OnTangoUpdateListener;
    12. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tangoservice/TangoAreaDescriptionMetaData;
    13. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/atap/tangoservice/TangoAreaDescriptionMetaData$1;
    From what I understand it means that the Tango library is being added twice, but if I don't check the box the build finishes successfully but the app crashes on startup. Thoughts?
     
  7. momo_the_monster

    momo_the_monster

    Joined:
    Sep 3, 2014
    Posts:
    11
    Is there any supported way to get the pass-through Camera texture? I'm hoping to pull colors from specific pixels.
    I've tried accessing the texture through the backgroundRender property on the SessionComponent - I can get this but I can't get any non-null texture from its backgroundMaterial or its backgroundTexture.
     
    WendelinReich likes this.
  8. scylove1989

    scylove1989

    Joined:
    Dec 18, 2015
    Posts:
    1
    Can't Google ARCore Detect Vertical Planes?
     
    luisforque likes this.
  9. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    185
    From the docs: "In addition to identifying key points, ARCore can detect flat surfaces, like a table or the floor, and can also estimate the average lighting in the area around it."

    It'll come though. The feature detection system actually just detects points, and it's further up the hierarchy that these points are recognized as belonging to things like walls or planes or chairs. You get access to the point cloud via the (Java) API, so you (or anyone) could build such a tool yourself in the meantime...
     
  10. tellemstevedave

    tellemstevedave

    Joined:
    Jul 15, 2013
    Posts:
    18
    Got the Hello AR app working on my pixel phone.

    Does anyone know if there is a way to test things in the editor instead of making a build every time?

    When I press play I get two exceptions about "DllNotFoundException: tango_client_api2"
     
    Vincent_ likes this.
  11. andrzej_

    andrzej_

    Joined:
    Dec 2, 2016
    Posts:
    9
    On a S8+ I get This device does not support ARCore
    Android 7.0
     
  12. roundham

    roundham

    Joined:
    Oct 28, 2014
    Posts:
    43
    I can build and run the HelloAR app on my Pixel phone but its just stuck on "searching for surfaces...". Anyone else have this problem?
     
  13. mdurand

    mdurand

    Unity Technologies

    Joined:
    Aug 1, 2016
    Posts:
    17
    The ARCore APIs set the origin to pose of the device at the time the connection to the service is made and all pose information is passed through the tracked pose driver relative to that local origin using computer vision algorithms rather than compass data. Fortunately, you can calculate this pretty easily by bypassing the tracked pose driver and calling the ARCore API for getting rotation and the Unity compass API.

    https://developers.google.com/ar/re..._1_1_frame_1ab247cbc7cd6abcec0f68f3857634e912

    https://docs.unity3d.com/ScriptReference/Compass-trueHeading.html
     
  14. mdurand

    mdurand

    Unity Technologies

    Joined:
    Aug 1, 2016
    Posts:
    17
    Only the Pixel 2016 and S8 are supported by ARCore at this time. S8+ plus in not, unfortunately.
     
  15. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    733
    You are in a place where there is enough light, and there are horizontal flat surfaces with discernible features on them? Otherwise it will keep looking for a flat surface.
     
    roundham likes this.
  16. roundham

    roundham

    Joined:
    Oct 28, 2014
    Posts:
    43
    If there is a lot of stuff on a horizontal flat surface like a desk with papers and office supplies, would that throw off arcore?
     
  17. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    180
    I've tried on a very messy desk and it tends to work okay. In general, there needs to be enough light and enough features to detect a plane. My desk has a wood grain, which provides an excellent high-frequency pattern.

    Do you see any points (blue dots) from the point cloud being drawn over the surface you're trying to detect?
     
  18. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    180
    Not currently, but we are working on a remoting feature which would allow you to stream data from your phone and test it in the Editor. This would allow you to iterate quickly within the Editor without having to redeploy each time.
    This is really great feedback, thanks! We're continuing to work with Google to make the developer experience better, so please the keep the feedback coming.

    Regarding
    I guess it depends on what you're trying to do with the planes exactly. For example, are you scaling your content to fit within the plane and wondering how to change the scene accordingly?
     
    WendelinReich likes this.
  19. jleung15

    jleung15

    Joined:
    Mar 27, 2017
    Posts:
    3
    I am having the same issue, i am running Unity 2017.2 b10 and building to a Google Pixel. App starts up fine, but the "Searching for surfaces..." bar stays on. I am in a well lit room with hardwood floors, I've tried looking at do not see any surface detection.
     
  20. jleung15

    jleung15

    Joined:
    Mar 27, 2017
    Posts:
    3
    I've taken a look at my logs and get the following error:

    09-05 18:39:05.123 23471 23486 E Unity : MissingMethodException: Method not found: 'UnityEngine.XR.Tango.TangoInputTracking.add_trackingAcquired'.

    09-05 18:39:05.123 23471 23486 E Unity :

    09-05 18:39:05.123 23471 23486 E Unity : Rethrow as TypeInitializationException: An exception was thrown by the type initializer for GoogleAR.UnityNative.InputTracking

    09-05 18:39:05.123 23471 23486 E Unity : at GoogleARCoreInternal.MotionTrackingManager.TryGetLatestPose (UnityEngine.Pose& pose, System.Double& timestamp) [0x00000] in <filename unknown>:0

    09-05 18:39:05.123 23471 23486 E Unity : at GoogleARCore.Frame.get_TrackingState () [0x00000] in <filename unknown>:0

    09-05 18:39:05.123 23471 23486 E Unity : at GoogleARCoreInternal.AnchorManager.EarlyUpdate () [0x00000] in <filename unknown>:0

    09-05 18:39:05.123 23471 23486 E Unity : at GoogleARCoreInternal.SessionManager.EarlyUpdate () [0x00000] in <filename unknown>:0

    09-05 18:39:05.123 23471 23486 E Unity : at GoogleARCore.SessionComponent.Update () [0x00000] in <filename unknown>:0

    09-05 18:39:05.123 23471 23486 E Unity :

    09-05 18:39:05.123 23471 23486 E Unity : (Filename: Line: -1)

    09-05 18:39:05.123 23471 23486 E Unity :
     
  21. Jopan

    Jopan

    Joined:
    Jan 22, 2013
    Posts:
    11
    I was having the exact same issue as you. I just downgraded to Unity 2017.2.0b9 and it worked.
     
  22. andrzej_

    andrzej_

    Joined:
    Dec 2, 2016
    Posts:
    9
    Well .... that's a bit of a surprise since it's basically the same phone, with the exact same specs.

    I found this workaround:
    https://github.com/tomthecarrot/arcore-for-all
    But after including the aar file I get errors on build.
     
    fathahnoor likes this.
  23. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    185
    Will do.

    I'm currently working on a game that will offer AR as an optional mode. For this, I need to switch to the AR camera from inside an existing (but otherwise empty) scene, open an ARcore session, do AR stuff, and then cleanly end the session, switch back to the normal scene camera and place assets in the non-AR scene again.

    Could you tell me the 'correct' way of doing this, so that I don't accidentally create memory leaks or leave the camera running and consuming battery?
     
  24. jaazee

    jaazee

    Joined:
    Aug 2, 2017
    Posts:
    2
    XL setting is not available under android option.
    Any suggestion...???
     
  25. jaazee

    jaazee

    Joined:
    Aug 2, 2017
    Posts:
    2
    Error: Assets/GoogleARCore/SDK/Scripts/Managers/AnchorManager.cs(27,36): error CS0234: The type or namespace name `XR' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?
     
  26. MM_Elliot

    MM_Elliot

    Joined:
    Aug 30, 2017
    Posts:
    2
    Hey guys! Has anyone here tried shadows yet? I'm trying to figure out how to go about it!
     
  27. roundham

    roundham

    Joined:
    Oct 28, 2014
    Posts:
    43
    Thank you! It always seems to be the solution.
     
  28. jleung15

    jleung15

    Joined:
    Mar 27, 2017
    Posts:
    3
    This seems to have worked for me too, thanks for the help!
     
  29. ezonecom

    ezonecom

    Joined:
    Jul 23, 2013
    Posts:
    15
    Shadows are working great. Just use the included 'shadowPlaneMaterial' on any invisible plane you want to cast shadows onto.
     
  30. smart0318

    smart0318

    Joined:
    Sep 7, 2017
    Posts:
    2
    which posts?can you tell me?I have the same question.thank you !
     
  31. smart0318

    smart0318

    Joined:
    Sep 7, 2017
    Posts:
    2

    did the problem be solved? I have the same problem.please help me !
     
  32. MM_Elliot

    MM_Elliot

    Joined:
    Aug 30, 2017
    Posts:
    2
    Isn't the Shadow Plane material a part of the ARKit? :D
    If it works with ARCore then that's great!
     
  33. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    185
    So Android O is out - but I hesitate to update my Pixel XL because I don't know if it will break ARCore compatibility. (The official docs are a bit unclear in that regard.) Has anyone installed it and tried if the whole build-run pipeline still works?
     
  34. OldDudeTryingAR

    OldDudeTryingAR

    Joined:
    Sep 7, 2017
    Posts:
    1
    ....
    DllNotFoundException: tango_client_api2


    I am seeing same issue with 2017.2.0b10 -
    Only difference from previous post documentation is: has ARCore Supported under XR settings instead of Tango Supported.
    This occurs right after adding the sample scene to the hierarchy and pressing Play for scene in editor.
     
    Last edited: Sep 7, 2017
  35. momo_the_monster

    momo_the_monster

    Joined:
    Sep 3, 2014
    Posts:
    11
    I can confirm that I upgraded my Pixel to Oreo and ARCore builds and runs just fine.
     
    WendelinReich likes this.
  36. fathahnoor

    fathahnoor

    Joined:
    Apr 3, 2012
    Posts:
    7
    Thanks for this information, I got my S8+ (SM-G955FD) successfully run the HelloAR app by using this modified ARCore preview.
     
    Last edited: Sep 12, 2017
  37. kiwinaman

    kiwinaman

    Joined:
    May 23, 2017
    Posts:
    2

    Same exact issue on my end - any solve here? XR Settings is not showing up for me under Build Settings, not sure if it's a result of this error. Just downloaded arcore-unity-sdk-preview today and imported the file into Unity.
     
  38. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    180
    Which version of Unity. The XR namespace and XR Settings menu are both relatively new. You need 2017.2b9 to use ARCore. Link here: https://unity3d.com/unity/beta/unity2017.2.0b9
     
  39. Akayllin

    Akayllin

    Joined:
    Jan 29, 2017
    Posts:
    1
    Same issue when trying to build with 2017.2b10 and ARCore support checked in XR settings. I will try the downgrade to b9 but for any devs it might help android studio logcat giving the following:

    09-09 02:00:10.808 8710-8773/? E/tango: java_service_entrypoint.cc:299 TangoErrorType getPoseAtTime(double, TangoCoordinateFramePair, tango_common:pose*): Failed to query a pose.
    09-09 02:00:10.809 10005-10022/? W/System.err: com.google.atap.tangoservice.TangoErrorException
    09-09 02:00:10.809 10005-10022/? W/System.err: at com.google.atap.tangoservice.Tango.throwTangoExceptionIfNeeded(Tango.java:1533)
    09-09 02:00:10.809 10005-10022/? W/System.err: at com.google.atap.tangoservice.Tango.getPoseAtTime(Tango.java:874)
    09-09 02:00:10.809 10005-10022/? W/System.err: at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    09-09 02:00:10.809 10005-10022/? W/System.err: at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    09-09 02:00:10.809 10005-10022/? W/System.err: at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source:151)
    09-09 02:00:10.809 10005-10022/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:101)
    09-09 02:00:10.809 10005-10022/? W/System.err: at android.os.Looper.loop(Looper.java:164)
    09-09 02:00:10.809 10005-10022/? W/System.err: at com.unity3d.player.UnityPlayer$c.run(Unknown Source:20)


    UPDATE: Downgrade to b9 did not fix the issue...
     
    Last edited: Sep 9, 2017
  40. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    180
    Yes this is a known issue; you'll need b9 instead of b10.
     
    roumenf likes this.
  41. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    185
    I have a suggestion about light estimation. Right now, making use of this feature requires custom shaders. That's fine for a preview, but in the future I think light estimation shouldn't bypass Unity's lighting system, and should work with any shader. So instead, I'd want light estimation to drive a light (or an object that contains lights) via scripts. This could be simple at first (e.g., just intensity) but should always be configurable (e.g., via a mulitplier etc).

    Unity devs, if this is Google's responsibility and not yours, maybe you could talk to their devs about this?
     
  42. FlashBull

    FlashBull

    Joined:
    Feb 12, 2017
    Posts:
    50
    I loaded the ARCore plugin in Unity 2017.2b10, and the result of the package was stopped and the crash was stopped.
    I installed the ARCore service and used the S8-SM-G9500 system with Android 7.0.
    Why has been crashing ???
     
    Last edited: Sep 11, 2017
  43. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    446
    ARCore doesn't work properly with Unity 2017.2b10. You need to downgrade to Unity 2017.2b9, as stated above.
    By the way, will this issue be fixed in 2017.2 release (or further betas)?
     
  44. FlashBull

    FlashBull

    Joined:
    Feb 12, 2017
    Posts:
    50
    Perhaps my S8 model is not supported? My model is SM-G9500, you know whether this model support it?
     
  45. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    446
    Here is the list of supported devices: https://developers.google.com/ar/discover/#supported_devices

    Even if your phone model is not there, it probably works. Make sure you have installed the ARCore-service (it doesn't come with the phone), and you use Unity 2017.2b9 for development. Here are all the required steps: https://developers.google.com/ar/develop/unity/getting-started
     
  46. Flarup

    Flarup

    Joined:
    Jan 7, 2010
    Posts:
    60
    First of all, thank you VERY MUCH for a great plugin and for making it available in Unity (cc @timmunity). I have been playing with the test app for a few days now, and I'm very impressed with the amount of different surfaces it works on - both indoors and outdoors.

    As others also have pointed out, it would be useful with support for testing directly in editor, but I can work around that for now. However, I have two questions for the plugin, which someone hopefully can help with:

    1) Is there some way of identifying that a tracked plane have been "seen before"? That is, if I two days in a row scan the same table, is there a way to identify that this table was tracked at some earlier time, and then respawn anchors on it based on whatever I have stored in PlayerPrefs? (I basically want to "save" my anchors, and "load" them again when I scan the same table)

    2) Is there a way to synchronize tracked planes over networking? Say, I want to make a realtime multiplayer game, in which two players (each with her/his own phone) are spawning items on the same playing field (table).

    Thanks a lot in advance for all help.

    Kind regards,
    Uffe Flarup
     
    WendelinReich likes this.
  47. kushG

    kushG

    Joined:
    May 25, 2017
    Posts:
    18
    I'm having some trouble working with orientation that we get from Tracked Pose Driver when in landscape mode. I'm on Google Pixel XL and it seems like when I'm in landscape mode it assumes that I'm in portrait. Is their a setting that I'm missing ?
     
    Last edited: Sep 12, 2017
  48. Benamax

    Benamax

    Joined:
    Aug 23, 2017
    Posts:
    2
    Is there a way to remove an active anchor from the scene?
     
  49. mebalzer

    mebalzer

    Joined:
    Mar 19, 2015
    Posts:
    15
    I use a Cromecast device (the latest Google Chromecast Ultra with its LAN connection), and a standalone HDMI-to-MP4-to-USB device. Works great! You can also use AirServer, which now allows it be used a ChromeCast device as well, great if you are mainly on Apple devices, but it is available for PC as well.
     
  50. faye921

    faye921

    Joined:
    Dec 3, 2012
    Posts:
    1
    Playing with the helloAR example, it seems fantastic! But I've got an issue I've set up a few UI buttons which work however when tapped they still act as if i'm also tapping the plane below, how can I disable the raycast filter on a certain tag / layer within ARcore?