Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS ARKit state (cameraDidChangeTrackingState) stuck in initializing, doesn't track

Tags:

Apologies for the newb question in advance (can't find it elsewhere on SO), but has anyone had problems in getting any and/or all the ARKit demos to initialize?

Take for example, the default / vanilla app - what you get when you create an empty ARKit project. What I see is the ship hovering above the default view port, and when I pan, it stays pretty much centered in the viewport and not fixed in space, I cannot move above or to the sides of the spaceship. When I look at the camera state property in cameraDidChangeTrackingState, it shows "limited / initializing, but never changes from that. I feel like I must be missing something obvious, like perhaps an entitlement - or some other device level setting?

func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) {
    switch camera.trackingState {
    case .notAvailable:
        print("Tracking: not available: \(camera.trackingState)")
    case .limited(let reason):
        print("Tracking limited: \(reason)") <-- only gets here, with "initializing"
    case .normal:
        print("tracking normal: \(camera.trackingState)")
    }
}

For what it's worth, I am using Xcode 9.0, and an iPhone 8.

Thanks!

like image 708
Chris Conover Avatar asked Oct 23 '17 01:10

Chris Conover


1 Answers

As odd as it seemed, simply restarting the phone fixed the problems on all the apps that I was seeing. I have no idea what went wrong or why though.

like image 51
Chris Conover Avatar answered Oct 11 '22 17:10

Chris Conover