Search Unity

ARKit 2.0 Beta support

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

  1. sam598

    sam598

    Joined:
    Sep 21, 2014
    Posts:
    60
    I have had some success getting pointclouds from worldmap.pointcloud.points. However they have only been available on a few worldmaps (maybe 1 out of every 10), and are accessed after a worldmap has been localized. There might be some asynchronous loading happening in the background?
     
  2. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    one thing you can do is keep track of the anchorid of the user anchor you create because that will be restored along with the session. then you can have a database of user information associated with that id stored in some sort of serialized format e.g. JSON . (see https://docs.unity3d.com/Manual/JSONSerialization.html)
     
  3. farazs

    farazs

    Joined:
    Dec 7, 2016
    Posts:
    10
    • In ARkit 2 update, Image anchor works good when it tracks the marker. But once the marker is lost the object remain on screen.
    • can we have mixture of Image Anchor(ARkit 1.5) + Image Anchor in ARkit 2 where marker is used to initialize 3D object and even if marker is not in view we can view it from different angles?
     
    SourceKraut likes this.
  4. psqv

    psqv

    Joined:
    Aug 27, 2015
    Posts:
    2
    Hi @jimmya,

    We're planning to launch an amazing AR app built in Unity, heavily utilizing the features in ARKit 2.0, for one of the worlds biggest brands alongside iOS 12 in about 2 weeks from now.

    There are two bugs in the current plugin that more or less completely breaks Environment Texturing for us:

    https://bitbucket.org/Unity-Technol...ues/55/cubemap-in-arenvironmentprobeanchor-is

    https://bitbucket.org/Unity-Technol...ues/63/environment-probe-reflections-make-all

    Any ETA for these bugs to be fixed?
     
  5. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Hi,

    Anybody having an issue about ARkit memory?
    On every ARKit session, memory keeps increasing causing an application crash.
    In advance thank you.

    (Check with arkit 2 with ios 12 in any ios device)
     
    wetcircuit likes this.
  6. rob_ice

    rob_ice

    Joined:
    Nov 11, 2016
    Posts:
    112
    You are going to need to wait for IOS 12, ARKit 2.0 and Xcode 10 come out of beta before you can launch an app that uses ARKit 2.0. Currently there isn't a release date for any of those 3 (just a heads up)
     
  7. menashay

    menashay

    Joined:
    Sep 6, 2018
    Posts:
    5
    I am very new to Unity and to ARKit so I did the following tutorial to get me started: https://medium.freecodecamp.org/how...eality-app-using-arkit-and-unity-ba16515a32fa
    It worked perfectly good with Unity ARKit plugin. However trying the same tutorial with Unity ARKit 2.0 plugin I do not get the cam feed at all. All I am getting is the 'earth & sky' scene from Unity (I am also not getting a permission request to use the cam on the phone)
    Using latest versions of Unity, XCode 10 beta, and IOS 12. iPhone is 6S+ and deployment on the project and XCode is set to IOS 12.
    Any help?
     
    Green-VR likes this.
  8. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    116
    that time frame is around the Apple Launch event (12th) when the new iOS usually goes out so he might not be far off...
     
    rob_ice likes this.
  9. rob_ice

    rob_ice

    Joined:
    Nov 11, 2016
    Posts:
    112
    Hopefully so, feels like it's all been in beta for yonks now, got some apps we are waiting to push out once it is out also
     
  10. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    116
    Thanks @jimmya - there's currently UnityARSessionNativeInterface.IsARKit_1_5_Supported but I've just pulled and can't see any accessor for IsARKit2_0_Supported? Is it possible to add please? Thanks! :)
     
  11. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    https://bitbucket.org/Unity-Technol...mits/a3d2b9f04632f1c57f8276c41f6e40052baaa272 should fix these
     
  12. menashay

    menashay

    Joined:
    Sep 6, 2018
    Posts:
    5
    finally got it to work. A small note in your docs can save somebody else days of frustration. When you start a new project you have 'sample scene.' When you then go to 'build settings' you will notice that the only asset listed is that default 'sample scene' What you need to do is -
    • Click the button 'add open scene'
    • Tick the box with the Unity ARKit 2.0
    • Remove the tick from the box with the default scene <--- important
     
    rob_ice likes this.
  13. kweiming

    kweiming

    Joined:
    Jun 18, 2017
    Posts:
    12
    Hi All,
    I used ShadowPlaneMaterial in previous ARKit and it works fine. But now in 2.0 the shadow is gone when I build on my iPhone6s. Any idea how to fix it? Thanks for your time
     
  14. JoMaHo

    JoMaHo

    Joined:
    Apr 2, 2017
    Posts:
    94
    Can not get ObjectAnchor test scene to work in Unity. The console reports:

    DirectoryNotFoundException: Could not find a part of the path "/Users/Shared/Unity/VV 3/Assets/StreamingAssets/ARReferenceObjects/ExampleObjectsResourceGroup.arresourcegroup/Contents.json".
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:292)
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
    (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:363)
    System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:167)
    System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding)
    (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string,System.Text.Encoding)
    System.IO.File.ReadAllText (System.String path, System.Text.Encoding encoding) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:587)
    System.IO.File.ReadAllText (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:582)
    ARReferenceObjectsSetAsset.LoadReferenceObjectsInSet () (at Assets/arkit2.0_funStuff-master/Assets/UnityARKitPlugin/Plugins/iOS/UnityARKit/ARReferenceObjectsSetAsset.cs:20)
    UnityARCameraManager.get_sessionConfiguration () (at Assets/arkit2.0_funStuff-master/Assets/UnityARKitPlugin/Plugins/iOS/UnityARKit/Helpers/UnityARCameraManager.cs:46)
    UnityARCameraManager.Start () (at Assets/arkit2.0_funStuff-master/Assets/UnityARKitPlugin/Plugins/iOS/UnityARKit/Helpers/UnityARCameraManager.cs:60)

    I´ve scanned my own .arobject, replaced the existing one as well. tried on a dozen versions of Unity from 2017.4 to 2018.7, but gives the same error in the console. If I remove the Detection object in the Unity AR Camera Manager script, the error goes away, and it builds just fine for iOS 12 (with Xcode Beta 10), camera works, but of course no detection of objects. If I try to build with the Detection Object in place in the script, the app just freezes on first frame.

    All the other test scenes in ARKit 2.0 work just fine in editor and on build. Something says me that is has something to do with the StreamingAssets folder and the Contents.json file.

    Anyone experiencing the same issues?
     
  15. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Are you using the plugin project fully or are you missing some files? Try with the latest arkit2.0_beta branch - I've put in a new arobject (coke can) which should work out of the box. If you want to use your own object, put the scanned .arobject in the same folder as the cokecan.arobject and follow the instructions in https://bitbucket.org/Unity-Technol.../src/arkit2.0_beta/docs/WhatsNewInARKit2_0.md
     
  16. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    By default, in build settings there should not be any scene ticked. Then whenever you build, it will only build the currently open scene.
     
  17. JoMaHo

    JoMaHo

    Joined:
    Apr 2, 2017
    Posts:
    94
    Ok, so I finally managed to get the code downloaded for ARkit 2.0 repository, and it contains the coke can, so it is the right one. I then dragged the whole root folder into my asset folder, opened the ObjectAnchor scene....and the same error message:

    DirectoryNotFoundException: Could not find a part of the path "/Users/johnymagne/VV2 test/Assets/StreamingAssets/ARReferenceObjects/ExampleObjectsResourceGroup.arresourcegroup/Contents.json".

    The StreamingAssets folder is not present in the Project hierarchy, is it supposed to be there in the first place, or is it generated by the scripts?

    I´m on Unity 2018.1.9f1, Macbook Pro 2018, i7, 16GB Ram. Mac OS 10.13.6

    Any suggestions?
     
    Last edited: Sep 12, 2018
  18. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Are you trying to run this from the Editor? That will not work.

    Suggestion is to try first to just open the plugin project as a unity project and build from there to device. The UnityARBuildPostprocessor editor script creates the folders and files needed in the XCode project that is output.
     
    JoMaHo likes this.
  19. JoMaHo

    JoMaHo

    Joined:
    Apr 2, 2017
    Posts:
    94
    Ehum, it did work out. Thanks! Silly me.

    As I´m here asking questions, I might also just as these:
    - I'm trying to detect a round object (ball), but it is not very good at it, do the
    object targets need to have more rigid structure to be tracked well?
    - I´d like to track several marvel like moving objects simultaneously, but the image anchors seems
    not to move with the one object I've tried this far if moved (well, they move slow, bit its not usable).

    Would it be possible at all with ARKIT 2, tracking several moving marble like objects, pinning a
    anchor on each?

    Best
     
  20. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Object detection uses detection of feature points in a certain configuration - some materials (e.g reflective or untextured) don't generate feature points easily (or if you are in low light). Object detection currently only recognized the object, but does not track it. If you compare with image detection, Image Anchors were recognition only in ARKit 1.5, and in ARKit 2.0 Image Anchors are tracked.
     
  21. esoinila

    esoinila

    Joined:
    Apr 27, 2017
    Posts:
    8
    UnityObjectScanner crash: Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) while trying to get the box to in right position. Unity 2017.4.4f1. iOS 12, public beta 12. Xcode: Version 10.0 beta 6 (10L232m). iPad pro model MQDT2KN/A.

    Started the scene on iPad and clicked create object and then started to put the box in position. After a while of being frustrated about getting the box to go down I got this error. Happened on two different runs.





    Code (CSharp):
    1. 2018-09-13 13:55:55.220776+0300 arkitscene[448:95091] [DYMTLInitPlatform] platform initialization successful
    2. 2018-09-13 13:55:55.240044+0300 arkitscene[448:95047] -> registered mono modules 0x102377b10
    3. -> applicationDidFinishLaunching()
    4. PlayerConnection initialized from /var/containers/Bundle/Application/EE02B1D9-290D-4D06-A604-6A4F953F1123/arkitscene.app/Data (debug = 0)
    5. PlayerConnection initialized network socket : 0.0.0.0 55000
    6. Multi-casting "[IP] 192.168.1.29 [Port] 55000 [Flags] 2 [Guid] 978048970 [EditorId] 2484608127 [Version] 1048832 [Id] iPhonePlayer(Lucass-iPad):56000 [Debug] 0" to [225.0.0.222:54997]...
    7. Started listening to [0.0.0.0:55000]
    8. 2018-09-13 13:55:55.301967+0300 arkitscene[448:95047] Metal GPU Frame Capture Enabled
    9. 2018-09-13 13:55:55.302776+0300 arkitscene[448:95047] Metal API Validation Disabled
    10. 2018-09-13 13:55:55.371135+0300 arkitscene[448:95047] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
    11. -> applicationDidBecomeActive()
    12. GfxDevice: creating device client; threaded=1
    13. Initializing Metal device caps: Apple A10X GPU
    14. Initialize engine version: 2017.4.4f1 (645c9050ba4d)
    15. WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
    16. WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
    17. WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
    18. WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
    19. UnloadTime: 3.980208 ms
    20. 2018-09-13 13:55:57.864371+0300 arkitscene[448:95047] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    21. 2018-09-13 13:55:57.864566+0300 arkitscene[448:95047] [MC] Reading from public effective user settings.
    22. 2018-09-13 13:56:18.544747+0300 arkitscene[448:95095] [General] Error extracting reference object: NotEnoughFeatures
    23. 2018-09-13 13:56:18.549440+0300 arkitscene[448:95047] Error Domain=com.apple.arkit.error Code=400 "Insufficient features." UserInfo={NSLocalizedRecoverySuggestion=Make sure the bounds of the object are correct, or scan the object further and try again., NSLocalizedDescription=Insufficient features., NSLocalizedFailureReason=Not enough features have been recorded to create a reference object at this position.}
    24. Failed to create ARReferenceObject.
    25. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    26. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    27. UnityEngine.Logger:Log(LogType, Object)
    28. UnityEngine.Debug:Log(Object)
    29. ObjectScanManager:<CreateReferenceObject>m__0(ARReferenceObject)
    30. System.Action`1:Invoke(T)
    31. UnityEngine.XR.iOS.UnityARSessionNativeInterface:_ar_session_ref_obj_extract_completion_handler(IntPtr, IntPtr)
    32. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    33.  
    34. 2018-09-13 13:56:29.632667+0300 arkitscene[448:95097] [General] Error extracting reference object: NotEnoughFeatures
    35. 2018-09-13 13:56:29.632903+0300 arkitscene[448:95047] Error Domain=com.apple.arkit.error Code=400 "Insufficient features." UserInfo={NSLocalizedRecoverySuggestion=Make sure the bounds of the object are correct, or scan the object further and try again., NSLocalizedDescription=Insufficient features., NSLocalizedFailureReason=Not enough features have been recorded to create a reference object at this position.}
    36. Failed to create ARReferenceObject.
    37. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    38. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    39. UnityEngine.Logger:Log(LogType, Object)
    40. UnityEngine.Debug:Log(Object)
    41. ObjectScanManager:<CreateReferenceObject>m__0(ARReferenceObject)
    42. System.Action`1:Invoke(T)
    43. UnityEngine.XR.iOS.UnityARSessionNativeInterface:_ar_session_ref_obj_extract_completion_handler(IntPtr, IntPtr)
    44. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    45.  
    46. 2018-09-13 13:57:35.729905+0300 arkitscene[448:95097] [General] Error extracting reference object: NotEnoughFeatures
    47. 2018-09-13 13:57:35.730462+0300 arkitscene[448:95047] Error Domain=com.apple.arkit.error Code=400 "Insufficient features." UserInfo={NSLocalizedRecoverySuggestion=Make sure the bounds of the object are correct, or scan the object further and try again., NSLocalizedDescription=Insufficient features., NSLocalizedFailureReason=Not enough features have been recorded to create a reference object at this position.}
    48. Failed to create ARReferenceObject.
    49. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    50. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    51. UnityEngine.Logger:Log(LogType, Object)
    52. UnityEngine.Debug:Log(Object)
    53. ObjectScanManager:<CreateReferenceObject>m__0(ARReferenceObject)
    54. System.Action`1:Invoke(T)
    55. UnityEngine.XR.iOS.UnityARSessionNativeInterface:_ar_session_ref_obj_extract_completion_handler(IntPtr, IntPtr)
    56. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    57.  
    58. (lldb)
    Code (CSharp):
    1. libsystem_platform.dylib`_platform_strlen:
    2.     0x1b185a3a0 <+0>:  and    x1, x0, #0xfffffffffffffff0
    3. ->  0x1b185a3a4 <+4>:  ldr    q0, [x1]
    4.     0x1b185a3a8 <+8>:  adr    x3, #-0xc8                ; ___lldb_unnamed_symbol4$$libsystem_platform.dylib
    5.     0x1b185a3ac <+12>: ldr    q2, [x3], #0x10
    6.     0x1b185a3b0 <+16>: and    x2, x0, #0xf
    7.     0x1b185a3b4 <+20>: sub    x3, x3, x2
    8.     0x1b185a3b8 <+24>: ldr    q1, [x3]
    9.     0x1b185a3bc <+28>: orr.16b v0, v0, v1
    10.     0x1b185a3c0 <+32>: b      0x1b185a3d4               ; <+52>
    11.     0x1b185a3c4 <+36>: nop
    12.     0x1b185a3c8 <+40>: nop
    13.     0x1b185a3cc <+44>: nop
    14.     0x1b185a3d0 <+48>: ldr    q0, [x1, #0x10]!
    15.     0x1b185a3d4 <+52>: uminv.16b b1, v0
    16.     0x1b185a3d8 <+56>: fmov   w2, s1
    17.     0x1b185a3dc <+60>: cbnz   w2, 0x1b185a3d0           ; <+48>
    18.     0x1b185a3e0 <+64>: eor.16b v1, v1, v1
    19.     0x1b185a3e4 <+68>: cmhi.16b v0, v0, v1
    20.     0x1b185a3e8 <+72>: orr.16b v0, v0, v2
    21.     0x1b185a3ec <+76>: uminv.16b b1, v0
    22.     0x1b185a3f0 <+80>: fmov   w2, s1
    23.     0x1b185a3f4 <+84>: sub    x0, x1, x0
    24.     0x1b185a3f8 <+88>: add    x0, x0, x2
    25.     0x1b185a3fc <+92>: ret
    26.  
    Code (CSharp):
    1. Thread 1 Queue : com.apple.main-thread (serial)
    2. #0    0x00000001b185a3a4 in _platform_strlen ()
    3. #1    0x00000001021c032c in il2cpp::vm::String::New(char const*) at /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/vm/String.cpp:64
    4. #2    0x0000000100cf9720 in il2cpp_codegen_marshal_string_result(char const*) at /Users/esoinila/Documents/LearnProjects/ARKit2Test/builds/rightUnityVer/Libraries/libil2cpp/include/codegen/il2cpp-codegen-il2cpp.h:550
    5. #3    0x0000000100d0ce10 in ::UnityARAnchorData_t1157236668_marshal_pinvoke_back(const UnityARAnchorData_t1157236668_marshaled_pinvoke &, UnityARAnchorData_t1157236668 &) at /Users/esoinila/Documents/LearnProjects/ARKit2Test/builds/rightUnityVer/Classes/Native/Bulk_Assembly-CSharp_0.cpp:46146
    6. #4    0x0000000100d15ad4 in ::ReversePInvokeWrapper_UnityARSessionNativeInterface__anchor_updated_m1758166972(UnityARAnchorData_t1157236668_marshaled_pinvoke) at /Users/esoinila/Documents/LearnProjects/ARKit2Test/builds/rightUnityVer/Classes/Native/Bulk_Assembly-CSharp_1.cpp:13003
    7. #5    0x00000001015317c4 in ::-[UnityARAnchorCallbackWrapper sendAnchorUpdatedEvent:](ARAnchor *) at /Users/esoinila/Documents/LearnProjects/ARKit2Test/builds/rightUnityVer/Libraries/UnityARKitPlugin/Plugins/iOS/UnityARKit/NativeInterface/ARSessionNative.mm:306
    8. #6    0x0000000101534ea8 in ::-[UnityARSession sendAnchorUpdatedEventToUnity:](NSArray *) at /Users/esoinila/Documents/LearnProjects/ARKit2Test/builds/rightUnityVer/Libraries/UnityARKitPlugin/Plugins/iOS/UnityARKit/NativeInterface/ARSessionNative.mm:703
    9. #7    0x0000000101534308 in ::-[UnityARSession session:didUpdateAnchors:](ARSession *, NSArray *) at /Users/esoinila/Documents/LearnProjects/ARKit2Test/builds/rightUnityVer/Libraries/UnityARKitPlugin/Plugins/iOS/UnityARKit/NativeInterface/ARSessionNative.mm:636
    10. #8    0x00000001ce0f8b98 in __38-[ARSession _sessionDidUpdateAnchors:]_block_invoke ()
    11. #9    0x00000001b16866c8 in _dispatch_call_block_and_release ()
    12. #10    0x00000001b1687484 in _dispatch_client_callout ()
    13. #11    0x00000001b16339ec in _dispatch_main_queue_callback_4CF$VARIANT$mp ()
    14. #12    0x00000001b1bdd1bc in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
    15. #13    0x00000001b1bd8084 in __CFRunLoopRun ()
    16. #14    0x00000001b1bd75b8 in CFRunLoopRunSpecific ()
    17. #15    0x00000001b3e48584 in GSEventRunModal ()
    18. #16    0x00000001ddde47ac in UIApplicationMain ()
    19. #17    0x0000000100ca51a4 in main at /Users/esoinila/Documents/LearnProjects/ARKit2Test/builds/rightUnityVer/Classes/main.mm:33
    20. #18    0x00000001b1697c0c in start ()
    21.  




    (note don't mind the missing images, just noticed that cant use google drive for images and can't seem to remove the google drive image links, just supposed to be 2 images in the post)

     
    Last edited: Sep 13, 2018
  22. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    Hi Esoinila,

    I have been seeing this issue as well, on and off. And I have been trying to figure out what is going on.

    If you would be able to try something and let me know if it helps temporarily, try:
    1. Uninstalling the app entirely from the iOS device.
    2. Deleting the entire Xcode project directory for the app.
    3. Re-building the Xcode project from Unity.
    4. And then, building and installing the Xcode project to the device.
    In many cases after following these steps, the issue goes away for a while, though it does eventually return.

    I am curious if the temporary work-around works for you as well.


    Todd
     
  23. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    esoinila likes this.
  24. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    rob_ice and esoinila like this.
  25. esoinila

    esoinila

    Joined:
    Apr 27, 2017
    Posts:
    8
    Nice!
    Looks like it's fixed. Scanned two objects and test detected those without problems (other than getting the box into correct position). This test was at least twice as long compared to the time it took to crash the scene yesterday on two consecutive runs. (And I didn't have time to change anything or uninstall the app etc. remedies, just append-build-and-run.)

     
    todds_unity likes this.
  26. zyonneo

    zyonneo

    Joined:
    Apr 13, 2018
    Posts:
    386
    Hi I was trying the UnityARWorldMap Serialized example.I ran on the Ipad,I placed the cube on a position with a touch and clicked save button.After Closing the app then i clicked load button and tracked the same place nothing came.Why the cube was not present at the same place.Also when I touch the save button the cube position changes to the one behind the save button .Have look at this link
    .The touch goes over the UI button even though I have added the following code to the UnityARHitTestExample script.

    Code (CSharp):
    1. using UnityEngine.EventSystems;
    2.  
    3. if (touch.phase == TouchPhase.Began || touch.phase == TouchPhase.Moved && !EventSystem.current.IsPointerOverGameObject(touch.fingerId))
    4.                 {
    5.                     var screenPosition = Camera.main.ScreenToViewportPoint(touch.position);
    6.                     ARPoint point = new ARPoint {
    7.                         x = screenPosition.x,
    8.                         y = screenPosition.y
    9.                     };
     
    Last edited: Sep 17, 2018
  27. SourceKraut

    SourceKraut

    Joined:
    Jun 27, 2015
    Posts:
    12
    Hi,
    Is there a way to get en update if an Image Anchor which is not tracked anymore? I want my objects to disappear when my marker gets lost.

    Thanks
     
    RegisVe likes this.
  28. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    jimmya likes this.
  29. RegisVe

    RegisVe

    Joined:
    Mar 2, 2018
    Posts:
    34
    Hi, I’m creating a prototype to demo several AR overlay options using the same object (just for efficiency sake).

    I'm trying to do it this way:
    Code (CSharp):
    1. public void disableMe()
    2. {
    3.  UnityARSessionNativeInterface.ARObjectAnchorAddedEvent -= AddObjectAnchor;
    4.  UnityARSessionNativeInterface.ARObjectAnchorUpdatedEvent -= UpdateObjectAnchor;
    5.  UnityARSessionNativeInterface.ARImageAnchorRemovedEvent -= RemoveObjectAnchor;
    6.  this.enabled = false;
    7. }
    8.  
    9. public void enableMe ()
    10. {
    11.  this.enabled = true;
    12.  UnityARSessionNativeInterface.ARObjectAnchorAddedEvent += AddObjectAnchor;
    13.  UnityARSessionNativeInterface.ARObjectAnchorUpdatedEvent += UpdateObjectAnchor;
    14.  UnityARSessionNativeInterface.ARImageAnchorRemovedEvent += RemoveObjectAnchor;
    15.  Debug.Log("Script was enabled");
    16. }
    These are performed in GenerateObjectAnchor.cs and calling them with buttons for different game objects with different prefabs for "Prefab to Generate" while having the same 'Reference object asset'.

    This doesn't seem to have an expected outcome and I'd like to be able to disable/enable object tracking when object not in focus (just as the post above with image tracking) but also I'm getting a crash after trying to see a second overlay variation. So basically 1st one works, then I click the button to try and see how the 2nd overlay would look like and it all goes wild :)

    Thanks!

    [edit] looking through arkit documentation I'm wondering if this is implemented somewhere: https://developer.apple.com/documentation/arkit/arsession/2865607-remove
    or am I too deep in the woods here? :)
     
    Last edited: Sep 28, 2018
  30. noseeevil

    noseeevil

    Joined:
    Oct 15, 2013
    Posts:
    1
    Hello! @todds_unity @jimmya
    I tested the UnityARObjectAnchor scene, everything works cool, but after the phone goes to sleep and wakes up, the tracking stops working, the method (in the class GenerateObjectAnchor.cs) "UpdateObjectAnchor" is no longer called.

    When I tested UnityARImageAnchor, in the same situation (when the phone wakes up after sleep) the tracking works fine.

    The only strange thing that I noticed was a sequence of calls (I attach a screenshot)

    Why tracking cannot work with ObjectAnchor after waking up the phone?

    Xcode - Version 10.1 beta (10O23u)
    IOS - 12.0 (16A366)
    Devices - iPhone 7 / iPad Pro 2nd generation
    Branch - default
    Commit - "Merged in remove-deprecated-prefabutility-api-usage (pull request #43)"
     

    Attached Files:

    Last edited: Oct 2, 2018
  31. JamesGartland

    JamesGartland

    Joined:
    Jun 1, 2017
    Posts:
    8
    Hello, I'm having trouble removing Object Anchors when I reset my AR Session.

    I have an app that uses Image Anchors with a reset tracking button that calls :

    Code (CSharp):
    1.    
    2. ARKitWorldTrackingSessionConfiguration sessionConfig = new ARKitWorldTrackingSessionConfiguration(UnityARAlignment.UnityARAlignmentGravity, UnityARPlaneDetection.None, true, true, true, UnityAREnvironmentTexturing.UnityAREnvironmentTexturingNone, 1, default(System.IntPtr), null, null, null);
    3.  
    4.         if (imgset != null)
    5.             sessionConfig.referenceImagesGroupName = imgset.resourceGroupName;
    6.  
    7.         if (objset != null)
    8.         {
    9.             sessionConfig.referenceObjectsGroupName = "";  //lets not read from XCode asset catalog right now
    10.             sessionConfig.dynamicReferenceObjectsPtr = UnityARSessionNativeInterface.GetARSessionNativeInterface().CreateNativeReferenceObjectsSet(objset.LoadReferenceObjectsInSet());
    11.         }
    12.  
    13. UnityARSessionNativeInterface.GetARSessionNativeInterface().RunWithConfigAndOptions(sessionConfig, UnityARSessionRunOption.ARSessionRunOptionRemoveExistingAnchors | UnityARSessionRunOption.ARSessionRunOptionResetTracking);
    14.  
    This effectively resets the tracking and removes all my existing Image Anchored GameObjects.

    However, I recently added Object Anchors and they're GameObjects remain after resetting the session.

    I am using the default GenerateImageAnchor and GenerateObjectAnchor scripts that come with the UnityARKitPlugin from the git repo.
     
  32. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    The difference between object anchors and image anchors currently is that image anchors are tracked while object anchors are just recognized, so updates may or may not work reliably.
     
  33. raj244u

    raj244u

    Joined:
    Feb 28, 2018
    Posts:
    4
    Hi ,
    I am using ARworldmap example in unity 2018.2.5 version.In examole load and save functionality not work.
    Using ios 12
    Xcode 10
    Please help me out and advice me ... if add any extra code for save and load data for the same.
     
  34. amasinton

    amasinton

    Joined:
    Aug 12, 2006
    Posts:
    138
    I'm back - this time about bundling a pre-made worldmap into a build.

    I have a saved .worldmap file I produced in a previous session using a different ARKit 2 app.

    I would like to include that .worldmap file in the build of a new ARKit 2 app so that when the app launches, it just loads that .worldmap file, and then tries to relocalize itself according to that file.

    Seems it's not possible to include a .worldmap file directly in the build???

    Right now the workaround is to build the app, then access the File Sharing for the device in iTunes, and to manually add that .worldmap file into the new app's Documents folder.

    Is there a way to just include this in the original build, without having to manually add the .worldmap file in iTunes?

    (If it were another kind of asset, I could just put the file in a Resources folder and use Resources.Load, but Resources wouldn't know what to do with a .worldmap file. I'm stumped.)

    Anyone have any ideas?
     
  35. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    You can place it in https://docs.unity3d.com/Manual/StreamingAssets.html
     
    amasinton likes this.
  36. zyonneo

    zyonneo

    Joined:
    Apr 13, 2018
    Posts:
    386
    @jimmya
     
  37. toniab

    toniab

    Joined:
    Jan 7, 2018
    Posts:
    1
    Hello, two things:
    1) In Build: XCode is saying [General] No resource group with name "[my object set name]" found.
    2) In Editor: why does the Camera Manager reference the StreamingAssets build path? Can't it gracefully do something other than throwing an error every time the Camera Manager's session config is accessed?
    eg. Wondering why it is fine with image anchors.
    Thanks for the info.
    T
     
  38. amasinton

    amasinton

    Joined:
    Aug 12, 2006
    Posts:
    138
  39. sabari_2

    sabari_2

    Joined:
    Oct 9, 2015
    Posts:
    10
    I am also getting the same thing. is any update on this???????
     
    zyonneo likes this.
  40. fulviobert

    fulviobert

    Joined:
    Sep 10, 2018
    Posts:
    1
    It is normal that the cube is not appearing again. Only anchors will be saved inside the .worldmap file, so when you create the cube you should attach it to an anchor:
    Code (CSharp):
    1. UnityARSessionNativeInterface.GetARSessionNativeInterface().AddUserAnchorFromGameObject(GameObject gameObj);
    )

    First save the anchor identifier string when the anchor gets created (streaming asset folder to keep it local or on a backend to implement server functionalities):

    Code (CSharp):
    1.     void Awake()
    2.     {
    3.         UnityARSessionNativeInterface.ARUserAnchorAddedEvent += AddedUserAnchor;
    4.     }
    5.  
    6.     public void AddedUserAnchor(ARUserAnchor anchor)
    7.     {
    8.         saveAnchorIdentifierSomewhere(anchor.identifier);
    9.     }


    When you will load the arkit worldmap the next session you will simply spawn the cube where the anchors appears:
    Code (CSharp):
    1.     void Awake()
    2.     {
    3.         UnityARSessionNativeInterface.ARUserAnchorAddedEvent += AddedUserAnchor;
    4.     }
    5.  
    6.     public void AddedUserAnchor(ARUserAnchor anchor)
    7.     {
    8.         if (anchor.identifier == "ID you are looking for")
    9.         {
    10.             var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
    11.             cube.transform.position = UnityARMatrixOps.GetPosition(anchor.transform);
    12.         }
    13.     }
    At least this how I did it, cheers
     
    wxxhrt, sabari_2 and amasinton like this.
  41. Scarlett199

    Scarlett199

    Joined:
    Oct 8, 2018
    Posts:
    1
    Hi all, @jimmya @todds_unity
    I am testing the SharedSpheres app. But I got a few error messages about UnityEngine.Network after importing the project:

    I am new to Unity. Any help on this would be appreciated!
     
    Last edited: Oct 16, 2018
  42. sabari_2

    sabari_2

    Joined:
    Oct 9, 2015
    Posts:
    10
    Could you please share some tutorial . How you Achieved this. Because for me i can't able to store the 3d model in AR session after Kill the application Even after i have instantiate the 3d model.
     
  43. davidcm_aby

    davidcm_aby

    Joined:
    Aug 23, 2018
    Posts:
    3
    Hi,
    Is there any roadmap or estimation about when will ARWorldMap be integrated into the package version of the plugin, and (consequently?) in ARFoundation?
    Thanks.
     
  44. amasinton

    amasinton

    Joined:
    Aug 12, 2006
    Posts:
    138
    It took me a while to test some changes I noticed in the 20 September default branch of the plugin - specifically, a note which stated it was now possible to access the points inside the worldmap itself.

    I've finally gotten round to that and it works very well - I'm super-pleased with this and would like to thank everyone developing this plugin for making this possible.

    It makes getting the real pointclouds out of ARKit viable - which is a good thing since they can differ from the pointclouds generated by/on the camera (for the camera pointclouds, see my post, quoted above).

    So, now you can access the worldmap's pointCloud.points array without insta-crash. This means you don't have to copy points every frame from the camera's pointcloud to a Vector3 List in order to write out a text file of coordinates which you can then use in other software for the purposes of aligning virtual content to the worldmap of a specific space (does any of that make sense?). You can just write out the points array directly. Which is a good thing for many reasons.

    Thank you, again!
     
    NAKAS and rob_ice like this.
  45. brendanluu

    brendanluu

    Joined:
    Jan 5, 2017
    Posts:
    7
    Do you mind sharing the project you figured this out with? I'm having trouble figuring out how to load MyFirstWorldMap.worldmap back into Unity to add persistent content to.
     
  46. sabari_2

    sabari_2

    Joined:
    Oct 9, 2015
    Posts:
    10

    @fulviobert Thanks for the input :) .i can Achieve AR persistence with 3d models. And i can able to save and load the small CUBE 3d models in the world space. Thanks once again:).
     
  47. sabari_2

    sabari_2

    Joined:
    Oct 9, 2015
    Posts:
    10



    Is it possible to Do this Kind of applications using ARKIT AR persistence????????? . Because i can able to Save and Load small 3d models in world space. But How I can Make this kind of Real size 3D Room models to Exactly fit in to Real world and i can save and reload again???????????????? . Thanks in advance:)
     
  48. mp-paramlabs

    mp-paramlabs

    Joined:
    Oct 31, 2017
    Posts:
    9
    we were testing this on concept purpose. we stored the prefab positions and rotation(if necessary) in json file and stored along with worldmap. and when we load world map we instantiate that prefabs from json read and give them position and rotations.
     
  49. sabari_2

    sabari_2

    Joined:
    Oct 9, 2015
    Posts:
    10
    thank you :)
     
  50. yjcnbnbnb200

    yjcnbnbnb200

    Joined:
    Nov 1, 2017
    Posts:
    25
    Hi superman, I bought iPad 2018 and can't use ARKitRemote, so the bug is from Unity or ARKitPlugin? Or is my fatal? My remote app on ipad show image in a flash and then exit, close...