ARFoundation Place on Plane unstable

Hello.
I would like to know if you know any technique to improve stability by placing an object on the plane in ARFoundation. Compared to other AppStore games (The Machines) using the same place to place an object, same light… My project I’m developing sometimes floats in the air and vibrates constantly.
It takes a while to stay still but it’s not very stable.
This does not always happen so exaggerated, but I never get it to be placed without moving on its own.

Any suggestions?
Thanks a lot!

2 Likes

I have the same problem. I checked how other iOS and Android AR apps worked under the same lighting conditions, and once those apps find a plane, it’s so stable. I don’t really know if it’s a Unity issue because Unity AR Kit is performing poorly as well. We would like to know what is causing this because AR Foundation is extremely unstable…

Hi,

I also have this issue. When using ARCore plugin without ARFoundation i have better tracking than with ARFoundation.

2 Likes

It seems that the new Arkit plugin for unity is more stable

https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/src/arkit2.0_beta/

Until ARFoundation stabilize it a little, the same is good alternative

3 Likes

I understood ARFoundation is a layer on top of the Unity ARKit plugin… ? Does this mean the ARKit “package” we are using with ARFoundation is out of sync with the ARKit Plugin available via BitBucket that you mention here?

Why would it not be as stable in terms of tracking… surely ARFoundation sits on top of ARKit… isnt that the idea of it?

I’m using ARFoundation for its scaling functionality… anyone implement their own scaling with ARKit plugin outside of ARFoundation? I didnt read too much into it (ie. the blog/gdc vids)… as I expected ARFoundation to work… .but I’m not happy with its performance to date and the lack of response on this forum from Unity.

Cheers guys

1 Like

Guys, let’s all try this. Set both ARSession Origin and AR Camera rotation/position values to 0 (for x, y, and z). And check how stable it is. Because for me, it’s kind of getting a lot more stable. Let’s check this out as a community. Thanks :slight_smile:

ARSession & ARCamera was already at 0,0,0 for me. I think having ARSession / ARCamera different than 0,0,0 would cause the scene to shift.

1 Like

My project was not set to (0, 0, 0), and I think it’s because the GitHub sample does not set it to (0, 0, 0) to begin with. So, the first step would be to set both AR Session Origin and its child Game Object(AR Camera) to (0, 0, 0). That improved things a lot for me. I wonder if other people have different suggestions? I have read that AR Foundation sets the frame rate to 30 on iOS devices unlike AR Kit. Might that affect things? What else could help us improve the stability?

Hey
I cant try this as I am using the scale functionality and that moves the ARSession Origin as part of its logic anyway

But on another note, it might be worth setting the target frame rate for IOS to 60… apparently ARKit tracks better at 60fps?

https://github.com/Unity-Technologies/arfoundation-samples/issues/9

Up until you find a plane, try setting everything to (0, 0, 0). Afterwards, of course, with scaling, it will get changed. I am referring to that initial ground/vertical plane detection part.

Second, I tried setting the target frame rate to 60 FPS, seems to help a bit as well.

1 Like

Hey!

I have been experimenting and testing with different versions of the plugin ARKit (ARFoundation, Unity ARKit plugin…)

I think the problem of tracking, that objects vibrate when placed on a surface and all these problems we have can be due to scaling objects especially when they are very large objects that we want to reduce using the option of scaling.

Maybe I’m wrong, I’m just trying.

Do any of you have problems without scaling objects?

With the old plugin ARKit I put the same object on the surface but with the difference that I reduce the scale of the object itself (which is a bad practice for physics issues) but at the time I put the object in the plane , it’s not moving, it’s very stable.

So I said in the previous post if it can be problems of the double camera, scaling objects etc…

I’m sorry, but I’m a little desperate about this

Best regards

The only plausible insight I have is this. You are detecting a ground plane, and let’s say its area is 3 m^2. And the placed content area is 15 m^2. I think there is something going wrong there when that is the case. I wonder if tracking is stable only within the bounds of the plane. But I am not sure about this…

Hey guys

Ok, I did a load of testing on IOS today… building different combinations of the elements we are using, specifically:

Target Frame Rate
ARFoundation Ver
ARKit Ver
IOS Ver
Target Build IOS Ver

… I dont think these items are mutually exclusive when you look at how they are provisioned in the build and run on a device… so it does make sense to me that they need to be married up.

(Note: I am using scaled content… in ARFoundation… using scale of ARSessionOrigin)

What I was hoping to identify was the crash @dyuldashev has been having and the tracking issues myself and @Edur-Games are having.

@dyuldashev Re: The Crash going between non AR and AR Scenes…

I wasnt having that on Android, but did have the issue on IOS after I upgraded the ARKit Package to v.16. (I was running 14). (Note: I did not try 15). The target IOS ver in build settings also impacts this.

@Edur-Games I was having similar tracking issues to you on IOS… floating objects and general jittering… sometimes it was the entire camera render image jittering too… not just the placed object. It seems to be a combination of ARFoundation ver and IOS ver. (eg. ver 19 is pretty bad on IOS 11 and 12)

I wont detail ALL the combinations/permutations of versions I tried… but the one that resolved 90% of issues is: (Testing on iPad 9.7 2017)

xCode 10
Target Frame Rate 60FPS (just popped Application.targetFrameRate = 60; in the awake function of an object in the AR Scene)
ARFoundation Package 18
ARKit Package 14
IOS device 12
Target IOS ver in build settings 12 (this does make a difference)

You want to try that combo and let me know if its sorts things for you guys too… Changing any one of these will introduce some form of the probs we are having. But having a stable build does allow us upgrade/change a single element to see what breaks.

I am currently running > Unity 2018.2.6

@dyuldashev I will keep this discussion here re: crash… I know you’ve another thread going, so if this solves it, I have linked between the threads

1 Like

This is a long thread, and thanks a lot for this amazingly helpful research. We know that it is not a complete fix for the bug, but, in my case, it’s good enough for now. Here’s what worked for me:

  • AR Foundation 1.0.0 preview 1.8
    -ARKit XR Plugin 1.0.0 preview 1.5
    -XCode 10…iOS 11 && iOS 12 both worked
    -iPad 2017

As for the jittery tracking, download a well known AR Kit app from the App Store. And try to see how it works in your environment. If a few of those apps are jittery as well, there is nothing to worry about. It just means that you have to place your content under acceptable lighting conditions.

Also, I will try to disable planes from being generated, and I think it’s causing a frame rate drop sometimes in one of my scenes.

Thats good to hear… I’ll upgrade to ARKit 15 and target ios11 and confirm its good my end. Might point to crash being specific to Arkit 16.

@dyuldashev what ver of Unity did you use

Thanks

1 Like

Unity 2018.2.11f1

1 Like

I think the issue with AR Foundation 1.0.0-preview 1.9 is the addition of the new Camera API. I don’t think that they synced everything properly between AR Foundation and AR Kit when they added the new API. @tdmowrer , I saw that you were answering questions about the new Camera API, would you please take a look at this as well? Thanks.

1 Like

Hey @dyuldashev I updated to ARKit 15 and appears to work ok targeting 11 & 12.
The experience is still not perfect, but we’re getting there.
Thanks

1 Like

I wonder which one is better in your case, 1.4 or 1.5?
I have one more recommendation, but it might be very time consuming.
You could try updating to the latest version of Unity to see whether it improves tracking or not:
https://unity3d.com/get-unity/update

@dyuldashev Yeah I think I’ll upgrade unity next and test both ios and android builds.
Im pretty good on android at the moment… and ios has improved, but the object still doesnt anchor immediately when placed… it floats for about 2-3 secs. Its not the content Im placing as I have tested with a simple cube. It did appear to happen when I introduced the code to turn of the plane manager. I will remove that and retest too.

I cant debug in xcode at the moment as my cable is acting up… i’ll source a new one

How is your build behaving