1

This is a follow up question to one of my previous posts. Currently, I am placing a SCNNode at a known coordinate in the real world. My application requires the user to avoid using plane detection or a hit-test, rather that they can place an object at a known coordinate and hope it stays anchored at that position.

Currently, the performance of the anchoring is suboptimal and I would like to find ways in order to improve it. I am up for any suggestions if possible.

Thanks in advance!

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
sptrad
  • 49
  • 1
  • 5

1 Answers1

1

ARKit 4.0 solution

In the latest version of ARKit there are GPS location anchors called ARGeoAnchor (which works thanks to the implementation of CoreLocation framework) that uses familiar initializer:

@nonobjc convenience init(coordinate: CLLocationCoordinate2D, 
                            altitude: CLLocationDistance?)

ARKit 3.0 solution

Of course, you can place a model in AR scene without plane detection and hit-testing/ray-casting, although this might cause some AR anomalies – your model might be placed below scene's grid or model might be placed at a wrong location what leads to incorrect parallax.

There's one thing your scene must always have – an anchor for your model. Without that anchor your model may float in a scene what leads to poor user experience. In plane detection's case you automatically get ARPlaneAnchor tethered to invisible plane.

Thus, let's see what approaches you have to implement to get a robust AR experience, even if you do not use a plane detection and hit-testing:

You can use these approaches separately or in combination.

But there is one unpleasant thing you must know about – a working distance for models in ARKit / SceneKit is up to 1000 meters. If your model goes beyond that limit you'll get flickering artifacts.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • Thank you for the reply Andy! Currently I am using the gravity and heading compass alignment which I know has improved the overall results. If you don't mind, what are the necessary steps required in order to use GPS and Google maps and how does it improve the anchoring process? Furthermore, in regards to the surrounding objects detection algorithm, do you have any sources that explain the process of the basic methodology? Sorry I've never thought of using these solutions before, so I have little to no knowledge on them. Thanks in advance! – sptrad Mar 02 '20 at 07:28
  • @sptrad, I've updated my answer (these links are quite useful). – Andy Jazz Mar 02 '20 at 10:58