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. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Hey,

    How to make " AR Quick Look Gallery " like app in unity?
    I Want to make Function like user have AR mode on/off button where a user can easily switch between AR & NonAR mode With Smooth transition.
     
  2. dnoparker

    dnoparker

    Joined:
    Aug 28, 2013
    Posts:
    63
    I am getting this error when using one of the example scenes (object tracking)


    It is causing the app to stutter a bit.

    Any ideas?
     
  3. imaginethepoet

    imaginethepoet

    Joined:
    Aug 23, 2016
    Posts:
    44
    What branch is the correct branch in the bitbucket now? I update and pulled, because the lead post says to use a new code, but everything is older than a month ago. Also updating my Xcode to beta 10 b5. Thanks.
     
  4. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Hey,

    When I enable Use HDR in graphics setting my app getting crashed.
     
  5. ThoHer

    ThoHer

    Joined:
    Feb 27, 2018
    Posts:
    13
    Is there a possability to activate/deactivate the arkit when it isnt needed in my app? I wrote question #2738 but sadly there was no respond to.

    Thank you very much!
     
  6. dnoparker

    dnoparker

    Joined:
    Aug 28, 2013
    Posts:
    63
    I think you can go into the ARCameraManager and play about with the UnityARSessionNativeInterface to get it to pause.
     
  7. ThoHer

    ThoHer

    Joined:
    Feb 27, 2018
    Posts:
    13
    @dnoparker

    Thank you very much i will try it out tomorrow!
     
  8. LuizBeenoculus

    LuizBeenoculus

    Joined:
    May 17, 2018
    Posts:
    11
    Its possible to connect with a Windows pc?
     
  9. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    In my project I turn on/off AR session several time, but I got some glitching on 1st session start attempt, and that looks really weird - UI screen in blinking many times a frame even if there is no animation os some CPU consuming operation.
    All other session start attempts are going well, just some micro lag but it's not a problem at all.

    How to handle this? I assume the option could be to start session on start, and pause it immediately and trigger session start with new options when needed but I would prefer do not start session at all if that will not be needed 100% to save battery.
     
    SourceKraut likes this.
  10. nerial

    nerial

    Joined:
    Jul 3, 2012
    Posts:
    2
    Excellent plug-in, amazing. I had a question too regarding optimization. I'm using facedetection in a way that doesn't require a high frequency. Is there a way to tune the frequency at which the plugin pushes events like ARFaceAnchorUpdatedEvent? Thanks.
     
  11. kengorou2014

    kengorou2014

    Joined:
    Jun 12, 2018
    Posts:
    8
    Hello
    I have been in Unity for three months and I have a lot of unknown things so I will ask you a question.
    I am trying to realize multiplayer using a serialized arworldmap. I load arworldmap saved in my iphone beforehand, convert it to byte [] and try to share it with photon, but byte [] is different from what was saved in iphone. It is confirmed that byte [] has not changed before and after sending / receiving with photon.
    Code goes like this.
    In this code, errors do not occur in remoteworldmap.center, remoteworldmap.extent, but an error occurs after that.
    Code (CSharp):
    1. ARWorldMap localworldMap = ARWorldMap.Load (worldpath);
    2. photonView.RPC ("ReceiveWorldMap", PhotonTargets.OthersBuffered, worldMap.SerializeToByteArray ());
    3.  
    4.     [PunRPC]
    5.     void ReceiveWorldMap (byte [] world_bytes) {
    6.         ARWorldMap remoteworldmap = ARWorldMap.SerializeFromByteArray (world_bytes);
    7.  
    8.         if (remoteworldmap! = null)
    9.         {
    10.             m_LoadedMap = remoteworldmap;
    11.             Debug.LogFormat ("Map loaded. Center: {0} Extent: {1}", remoteworldmap.center, remoteworldmap.extent);
    12.  
    13.             UnityARSessionNativeInterface.ARSessionShouldAttemptRelocalization = true;
    14.  
    15.             var config = m_ARCameraManager.sessionConfiguration;
    16.             config.worldMap = remoteworldmap;
    17.             UnityARSessionRunOption runOption = UnityARSessionRunOption.ARSessionRunOptionRemoveExistingAnchors | UnityARSessionRunOption.ARSessionRunOptionResetTracking;
    18.  
    19.             Debug.Log ("Restarting session with worldMap");
    20.             session.RunWithConfigAndOptions (config, runOption);
    21.         }
    22.     }
    Please tell me a nice way.
     
    Last edited: Aug 17, 2018
  12. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    No - this is determined by the ARKit SDK.
     
  13. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    do you want to be serializing to byte array localWorldMap instead of worldMap?
     
  14. gothParrot

    gothParrot

    Joined:
    Aug 8, 2018
    Posts:
    3
    Hi, thanks for maintaining this thread!

    My issue is that the worldmap is constantly "ARWorldMappingStatusNotAvailable", when I use an ARKit Remote to test the scene, however long I map the area. Even happens when testing the example UnityARWorldMap scene.

    However, when I compile my app into an iPhoneX with iOS 12 beta, I am able to save the worldmap and use it.

    Does it mean I can't test WorldMap with ARKit Remote? That'd be quite frustrating, having to build the app again and again... hopefully I'm doing something wrong.

    I'm working with ARKit 2.0 beta, Unity 2017.4.4f1, Xcode 10 beta, on an iPhone X with iOS 12 beta.
     
  15. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    No you're quite right - ARKit Remote has not implemented Editor side ARWorldMap support. It will be implemented when we can get some more dev time on it.
     
    gothParrot likes this.
  16. kuravista

    kuravista

    Joined:
    Jun 21, 2012
    Posts:
    4
    Is there anyone successfully Build ARkit in VR mode (cardboard sdk or else) ?

    I have followed this step. but the tracking position 3d when vr mode is still incorrect.

    I've also disabletracked (https://docs.unity3d.com/ScriptReference/XR.InputTracking-disablePositionalTracking.html). still not working :(

    Please advice & help :(
     
    Last edited: Aug 23, 2018
    SourceKraut likes this.
  17. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Hello
    How do you stop detecting and generating planes? I haven figured this out, I tried:
    Code (CSharp):
    1. UnityARCameraManager arCamera;
    2.  
    3. public void planeDetectionOFF() {
    4.         arCamera.planeDetection = UnityARPlaneDetection.None;
    5.         arCamera.getPointCloud = false;
    6. }
    But this is not working

    Thanks a lot for any help.
     
  18. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Those just change the configuration - you will need to reset the session with that configuration.
     
  19. krisventure

    krisventure

    Joined:
    Mar 24, 2016
    Posts:
    118
    We have just submitted a new Arkit app and of course it had the 'arkit' framework added which is usually sufficient to prevent it from being accessible for unsupported devices. Indeed, for us when we try to download it on an old iPad Air 2 model which has no A9 processor, TestFlight prevents downloading and installing it which is good. However, to our surprise Apple rejected the app saying that it crashed on an iPad Air 2 'when Home Button pressed'. The crash log didn't include any error related to our game code but we haven't even started to investigate much because we first want to understand how Apple could even install it on an iPad Air 2 at all, when it wasn't possible for us. How does the arkit framework define the list of supported models, by model types or somehow checking the processor if it's at least A9? Should we try and add some code to manually exclude all iPad Air 2 models?
     
  20. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199
    Not finding anything in the topic regarding my issue, so: I install the plugin using the package manager (latest stable unity), it appears in the package folder, but nothing appears in the assets. What should I do at this point?
     
  21. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    we do not have a package for this plugin yet - you are probably installing the ARKit package that supports ARFoundation. download the independent plugin at https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/src/default/

    And to learn more about ARFoundation, see this forum: https://forum.unity.com/forums/handheld-ar.159/
     
    unnanego likes this.
  22. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Check the boc "App Requires ARKit" in the settings file described here: https://forum.unity.com/threads/sub...re-without-face-tracking.504572/#post-3297235
     
  23. dmitry-K

    dmitry-K

    Joined:
    Apr 2, 2014
    Posts:
    26
    Can i get texture from UnityArVideo same as i get it from WebCamTexture?? So could put it on raw texture and use surface shader on it.
     
    Last edited: Aug 30, 2018
  24. mak3r76

    mak3r76

    Joined:
    Sep 14, 2016
    Posts:
    18
    Is it possible to recognize an image without using tracking the image? I want to recognize a house in a longer distance and want to show up some objects/infos about it. But when I move the device, the objects are flickering around. So the objects has to be fixed in the scene.
     
  25. mathewsbabu

    mathewsbabu

    Joined:
    Sep 30, 2014
    Posts:
    33
    In the example "SharedSpheres"(https://github.com/Unity-Technologies/SharedSpheres) its taking too much time for relocalising. ARTrackingState is shown as "Limited" and it never enters "normal" state.Sometimes it works..Most of the time it doesn't..
    Any info on that??
     
  26. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    Are you helping the relocalising process by moving your phone? For mapping to work you need to move the phone, rotating isn't good enough. For the relocalising to work, the world maps also need to bu sufficiently similar. In one of the wwdc conference it's even suggested to send a photo of the position of the other user, so the person that tries to start a session with this world map can move to the same position.
     
    jimmya likes this.
  27. mathewsbabu

    mathewsbabu

    Joined:
    Sep 30, 2014
    Posts:
    33
    How much do we need to move..We are using 2 iPads for testing..Does the Scanned ARWorldMap affect this relocalising ..I mean the number of points tracked..

    And also in that example why we need to map the area in 2 device..Scanning and sending it to other devices should work right??
     
    Last edited: Aug 30, 2018
  28. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Read @MrMatthias reply above and check out this page https://developer.apple.com/documentation/arkit/creating_a_multiuser_ar_experience?language=objc.
    Mainly, the time it takes to relocalize is dependent on how much data you have about the area you're in - if you scan for a longer time and your ARWorldMapStatus goes to Extending multiple times, the better the data available to relocalize. Yes you are right that you only need one device to scan and send the data, but we just wanted to make the example symmetrical.
     
    SourceKraut likes this.
  29. ZYSHAQ

    ZYSHAQ

    Joined:
    Jun 26, 2015
    Posts:
    76
    A question: How can I take a photo using iPhone camera (not a screenshot) while having Apple ARKit video playing in as a background (or enabled)? If I enable the Webcam, it crashes!

    I am trying to capture a Full Quality Image. If not, Is there is a way to capture YUV info for the frame, and, convert it to RGB? Or Does Apple ARKit provide a functionality to do so?
     
  30. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    I'm not sure what you're trying to achieve - using the screenshot functionality in iOS will give you as high a quality of an image that you can get. ARKit takes over your camera and adjusts the input resolution, so unless you turn off ARKit, you cannot get a higher resolution than is displayed.
     
  31. farazs

    farazs

    Joined:
    Dec 7, 2016
    Posts:
    10
    I am experiencing some issues in ARkit 1.5 Image anchor.
    When ever i scan the marker, it tracks the marker and assign the 3D object above it. But the issue is that the orientation is not same. Each time it scans, the rotation of the object is different.
     
  32. farazs

    farazs

    Joined:
    Dec 7, 2016
    Posts:
    10
    Hi,
    The Field of view of the camera is not correct in iPad 2018 (9.7)- Camera resolution is 720p even I am using iOS 11.4
    Camera looks zoomed in. While it worked fine in my iPhone 7plus. - Camera resolution is fine in iPhone 7plus(Full HD).
     
  33. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    think about it this way, you stand somewhere lost in a city and have no idea where you are. Then someone send you a map, but this map won't make any sense to you until you can map it to the real world. You compare features like landmarks, compass, streetnames to figure out where in this map you are. ARKit will have to do the same with the worldmap it received. the landmark and streetname features are just a point cloud of well distinguishable features. The received worldmap has no connection to reality, so the second device needs to scan the world to find the features represented in that received worldmap and map tem back to reality
     
  34. mathewsbabu

    mathewsbabu

    Joined:
    Sep 30, 2014
    Posts:
    33
    Thank you very much..Now its relocalises easily.
     
  35. mathewsbabu

    mathewsbabu

    Joined:
    Sep 30, 2014
    Posts:
    33
    Thanks a lot @MrMatthias
     
  36. janla

    janla

    Joined:
    May 8, 2013
    Posts:
    15
    Hello there,

    I'm running into problems with the ARKit 2 Object Scanner scene. When I build it on my iPhone X (iOS 11.4.1) the screen stays black at first and when I press "Start Detecting" button i can see a camera image but the tracking doesn't seem to work. I can see the yellow dots appear statically at the bottom of the screen but it seems as if the Unity cam is not moving accordingly.
    The standard sample scene works fine.

    This is the output I get from xCode (10.0 beta 6)

    Code (CSharp):
    1. 2018-09-11 09:17:38.426687+0200 arobjectscanning[847:209903] [Unknown process name] CGAffineTransformInvert: singular matrix.
    2. 2018-09-11 09:17:38.426828+0200 arobjectscanning[847:209903] [Unknown process name] CGAffineTransformInvert: singular matrix.
    3. 2018-09-11 09:17:38.592757+0200 arobjectscanning[847:209903] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    4. 2018-09-11 09:17:38.593509+0200 arobjectscanning[847:209903] [MC] Reading from public effective user settings.
    Any help would be much appreciated!
    Thanks!
     
  37. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    You will need iOS 12 beta 12 on your phone to test object scanning - it does not exist in previous versions of iOS.
     
  38. janla

    janla

    Joined:
    May 8, 2013
    Posts:
    15
    Thanks!!! it works now
     
  39. AlexiJohansen123

    AlexiJohansen123

    Joined:
    Apr 5, 2016
    Posts:
    17
    I am working on an ARKIT Project where I need to turn off the Video feed occasionally. I've tried several dings but the way the Camera feed ends up to the screen is a bit of a mystery to. Am I going to have to remove and recreate those buffers every time I want to switch on/off the feed?
     
  40. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    One simple way might be to disable the UnityARVideo component on the Camera whenever needed.
     
    SourceKraut likes this.
  41. paulogodinhoaq

    paulogodinhoaq

    Joined:
    Aug 22, 2018
    Posts:
    5
    I am trying to use the AR Kit remote, but after connecting to unity it crashes after one second trying to deallocate a null pointer. Before that just a bunch of logs saying that the receiver could not handle the amount of data going through.

    Currently trying to install XCode 10 to try with the latest from bitbucket, I was using the Asset Store one with unity 2018.2.6
     
    adammpolak likes this.
  42. AlexiJohansen123

    AlexiJohansen123

    Joined:
    Apr 5, 2016
    Posts:
    17
    Disabling/enabling the UnityARVideo component didn't work for me.

    I'm not using the latest ARKit plugin from bitbucket though. I do not have IOS12 Beta installed and thus the latest from bitbucket didn't work for me.
     
  43. uniLogix

    uniLogix

    Joined:
    May 24, 2015
    Posts:
    12
    Urgent HELP required.
    Issue:
    Model appears automatically on horizontal plane recognition.
    Required:

    I want to tap on screen to deploy Model. Any helping material?
    Thank you
    Also I want to apply texture or color to detected horizontal surface.
     
  44. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Look at UnityARKitScene example - look at HitCube (uses UnityARHitTestExample script)
     
  45. uniLogix

    uniLogix

    Joined:
    May 24, 2015
    Posts:
    12
    Thank you, I will be doing it now..
     
  46. tammymin

    tammymin

    Joined:
    Apr 2, 2013
    Posts:
    3
    HI,When to support opengl2.0, 3.0.
     
  47. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
  48. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
  49. John1515

    John1515

    Joined:
    Nov 29, 2012
    Posts:
    248
    Hi! Was wondering what is the best way to create multiplayer with AR now that Unet is on its way out and Google services will replace it?
     
  50. John1515

    John1515

    Joined:
    Nov 29, 2012
    Posts:
    248
    I think this is by design, done by Apple. The did do something to iPad I believe. I also think it's weird.
     
Thread Status:
Not open for further replies.