Hi,
I'm trying to test object recognition using ARKit. I scanned a couple of objects using the Apple demo app, copied the .arobject
files to my laptop.
I added them to my new project in Assets like shown in the image.
However, as I follow the tutorial to load these objects to use as reference objects, I run into an error.
let configuration = ARWorldTrackingConfiguration()
guard let referenceObjects = ARReferenceObject.referenceObjects(inGroupNamed: "Test", bundle: Bundle.main) else {
let ro = ARReferenceObject.referenceObjects(inGroupNamed: "Test", bundle: nil);
let ro1 = ARReferenceObject.referenceObjects(inGroupNamed: "Gallery", bundle: .main);
fatalError("Resource not found")
}
Here, we fail the guard statement and the ro
and ro1
both are set to nil.
I created a new project with just this one statement and that fails too.
I'm using SwiftUI instead of UIKit if that makes a difference and am calling this in the makeUIView()
function .
Any pointers to what I might be doing wrong here are appreciated.