ARKit 2.0 Beta support

Hi folks,

Many of you have asked about ARKit 2.0. Apple announced it and released Beta today. We’re right there with them - for example the Lego app that was shown at the keynote uses the version of the plugin that we’re releasing to all developers today.

First a little intro: Unity Blog

As pointed out, we have uploaded the code to Bitbucket, but it is in a branch since this is a Beta release:
https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/src/arkit2.0_beta/

If you would like the latest version of the code packaged up into a zip: https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/get/arkit2.0_beta.zip

There is a bit of documentation in the https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/src/arkit2.0_beta/docs/WhatsNewInARKit2_0.md file. (needs a bit more work)

Hope you have fun with it, and let us know if there are any issues or things that could be better.

17 Likes

Very much looking forward to checking this out! Thanks for posting about it here also

Awesome. Thanks for being on top of this!

I’m running into an issue when trying to use Image Anchors with this new ArKit2.0 plugin. I had it working in ArKit 1.5. I’m getting these errors when running on device via XCode 10 Beta.

The error claims the defined images either are not 100px big, or do not have a physical size defined. Image anchors do indeed meet the mentioned requirements of pixel size and physical size set in the project.

2018-06-05 16:02:46.094761-0700 arkitscene[866:87857] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-06-05 16:02:46.094971-0700 arkitscene[866:87857] [MC] Reading from public effective user settings.
2018-06-05 16:02:46.102191-0700 arkitscene[866:87857] [framework] -[CUINamedRecognitionGroup initWithName:contentsFromCatalog:usingRenditionKey:fromTheme:] couldn't find object named 'unitywhiteonblack' skipping
2018-06-05 16:02:46.102563-0700 arkitscene[866:87857] [framework] -[CUINamedRecognitionGroup initWithName:contentsFromCatalog:usingRenditionKey:fromTheme:] couldn't find object named 'unitylogoreferenceimage' skipping
2018-06-05 16:02:46.449096-0700 arkitscene[866:88078] [Technique] Could not add planar object for detection: <ARReferenceImage: 0x2808a3930 name="unitylogoreferenceimage" physical-size=(0.000, 0.000)> Reason: 4
2018-06-05 16:02:46.449131-0700 arkitscene[866:88078] [Technique] Could not add planar object for detection: <ARReferenceImage: 0x2808af750 name="unitywhiteonblack" physical-size=(0.000, 0.000)> Reason: 4
2018-06-05 16:02:46.449314-0700 arkitscene[866:88078] [Session] Session (0x1059caad0): did fail with error: Error Domain=com.apple.arkit.error Code=300 "Invalid reference image." UserInfo={NSLocalizedFailureReason=One or more reference images have an invalid size: unitylogoreferenceimage, unitywhiteonblack, NSLocalizedRecoverySuggestion=Make sure that all reference images are greater than 100 pixels and have a positive physical size in meters., ARErrorItems=(
unitylogoreferenceimage,
unitywhiteonblack
), NSLocalizedDescription=Invalid reference image.}
2018-06-05 16:02:47.713616-0700 arkitscene[866:87857] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-06-05 16:02:47.714408-0700 arkitscene[866:87857] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-06-05 16:02:57.480662-0700 arkitscene[866:87989] [BoringSSL] Function boringssl_session_errorlog: line 238 BoringSSL [C2.1:2] [0x105acf760] [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
2018-06-05 16:02:57.481573-0700 arkitscene[866:87989] [BoringSSL] Function boringssl_session_errorlog: line 238 BoringSSL [C2.1:2] [0x105acf760] [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert

EDIT: This also happens when I publish the provided UnityARImageAnchor scene straight from the project as it is downloaded without any modifications on my end.

EDIT 2: Confirmed this happens in the same version of Unity the downloaded package was created with (2017.4.4f1)

FINAL EDIT: When removing all image anchors from the Resource set, I finally can get camera feed and the testing cube gameobject. Seems to be some problem in the way its creating those assets on build in Xcode?

1 Like

@ifeltdave

the error message is a bit missleading. Try setting your Deployment Target (in Unity or later in Xcode) to 12.0. This fixes the issue for me.

4 Likes

Had custom written something that sets reflection probes based off the camera feed, however the new ARKit 2.0 version of custom location based reflections works much smoother - thankyou very much!

Thanks for implementing ARKit 2.0!

BUG Report: I made a quick ARKit 2.0 app yesterday in Unity 2018.1.3f1 - When tried to compile in Xcode 10 beta, I had errors relating to my signing certificate and provisioning profile. I tried a bunch of times with out success (used multiple pre-existing profiles that I know work too). In the end, I rebuilt the project in Unity Unity 2017.4.2f2 and that build worked with Xcode 10 beta. ¯_(ツ)_/¯

I’ll likely step back one version from 2018.1.3f1 for a test build; I was just in a rush yesterday.

Cheers,
Elliott

2018.1.0f2 seems to be working fine on our dev mac - having fun with the new features also!

1 Like

@
I was testing with worldmap demo. I want to know that how can i extract anchors from saved worldmap.

2 Likes

I am compiling the ARkit 2.0 examples with Unity 2018.1.3f1 and XCode 10, and all apps are crashing upon launch. I changed deployment target to 12, and that didn’t work.

Could this be a Unity version issue? What’s the latest version of Unity that I can use that is compatible with ARkit 2.0?

Thanks!

I had issues with Unity 2018.1.3f1 too. I suspect it’s a Unity bug. rob_ice mentioned it works with 2018.1.0f2. I suspect there will be a fix in 2018.1.3f2 (or whatever is next).

1 Like

Made a shared AR multiplayer example using the plugin and UNet. Uploaded to GitHub - Unity-Technologies/SharedSpheres: An example project to demonstrate an AR shared multiplayer experience using Unity ARKit Plugin for ARKit 2 and UNet . See it in action here: x.com

6 Likes

@jimmya is persistent ar possible with v2.0? I would like to save placed objects and surrounding features in a file and it can be loaded for future sessions.
So far I’ve been able to get only horizontal and vertical planes from UnityARWorldMap scene.

Yes you can do it. For all the virtual objects, you would save their positions and rotations in your current coordinate system along with the ARWorldMap (possibly in a json file that describes the prefabs they use and their position and rotation). Then after you have relocalized with the ARWorldMap, just instantiate and position the virtual objects as before, and they will be in the right places.

2 Likes

Have you found a solution? I have the same problem. Can’t get a ARKit build with Xcode 10 on an iOS 12 device.

This is great. So glad to be able to play with these new features right away in Unity.

is there any tutorial on how to create my own object as .arobject in object detection example scene. i tried using object scanner scene. but i don’t know how to achieve it. thanks in advance:)

Multiuser AR experiences mean only two users or many users can play the same ar?

Thanks @jimmya , that’s the one way to do it.
But worldmap documentation says Anchored objects(feature points or virtual contents) are also saved. so does the current version expose a way to do that? and what is the way to add an anchor to instantiated object?

1 Like

Hello,

I am trying to compile the object tracking scenes and I am gettings errors on Xcode like -

Use of undeclared identifier ‘ARWorldMap’
Use of undeclared identifier ‘ARReferenceObject’
Unknown type name ‘ARWorldMap’

Any ideas?