Search Unity

Resolved ARKit support for iOS via Unity-ARKit-Plugin

Discussion in 'AR' started by jimmya, Jun 5, 2017.

Thread Status:
Not open for further replies.
  1. RubyKrongDev

    RubyKrongDev

    Joined:
    May 25, 2016
    Posts:
    16
    When I go to the stage from the AR, I create a new instance of UnityARSessionNativeInterface and at 3-4 scenes loading the application crashes. This is what Xcode says:

    Code (CSharp):
    1. chronos`il2cpp::vm::Exception::Raise:
    2.     0x101193c08 <+0>:   stp    x24, x23, [sp, #-0x40]!
    3.     0x101193c0c <+4>:   stp    x22, x21, [sp, #0x10]
    4.     0x101193c10 <+8>:   stp    x20, x19, [sp, #0x20]
    5.     0x101193c14 <+12>:  stp    x29, x30, [sp, #0x30]
    6.     0x101193c18 <+16>:  add    x29, sp, #0x30            ; =0x30
    7.     0x101193c1c <+20>:  mov    x19, x0
    8.     0x101193c20 <+24>:  ldr    x8, [x19, #0x10]
    9.     0x101193c24 <+28>:  cbnz   x8, 0x101193c90           ; <+136> at Exception.cpp:41
    10.     0x101193c28 <+32>:  bl     0x1011b2aa0               ; il2cpp::vm::StackTrace::GetStackFrames()
    11.     0x101193c2c <+36>:  mov    x20, x0
    12.     0x101193c30 <+40>:  ldp    x8, x9, [x20]
    13.     0x101193c34 <+44>:  sub    x8, x9, x8
    14.     0x101193c38 <+48>:  asr    x22, x8, #3
    15.     0x101193c3c <+52>:  adrp   x8, 1187
    16.     0x101193c40 <+56>:  nop  
    17.     0x101193c44 <+60>:  ldr    x0, [x8, #0xe60]
    18.     0x101193c48 <+64>:  mov    x1, x22
    19.     0x101193c4c <+68>:  bl     0x10118dbf8               ; il2cpp::vm::Array::New(Il2CppClass*, int)
    20.     0x101193c50 <+72>:  mov    x21, x0
    21.     0x101193c54 <+76>:  ldp    x23, x8, [x20]
    22.     0x101193c58 <+80>:  cmp    x23, x8
    23.     0x101193c5c <+84>:  b.eq   0x101193c8c               ; <+132> at Exception.cpp:38
    24.     0x101193c60 <+88>:  sub    x22, x22, #0x1            ; =0x1
    25.     0x101193c64 <+92>:  orr    w1, wzr, #0x8
    26.     0x101193c68 <+96>:  mov    x0, x21
    27.     0x101193c6c <+100>: mov    x2, x22
    28.     0x101193c70 <+104>: bl     0x10118df4c               ; il2cpp_array_addr_with_size(Il2CppArray*, int, unsigned long)
    29.     0x101193c74 <+108>: ldr    x8, [x23], #0x8
    30.     0x101193c78 <+112>: str    x8, [x0]
    31.     0x101193c7c <+116>: ldr    x8, [x20, #0x8]
    32.     0x101193c80 <+120>: sub    x22, x22, #0x1            ; =0x1
    33.     0x101193c84 <+124>: cmp    x23, x8
    34.     0x101193c88 <+128>: b.ne   0x101193c64               ; <+92> at Exception.cpp:35
    35.     0x101193c8c <+132>: str    x21, [x19, #0x10]
    36.     0x101193c90 <+136>: orr    w0, wzr, #0x8
    37.     0x101193c94 <+140>: bl     0x1011c2a84               ; symbol stub for: __cxa_allocate_exception
    38.     0x101193c98 <+144>: str    x19, [x0]
    39.     0x101193c9c <+148>: mov    x2, #0x0
    40.     0x101193ca0 <+152>: adrp   x1, 927
    41.     0x101193ca4 <+156>: add    x1, x1, #0x110            ; =0x110
    42.     0x101193ca8 <+160>: bl     0x1011c2af0               ; symbol stub for: __cxa_throw
    43.  
    Unloading 5 Unused Serialized files (Serialized files now loaded: 0)

    UnloadTime: 5.071250 ms



    Unloading 156 unused Assets to reduce memory usage. Loaded Objects now: 615.

    Total: 1.438083 ms (FindLiveObjects: 0.043416 ms CreateObjectMapping: 0.021125 ms MarkObjects: 0.602625 ms DeleteObjects: 0.770541 ms)



    ar_session_interrupted

    UnityEngine.XR.iOS.UnityARSessionNativeInterface:_ar_session_interrupted()



    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)



    libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper

    (lldb)

    Please, tell me how to fix it!
     

    Attached Files:

  2. Mobgen-Lab

    Mobgen-Lab

    Joined:
    May 23, 2017
    Posts:
    15
    There are sometimes that when I change to the AR Camera the image is like frozen, the background is not rendering the camera but a simple color. And the is like chopped and multiplied every time I move the camera.

    Sometimes happen, others not. Weird

    EDIT: Weird, I disabled Receive Shadows from the mesh renderer and now works well....

    Maybe it is a bug guys, check that
     
    Last edited: Aug 30, 2017
  3. skdev3

    skdev3

    Joined:
    Jul 15, 2015
    Posts:
    64
    Hi All.
    UnityARVideo for VR glasses
    replase UnityARVideo - > UnityARVideoQuad

    Code:
    Code (csharp):
    1.  
    2. using System;
    3. using System.Runtime.InteropServices;
    4. using UnityEngine;
    5. using UnityEngine.Rendering;
    6. using UnityEngine.VR;
    7.  
    8. namespace UnityEngine.XR.iOS
    9. {
    10.  
    11.     public class UnityARVideoQuad : MonoBehaviour
    12.     {
    13.         public Material m_ClearMaterial;
    14.  
    15.         private Texture2D _videoTextureY;
    16.         private Texture2D _videoTextureCbCr;
    17.  
    18.         private float fTexCoordScale;
    19.         private ScreenOrientation screenOrientation;
    20. #if UNITY_EDITOR
    21.         WebCamTexture webcamTexture;
    22. #endif
    23.  
    24.         GameObject quad = null;
    25.         Renderer quadRenderer = null;
    26.         public float distanceFarClipquad = 0.1f;
    27.         public Camera camera = null;
    28.  
    29.         public void Start()
    30.         {
    31.             quad = GameObject.CreatePrimitive(PrimitiveType.Quad);
    32.             quad.name = "ARVideoQuad";
    33.             quadRenderer = quad.GetComponent<Renderer>();
    34.             if (camera == null)
    35.             {
    36.                 camera = GetComponent<Camera>();
    37.                 if (camera == null)
    38.                 {
    39.                     camera = Camera.main;
    40.                 }
    41.             }
    42.            
    43.  
    44.             fTexCoordScale = 1.0f;
    45.             screenOrientation = ScreenOrientation.LandscapeLeft;
    46.             UnityARSessionNativeInterface.ARFrameUpdatedEvent += UpdateFrame;
    47.  
    48. #if UNITY_EDITOR
    49.             webcamTexture = new WebCamTexture();
    50.             webcamTexture.Play();
    51. #endif
    52.         }
    53.  
    54.         void UpdateFrame(UnityARCamera cam)
    55.         {
    56.             fTexCoordScale = cam.videoParams.texCoordScale;
    57.             screenOrientation = (ScreenOrientation)cam.videoParams.screenOrientation;      
    58.         }
    59.         void OnDestroy()
    60.         {
    61.             UnityARSessionNativeInterface.ARFrameUpdatedEvent -= UpdateFrame;
    62.             Destroy(quad);
    63.         }
    64.  
    65.  
    66.         public void LateUpdate()
    67.         {            
    68.             textureUpdate();
    69.  
    70.             Vector3 UpLeft = camera.ViewportToWorldPoint(new Vector3(0, 1, camera.farClipPlane - distanceFarClipquad));
    71.             Vector3 UpRight = camera.ViewportToWorldPoint(new Vector3(1, 1, camera.farClipPlane - distanceFarClipquad));
    72.             Vector3 DownLeft = camera.ViewportToWorldPoint(new Vector3(0, 0, camera.farClipPlane - distanceFarClipquad));
    73.             Vector3 DownRight = camera.ViewportToWorldPoint(new Vector3(1, 0, camera.farClipPlane - distanceFarClipquad));
    74.             Vector3 center = camera.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, camera.farClipPlane - distanceFarClipquad));
    75.  
    76.             if (quad)
    77.             {
    78.                 float quadWidth = Vector3.Distance(UpLeft, UpRight);
    79.                 float quadHeight = Vector3.Distance(UpLeft, DownLeft);
    80.                 quad.transform.localScale = new Vector3(quadWidth, quadHeight, 1);
    81.                 quad.transform.position = center;
    82.                 quad.transform.parent = camera.transform;
    83.  
    84.                 if (quadRenderer != null)
    85.                 {
    86.                     if (m_ClearMaterial == null)
    87.                     {
    88.                         m_ClearMaterial = new Material(Shader.Find("ArKit/ARCameraShaderCustom"));
    89.                     }
    90.                     quadRenderer.material = m_ClearMaterial;
    91.                 }
    92.             }
    93.         }
    94.  
    95. #if !UNITY_EDITOR
    96.  
    97.         public void textureUpdate()
    98.         {
    99.             ARTextureHandles handles = UnityARSessionNativeInterface.GetARSessionNativeInterface ().GetARVideoTextureHandles();
    100.             if (handles.textureY == System.IntPtr.Zero || handles.textureCbCr == System.IntPtr.Zero)
    101.             {
    102.                 return;
    103.             }
    104.  
    105.  
    106.             Resolution currentResolution = Screen.currentResolution;
    107.  
    108.             // Texture Y
    109.             _videoTextureY = Texture2D.CreateExternalTexture(currentResolution.width, currentResolution.height,
    110.                 TextureFormat.R8, false, false, (System.IntPtr)handles.textureY);
    111.             _videoTextureY.filterMode = FilterMode.Bilinear;
    112.             _videoTextureY.wrapMode = TextureWrapMode.Repeat;
    113.             _videoTextureY.UpdateExternalTexture(handles.textureY);
    114.  
    115.             // Texture CbCr
    116.             _videoTextureCbCr = Texture2D.CreateExternalTexture(currentResolution.width, currentResolution.height,
    117.                 TextureFormat.RG16, false, false, (System.IntPtr)handles.textureCbCr);
    118.             _videoTextureCbCr.filterMode = FilterMode.Bilinear;
    119.             _videoTextureCbCr.wrapMode = TextureWrapMode.Repeat;
    120.             _videoTextureCbCr.UpdateExternalTexture(handles.textureCbCr);
    121.  
    122.             if (m_ClearMaterial == null)
    123.             {
    124.                 m_ClearMaterial = new Material(Shader.Find("ArKit/ARCameraShaderCustom"));
    125.             }
    126.  
    127.             m_ClearMaterial.SetTexture("_textureY", _videoTextureY);
    128.             m_ClearMaterial.SetTexture("_textureCbCr", _videoTextureCbCr);
    129.             int isPortrait = 0;
    130.  
    131.             float rotation = 0;
    132.             if (screenOrientation == ScreenOrientation.Portrait) {
    133.                 rotation = -90;
    134.                 isPortrait = 1;
    135.             }
    136.             else if (screenOrientation == ScreenOrientation.PortraitUpsideDown) {
    137.                 rotation = 90;
    138.                 isPortrait = 1;
    139.             }
    140.             else if (screenOrientation == ScreenOrientation.LandscapeRight) {
    141.                 rotation = -180;
    142.             }
    143.             Matrix4x4 m = Matrix4x4.TRS (Vector3.zero, Quaternion.Euler(0.0f, 0.0f, rotation), Vector3.one);
    144.             m_ClearMaterial.SetMatrix("_TextureRotation", m);
    145.             m_ClearMaterial.SetFloat("_texCoordScale", fTexCoordScale);
    146.             m_ClearMaterial.SetInt("_isPortrait", isPortrait);
    147.             m_ClearMaterial.SetInt("_isRgb", 0);
    148.            
    149.         }
    150. #else
    151.  
    152.  
    153.         public void textureUpdate()
    154.         {
    155.  
    156.  
    157.             ////////////////////////////////////////////////////////
    158.             if (webcamTexture != null)
    159.             {
    160.                 if (_videoTextureY != null) DestroyImmediate(_videoTextureY);
    161.                 if (_videoTextureCbCr != null) DestroyImmediate(_videoTextureCbCr);
    162.  
    163.                 _videoTextureY = new Texture2D(webcamTexture.width, webcamTexture.height, TextureFormat.ARGB32, false);
    164.                 _videoTextureCbCr = new Texture2D(webcamTexture.width, webcamTexture.height, TextureFormat.ARGB32, false);
    165.  
    166.                 _videoTextureY.SetPixels(webcamTexture.GetPixels());
    167.                 _videoTextureY.Apply();
    168.                 _videoTextureCbCr.SetPixels(webcamTexture.GetPixels());
    169.                 _videoTextureCbCr.Apply();
    170.             }
    171.             ////////////////////////////////////////////////////////
    172.             if (m_ClearMaterial == null)
    173.             {
    174.                 m_ClearMaterial = new Material(Shader.Find("ArKit/ARCameraShaderCustom"));
    175.             }
    176.             m_ClearMaterial.SetTexture("_textureY", _videoTextureY);
    177.             m_ClearMaterial.SetTexture("_textureCbCr", _videoTextureCbCr);
    178.             m_ClearMaterial.SetInt("_isRgb", 1);
    179.             int isPortrait = 0;
    180.  
    181.             float rotation = -180;
    182.             if (screenOrientation == ScreenOrientation.Portrait)
    183.             {
    184.                 rotation = -90;
    185.                 isPortrait = 1;
    186.             }
    187.             else if (screenOrientation == ScreenOrientation.PortraitUpsideDown)
    188.             {
    189.                 rotation = 90;
    190.                 isPortrait = 1;
    191.             }
    192.             else if (screenOrientation == ScreenOrientation.LandscapeRight)
    193.             {
    194.                 rotation = 0;
    195.             }
    196.  
    197.             Matrix4x4 m = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0.0f, 0.0f, rotation), Vector3.one);
    198.             m_ClearMaterial.SetMatrix("_TextureRotation", m);
    199.             m_ClearMaterial.SetFloat("_texCoordScale", fTexCoordScale);
    200.             m_ClearMaterial.SetInt("_isPortrait", isPortrait);
    201.         }
    202. #endif
    203.     }
    204. }
    205.  
    Shader:

    Code (csharp):
    1.  
    2. Shader "ArKit/ARCameraShaderCustom"
    3. {
    4.     Properties
    5.     {
    6.         _textureY ("TextureY", 2D) = "white" {}
    7.         _textureCbCr ("TextureCbCr", 2D) = "black" {}
    8.         _texCoordScale ("Texture Coordinate Scale", float) = 1.0
    9.         _isPortrait ("Device Orientation", Int) = 0
    10.         _isRgb ("Use RGB", Int) = 0
    11.     }
    12.     SubShader
    13.     {
    14.         Tags { "RenderType"="Opaque" }
    15.         LOD 100
    16.  
    17.         Pass
    18.         {
    19.             ZWrite Off
    20.             CGPROGRAM
    21.             #pragma vertex vert
    22.             #pragma fragment frag
    23.            
    24.             #include "UnityCG.cginc"
    25.  
    26.             uniform float _texCoordScale;
    27.             uniform int _isPortrait;
    28.             uniform int _isRgb;
    29.             float4x4 _TextureRotation;
    30.  
    31.             struct Vertex
    32.             {
    33.                 float4 position : POSITION;
    34.                 float2 texcoord : TEXCOORD0;
    35.             };
    36.  
    37.             struct TexCoordInOut
    38.             {
    39.                 float4 position : SV_POSITION;
    40.                 float2 texcoord : TEXCOORD0;
    41.             };
    42.  
    43.             TexCoordInOut vert (Vertex vertex)
    44.             {
    45.                 TexCoordInOut o;
    46.                 o.position = UnityObjectToClipPos(vertex.position);
    47.                 if (_isPortrait == 1)
    48.                 {
    49.                     o.texcoord = float2(vertex.texcoord.x, -(vertex.texcoord.y - 0.5f) * _texCoordScale + 0.5f);
    50.                 }
    51.                 else
    52.                 {
    53.                     o.texcoord = float2((vertex.texcoord.x - 0.5f) * _texCoordScale + 0.5f, -vertex.texcoord.y);
    54.                 }
    55.                 o.texcoord = mul(_TextureRotation, float4(o.texcoord,0,1)).xy;
    56.                
    57.                 return o;
    58.             }
    59.            
    60.             // samplers
    61.             sampler2D _textureY;
    62.             sampler2D _textureCbCr;
    63.  
    64.             fixed4 frag (TexCoordInOut i) : SV_Target
    65.             {
    66.                 // sample the texture
    67.                 float2 texcoord = i.texcoord;
    68.                 float y = tex2D(_textureY, texcoord).r;
    69.                 float4 ycbcr = float4(y, tex2D(_textureCbCr, texcoord).rg, 1.0);
    70.  
    71.                 const float4x4 ycbcrToRGBTransform = float4x4(
    72.                         float4(1.0, +0.0000, +1.4020, -0.7010),
    73.                         float4(1.0, -0.3441, -0.7141, +0.5291),
    74.                         float4(1.0, +1.7720, +0.0000, -0.8860),
    75.                         float4(0.0, +0.0000, +0.0000, +1.0000)
    76.                     );
    77.                     if(_isRgb>0.1)
    78.                     {
    79.                        
    80.                         return tex2D(_textureY, texcoord);
    81.                     }
    82.                     else{
    83.                         return mul(ycbcrToRGBTransform, ycbcr);
    84.                     }
    85.             }
    86.             ENDCG
    87.         }
    88.     }
    89. }
    90.  
    91.  
     
    Last edited: Aug 30, 2017
  4. FlolF

    FlolF

    Joined:
    Nov 20, 2012
    Posts:
    14
    Still having trouble with
    - iPod 6th Gen, iOS 11 Beta 7
    - Unity 5.6.2f1 / Unity 2017.1 / Unity 2017.2
    - XCode Beta 6
    - ARKit 1.0.8 from Assetstore

    So basically, builds work on iPhone7+, but not on my iPod 6th Gen.
    I just get a blue / black screen. :/
     
  5. elhispano

    elhispano

    Joined:
    Jan 23, 2012
    Posts:
    52
  6. elhispano

    elhispano

    Joined:
    Jan 23, 2012
    Posts:
    52
    You have to pause the session and when you want to initialize it again with the proper options to clean everything.

    Here is the example in our code when we open a an AR session again:

    Code (CSharp):
    1. var sessionConfig = new ARKitWorldTackingSessionConfiguration(UnityARAlignment.UnityARAlignmentGravity,UnityARPlaneDetection.Horizontal,getPointCloudData,getLightEstimation);
    2.                 ActiveARSession.RunWithConfigAndOptions(sessionConfig,UnityARSessionRunOption.ARSessionRunOptionRemoveExistingAnchors | UnityARSessionRunOption.ARSessionRunOptionResetTracking);
     
    hgbimonti likes this.
  7. RubyKrongDev

    RubyKrongDev

    Joined:
    May 25, 2016
    Posts:
    16
    After several loading scene in the xCode, it gives an error:

    Unloading 3555 unused Assets to reduce memory usage. Loaded Objects now: 719.

    UPD: Everything is normal already. Perhaps the reason for the error is not that.
     
    Last edited: Aug 30, 2017
  8. kjorrt

    kjorrt

    Joined:
    Nov 26, 2014
    Posts:
    34
    Argh so close! I got up to running the remote debugger after successfully making a connection and the iPad displays video but not video in the editor. Anyone else have this problem? I'm using Unity 5.6.3f1.
     
  9. 4NDDYYYY

    4NDDYYYY

    Joined:
    Jan 28, 2016
    Posts:
    13
    Does anyone know (or know how to find) the approximate focus distance and aperture (f-stop) value for the camera when running in ARKit? I'm trying to apply some realistic camera effects using the post processing asset.
     
  10. 4NDDYYYY

    4NDDYYYY

    Joined:
    Jan 28, 2016
    Posts:
    13
    Check out lines 19 - 29.

    Among other things, for example, the script lets you try different tracking modes available in the Apple ARKit API. I used it to evaluate the performance of gravity mode vs gravity+heading mode.
     
  11. dreamplanet

    dreamplanet

    Joined:
    Jun 17, 2017
    Posts:
    7
    Thanks, Zyshaq - am super happy to hear that it's easy! However, I can't find ARManager - did you mean ARCameraManager? And did you mean transform.scale, or position? And did you mean change these values in the Inspector of some game object or at the end of a C# script? Sorry for all the questions but I tried each of these methods with no joy .. could you please clarify? Thx so much!
     
  12. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    iPod is not a supported device: it only has A8 processor
     
    FlolF likes this.
  13. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    As I mentioned before, this will most likely not work. Instead you should take a look at the scaled-content branch of the plugin.
     
    KwahuNashoba likes this.
  14. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    ARKit does expose the camera intrinsics that you can get focal length from, but the plugin chose not to expose this directly, although it is being used to create the camera projection matrix. As for f-stop, I'm not sure that is available at all.
     
    4NDDYYYY likes this.
  15. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    There is a PR on BitBucket that exposes that, but we haven't had a chance to integrate it yet.
     
  16. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    We get the raw pixel data from the Y and UV textures in UnityRemoteVideo.cs when we want to send it across from Remote to Editor. You can do the same (except for the serializing to bytearray) and you will have it.
     
    ler4y likes this.
  17. ler4y

    ler4y

    Joined:
    Aug 30, 2017
    Posts:
    2
    Hi to All.
    I have a strange bug.
    When ARKit detects the plane, ARKitHitTestExample placing on this plane a my sphere. Simple sphere. But, he place this sphere on a half of height of sphere. In other words, my sphere bottom edge is lower than plane surface. Exactly on a half of sphere height. I already tried many options, double checked of sphere position, camera settings, arkit scripts, nothing helped. In Unity Editor, sphere position is correct and already set on world surface.
    Any solutions please?
     

    Attached Files:

  18. FlolF

    FlolF

    Joined:
    Nov 20, 2012
    Posts:
    14
    Thanks for the verification! I was just confused because it worked for some time with iOS beta 5 + older ARKit plugin version. Even on my iPod. :D
     
  19. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Origin of the sphere is at center, so that is expected. You can translate the sphere up by its radius and you should be set.
     
  20. ZYSHAQ

    ZYSHAQ

    Joined:
    Jun 26, 2015
    Posts:
    76
    Reply this message if I have not replied by within 24 hours, its quite busy for me these days.
     
  21. ler4y

    ler4y

    Joined:
    Aug 30, 2017
    Posts:
    2
    Oh. Thanks for reply. This is my mistake. When im put my sphere in Parent object, i forgot to change Hit Transform (in ARKitHitTestExample) object to Parent object. Sorry =)
     

    Attached Files:

    Last edited: Aug 30, 2017
  22. jkqs

    jkqs

    Joined:
    Mar 15, 2016
    Posts:
    13
    2017-08-31 11:15:22.285776+0800 arkitscene[2332:745927] [DYMTLInitPlatform] platform initialization successful



    2017-08-31 11:15:22.344170+0800 arkitscene[2332:745803] -> registered mono modules 0x104368400

    2017-08-31 11:15:22.391625+0800 arkitscene[2332:745803] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.

    -> applicationDidFinishLaunching()

    Player data archive not found at `/var/containers/Bundle/Application/BED22B7F-A342-44D0-BA6E-A6831CAE15E6/arkitscene.app/Data/data.unity3d`, using local filesystem2017-08-31 11:15:22.427862+0800 arkitscene[2332:745803] Metal GPU Frame Capture Enabled

    2017-08-31 11:15:22.428375+0800 arkitscene[2332:745803] Metal API Validation Disabled

    2017-08-31 11:15:22.459581+0800 arkitscene[2332:745803] libMobileGestalt MobileGestaltSupport.m:153: pid 2332 (arkitscene) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled

    2017-08-31 11:15:22.459633+0800 arkitscene[2332:745803] libMobileGestalt MobileGestalt.c:555: no access to InverseDeviceID (see <rdar://problem/11744455>)

    -> applicationDidBecomeActive()

    GfxDevice: creating device client; threaded=1

    Initializing Metal device caps: Apple A9 GPU

    Initialize engine version: 5.6.3f1 (d3101c3b8468)

    =================================================================

    Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

    PID: 2332, TID: 745937, Thread name: (none), Queue name: NSOperationQueue 0x1c4228a80 :: NSOperation 0x1c445d880 (QOS: DEFAULT), QoS: 21

    Backtrace:

    4 arkitscene 0x000000010341bc3c UnityCurrentOrientation + 60

    5 arkitscene 0x00000001034095bc __UnityCoreMotionStart_block_invoke + 108

    6 Foundation 0x00000001862a6de4 <redacted> + 16

    7 Foundation 0x00000001861e72e0 <redacted> + 96

    8 Foundation 0x00000001861d7280 <redacted> + 620

    9 Foundation 0x00000001862a974c <redacted> + 228

    10 libdispatch.dylib 0x00000001a7bd02bc <redacted> + 16

    11 libdispatch.dylib 0x00000001a7bda57c <redacted> + 532

    12 libdispatch.dylib 0x00000001a7bdafa8 <redacted> + 332

    13 libdispatch.dylib 0x00000001a7bdbb28 <redacted> + 388

    14 libdispatch.dylib 0x00000001a7be4368 <redacted> + 864

    15 libsystem_pthread.dylib 0x00000001a7e671e8 _pthread_wqthread + 924

    16 libsystem_pthread.dylib 0x00000001a7e66e40 start_wqthread + 4

    2017-08-31 11:15:22.850868+0800 arkitscene[2332:745937] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

    PID: 2332, TID: 745937, Thread name: (none), Queue name: NSOperationQueue 0x1c4228a80 :: NSOperation 0x1c445d880 (QOS: DEFAULT), QoS: 21

    Backtrace:

    4 arkitscene 0x000000010341bc3c UnityCurrentOrientation + 60

    5 arkitscene 0x00000001034095bc __UnityCoreMotionStart_block_invoke + 108

    6 Foundation 0x00000001862a6de4 <redacted> + 16

    7 Foundation 0x00000001861e72e0 <redacted> + 96

    8 Foundation 0x00000001861d7280 <redacted> + 620

    9 Foundation 0x00000001862a974c <redacted> + 228

    10 libdispatch.dylib 0x00000001a7bd02bc <redacted> + 16

    11 libdispatch.dylib 0x00000001a7bda57c <redacted> + 532

    12 libdispatch.dylib 0x00000001a7bdafa8 <redacted> + 332

    13 libdispatch.dylib 0x00000001a7bdbb28 <redacted> + 388

    14 libdispatch.dylib 0x00000001a7be4368 <redacted> + 864

    15 libsystem_pthread.dylib 0x00000001a7e671e8 _pthread_wqthread + 924

    16 libsystem_pthread.dylib 0x00000001a7e66e40 start_wqthread + 4

    2017-08-31 11:15:22.852889+0800 arkitscene[2332:745803] [] <<<< FigVirtualFramebufferServer >>>> FigVirtualFramebufferGetMaxCount: unsupported operation

    2017-08-31 11:15:22.852944+0800 arkitscene[2332:745803] [] <<<< FigVirtualFramebufferServer >>>> FigVirtualFramebufferGetFramebufs: unsupported operation

    2017-08-31 11:15:22.852956+0800 arkitscene[2332:745803] [] <<<< FigVirtualFramebufferInstallation >>>> FigInstallVirtualDisplay_block_invoke: FigVirtualFramebufferGetFramebufs failed (0 framebufs)

    UnloadTime: 3.712291 ms

    2017-08-31 11:15:24.905407+0800 arkitscene[2332:745803] [Session] Unable to run the session, configuration is not supported on this device: (null)

    2017-08-31 11:15:24.941049+0800 arkitscene[2332:745915] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    2017-08-31 11:15:24.958226+0800 arkitscene[2332:745937] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    Setting up 1 worker threads for Enlighten.

    Thread -> id: 17f3ab000 -> priority: 1

    2017-08-31 11:15:25.959277+0800 arkitscene[2332:745937] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    -> applicationWillResignActive()

    2017-08-31 11:16:30.985800+0800 arkitscene[2332:745936] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    -> applicationDidEnterBackground()
     
  23. jkqs

    jkqs

    Joined:
    Mar 15, 2016
    Posts:
    13
    - Iphone 6sp, iOS 11 .0
    - Unity 5.6.3f1 / Unity 2017.1 / Unity 2017.2
    - XCode Beta 6
    - 从Assetstore的ARKit 1.0.8


    2017-08-31 11:15:22.285776+0800 arkitscene[2332:745927] [DYMTLInitPlatform] platform initialization successful



    2017-08-31 11:15:22.344170+0800 arkitscene[2332:745803] -> registered mono modules 0x104368400

    2017-08-31 11:15:22.391625+0800 arkitscene[2332:745803] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.

    -> applicationDidFinishLaunching()

    Player data archive not found at `/var/containers/Bundle/Application/BED22B7F-A342-44D0-BA6E-A6831CAE15E6/arkitscene.app/Data/data.unity3d`, using local filesystem2017-08-31 11:15:22.427862+0800 arkitscene[2332:745803] Metal GPU Frame Capture Enabled

    2017-08-31 11:15:22.428375+0800 arkitscene[2332:745803] Metal API Validation Disabled

    2017-08-31 11:15:22.459581+0800 arkitscene[2332:745803] libMobileGestalt MobileGestaltSupport.m:153: pid 2332 (arkitscene) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled

    2017-08-31 11:15:22.459633+0800 arkitscene[2332:745803] libMobileGestalt MobileGestalt.c:555: no access to InverseDeviceID (see <rdar://problem/11744455>)

    -> applicationDidBecomeActive()

    GfxDevice: creating device client; threaded=1

    Initializing Metal device caps: Apple A9 GPU

    Initialize engine version: 5.6.3f1 (d3101c3b8468)

    =================================================================

    Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

    PID: 2332, TID: 745937, Thread name: (none), Queue name: NSOperationQueue 0x1c4228a80 :: NSOperation 0x1c445d880 (QOS: DEFAULT), QoS: 21

    Backtrace:

    4 arkitscene 0x000000010341bc3c UnityCurrentOrientation + 60

    5 arkitscene 0x00000001034095bc __UnityCoreMotionStart_block_invoke + 108

    6 Foundation 0x00000001862a6de4 <redacted> + 16

    7 Foundation 0x00000001861e72e0 <redacted> + 96

    8 Foundation 0x00000001861d7280 <redacted> + 620

    9 Foundation 0x00000001862a974c <redacted> + 228

    10 libdispatch.dylib 0x00000001a7bd02bc <redacted> + 16

    11 libdispatch.dylib 0x00000001a7bda57c <redacted> + 532

    12 libdispatch.dylib 0x00000001a7bdafa8 <redacted> + 332

    13 libdispatch.dylib 0x00000001a7bdbb28 <redacted> + 388

    14 libdispatch.dylib 0x00000001a7be4368 <redacted> + 864

    15 libsystem_pthread.dylib 0x00000001a7e671e8 _pthread_wqthread + 924

    16 libsystem_pthread.dylib 0x00000001a7e66e40 start_wqthread + 4

    2017-08-31 11:15:22.850868+0800 arkitscene[2332:745937] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

    PID: 2332, TID: 745937, Thread name: (none), Queue name: NSOperationQueue 0x1c4228a80 :: NSOperation 0x1c445d880 (QOS: DEFAULT), QoS: 21

    Backtrace:

    4 arkitscene 0x000000010341bc3c UnityCurrentOrientation + 60

    5 arkitscene 0x00000001034095bc __UnityCoreMotionStart_block_invoke + 108

    6 Foundation 0x00000001862a6de4 <redacted> + 16

    7 Foundation 0x00000001861e72e0 <redacted> + 96

    8 Foundation 0x00000001861d7280 <redacted> + 620

    9 Foundation 0x00000001862a974c <redacted> + 228

    10 libdispatch.dylib 0x00000001a7bd02bc <redacted> + 16

    11 libdispatch.dylib 0x00000001a7bda57c <redacted> + 532

    12 libdispatch.dylib 0x00000001a7bdafa8 <redacted> + 332

    13 libdispatch.dylib 0x00000001a7bdbb28 <redacted> + 388

    14 libdispatch.dylib 0x00000001a7be4368 <redacted> + 864

    15 libsystem_pthread.dylib 0x00000001a7e671e8 _pthread_wqthread + 924

    16 libsystem_pthread.dylib 0x00000001a7e66e40 start_wqthread + 4

    2017-08-31 11:15:22.852889+0800 arkitscene[2332:745803] [] <<<< FigVirtualFramebufferServer >>>> FigVirtualFramebufferGetMaxCount: unsupported operation

    2017-08-31 11:15:22.852944+0800 arkitscene[2332:745803] [] <<<< FigVirtualFramebufferServer >>>> FigVirtualFramebufferGetFramebufs: unsupported operation

    2017-08-31 11:15:22.852956+0800 arkitscene[2332:745803] [] <<<< FigVirtualFramebufferInstallation >>>> FigInstallVirtualDisplay_block_invoke: FigVirtualFramebufferGetFramebufs failed (0 framebufs)

    UnloadTime: 3.712291 ms

    2017-08-31 11:15:24.905407+0800 arkitscene[2332:745803] [Session] Unable to run the session, configuration is not supported on this device: (null)

    2017-08-31 11:15:24.941049+0800 arkitscene[2332:745915] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    2017-08-31 11:15:24.958226+0800 arkitscene[2332:745937] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    Setting up 1 worker threads for Enlighten.

    Thread -> id: 17f3ab000 -> priority: 1

    2017-08-31 11:15:25.959277+0800 arkitscene[2332:745937] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    -> applicationWillResignActive()

    2017-08-31 11:16:30.985800+0800 arkitscene[2332:745936] [] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates

    -> applicationDidEnterBackground()
     
  24. skdev3

    skdev3

    Joined:
    Jul 15, 2015
    Posts:
    64
    Problem in iOS 11.0 use 11.6 or 11.7
    - 从Assetstore的ARKit 1.0.8 Use https://bitbucket.org/Unity-Technologies/unity-arkit-plugin

    P.S. Need lasttest IOS, Xcode and unity-arkit-plugin - work fine.
     
  25. jkqs

    jkqs

    Joined:
    Mar 15, 2016
    Posts:
    13
    I'm already ios11, unable to update, and the Xcode and unity-arkit-plugin plug-ins are normal,
     
  26. TenderPaw

    TenderPaw

    Joined:
    Apr 1, 2013
    Posts:
    5
    You need to make sure that your iOS is up to the latest OS which is iOS 11 beta 8 "15A5368a".
    If it's not and you can't upgrade it as you normally would, you need to enrol your device on apple developer console https://developer.apple.com/download/ through your device.
     
  27. skdev3

    skdev3

    Joined:
    Jul 15, 2015
    Posts:
    64
  28. ZYSHAQ

    ZYSHAQ

    Joined:
    Jun 26, 2015
    Posts:
    76
    [Edit: I maybe figured why: upon updating unity to 2017, I believe all script links may become broken including ARkit's; This could have happened when importing ARKit the examples scene with some color hsv scripts errors. I am reimporting the scene, praying the script links will resume now that I deleted the example scene files and cleared the errors.]

    [Edit 2: I confirm the setup seems to be fine by unity 2017.0.f3 is full of bugs that seems to break all the script links, even reimporting is not doing any good!]
    • Both Xcode 8.3 and 9.0 Beta 6 are installed but when I run I run 9.0 Beta 6 (should I delete 8.3?)
    • Unity Apple ARkit sdk version downloaded from bitbucket on August 29
    • Mac OS version is 10.12.6 (16G29)
    • Unity the latest
    • iPhone OS version is 11.0 beta 8
    Still getting that error
     
    Last edited: Aug 31, 2017
  29. ZYSHAQ

    ZYSHAQ

    Joined:
    Jun 26, 2015
    Posts:
    76
    How to download iOS 11.6/11.7? I upgraded to 11.0 beta 8, should that be 11.8?
     
  30. kennyallau

    kennyallau

    Joined:
    Aug 5, 2014
    Posts:
    8
    Hi @jimmya, thanks for tip. Also, another question: Would it be a good idea to convert the YUV raw pixels to Color32 in Unity? The reason why I would like to do so is because there is a custom image processing library (not opencv) that I'm using currently only processes rgba and grayscale.

    What would you suggest in this case?
     
  31. pgeorges-dpt

    pgeorges-dpt

    Joined:
    Apr 7, 2016
    Posts:
    43
    Hey jimmya,

    Just downloaded 2017.2.b8 with ARCore for Android. Are you guys working on implementing the new XR interface for ARKit?

    Cheers,

    Paul
     
    sama-van likes this.
  32. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    If we are switching between AR and non-AR modes, is there a way to retain the anchors so you don't have to re-find the surfaces when you return to AR?
     
  33. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    really sad to say that I can't even get ARkit running..
    2 macs I've tried it on fail.
    running osx 10.13, latest beta
    Xcode 9 beta 6
    ARkit latest plugin from asset store
    Unity 2017.2.0b8

    I get these linker errors on build SOMEONE PLEASE HELP!!!

    I always get this in xcode when building ArKit remote

    Undefined symbols for architecture arm64:

    "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:

    objc-class-ref in ARSessionNative.o

    "_OBJC_CLASS_$_AROrientationTrackingConfiguration", referenced from:

    objc-class-ref in ARSessionNative.o

    "_OBJC_CLASS_$_ARAnchor", referenced from:

    objc-class-ref in ARSessionNative.o

    "_OBJC_CLASS_$_ARPlaneAnchor", referenced from:

    objc-class-ref in ARSessionNative.o

    "_OBJC_CLASS_$_ARSession", referenced from:

    objc-class-ref in ARSessionNative.o

    ld: symbol(s) not found for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)​
     
  34. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    @jimmya - any idea about mine? I've been asking here for > 1 week now.
     
  35. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    It looks like you may not have imported the ARKit framework in Xcode.
     
  36. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    You could try passing in the y texture by itself, since that is basically a luminance value, which is equivalent to grayscale.
     
  37. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Yeah there's something really wacky about your setup. The BuildPostProcessor in the plugin should setup your XCode as needed. Maybe its because of the beta OS you're using. I've only tested extensively on macOS 10.12.5.
     
  38. massivebacon

    massivebacon

    Joined:
    Apr 24, 2014
    Posts:
    27


    Does anyone have a similar issue with ARKit "ghosting"? It seems like it may happen when it starts to lose tracking, but it's weird because:
    1. The object still properly tracks in space.
    2. The framerate is still pretty high.

    In the image above the yellow platform is moving up, and the bottom duplicates are remaining. You would think the camera would still be properly clearing, but is ARKit hanging it in some way? Also, any clues on how to debug this would be appreciated.
     
  39. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    What is an iPhone6sp? 6S Plus?
    The log statements don't make sense - its A9, and yet says arkit session is not supported. I would send a radar to Apple to try and figure out why your phone does not work.
     
  40. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    As soon as you pause ar session, you lose tracking, so even if you had saved the transforms somewhere, you would have to figure out where they were in relation to where you are now.
     
    AquaGhost likes this.
  41. yuliwei

    yuliwei

    Joined:
    Aug 19, 2017
    Posts:
    22
    Hi everyone, my model is pretty big, like a truck size. My model is not very stable as my camera moves, the object almost moves(but not as bad as completely follows my camera movement), be like if I walk 1 yard, the model moves 0.5 yard. Could anyone please let me know what I should fix? I put my objects in the "HitCubeParent" folder, just like HitCube that comes with the ARkit plugin. Should I include any code to make the object stay still? Or is just because the model is too big.

    Or when I see the blue rectangles, tap on the biggest one so it provides the biggest plane for the model?

    Thank you.
     
    Last edited: Sep 1, 2017
  42. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    No it is not. The scale example I mention doesn’t require you to scale your content. It uses camera tricks to make it look like your content is scaled. This should preserve physics and such while giving the appearance of scaled down content
     
    elhispano likes this.
  43. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    Add the ARKit.framework to your linked frameworks in Xcode
     
  44. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    bang on the money. thanks. I can't believe I missed that. Been a while since I did pure iOS dev and I guess I assumed the project was building right.
     
  45. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    Your model might not be setup correctly. You have to make sure that the bottom of your model is flush with a surface you place it on, otherwise it will always look off and like it’s moving.
     
  46. yuliwei

    yuliwei

    Joined:
    Aug 19, 2017
    Posts:
    22
    I did a test on the ARkit demo scene(the small cube scene), it works well when the cube is small, when I scale it up to as tall as me, it starts to be not stable like my truck model, I assume the model size really matters.
     
  47. yuliwei

    yuliwei

    Joined:
    Aug 19, 2017
    Posts:
    22
    So I think if the model is smaller than the blue rectangle, it stays well in the rectangle area, but when the model is way too big, but the rectangle is smaller than the model, then the model can not sit stably on the rectangle.
     
  48. yuliwei

    yuliwei

    Joined:
    Aug 19, 2017
    Posts:
    22
    Hi,

    I see there is a line of "UnityARSessionNativeInterface.ARFrameUpdatedEvent += UpdateFrame;" code in your example, could you please let me know what does it work for? Is it for video? Now I suffering my model is too big (as big as a truck) and it is not stable on the ground. I wonder what I can fix.

    Thanks.
     
  49. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    Like I said before, you may have to adjust the local position of your model in the parent transform. If it’s not flush with a surface when you place it, it is off.
     
  50. massivebacon

    massivebacon

    Joined:
    Apr 24, 2014
    Posts:
    27
    Going to subtract the image from the quote but still looking for guidance here. Just using the test scene but with different geometry. Everything places fine, but for some reason this happens around the edges of the model. Any ideas? Camera is also set to clear Depth Only.
     
Thread Status:
Not open for further replies.