M. Garrigues
M. Garrigues

Reputation: 87

ARKIT - How can I make sure ARKit is calibrated?

I am making a simple ruler ARKit app in swift 4.

But I came across the problem that sometimes, my measures are a bit or completely off. Which, I think, is probably due to ARkit being badly calibrated and not detecting my surface correctly.

I currently project 4 points in 3D, and want to make sure the measure I get with them is correct, or at least coherent. Is there a standard way to do that?

Thanks in advance

Upvotes: 2

Views: 863

Answers (2)

M. Garrigues
M. Garrigues

Reputation: 87

I found a decent way of doing this, by having a threshold on the number of FeaturePoints detected in my frame by Arkit.

For example, if frame.rawFeaturePoints?.points.count returns something higher than my threshold (I personally use 50, but that mostly depends on the distance you will usually be from your target), I estimate my app is calibrated.

Upvotes: 2

Alan S
Alan S

Reputation: 594

Maybe not a standard way but the way I went about it was by performing hit tests every half a second or so until the hit test actually returned something. Once it did, I at least knew the AR had been calibrated.

Upvotes: 2

Related Questions