Post

Replies

Boosts

Views

Activity

ArKit entire scene is drifting away
I'm using ArKit with Metal in my ios app without ARSCNView. Most of times it works fine. However sometimes the whole scene is drifting away (especially first few seconds), then it sort of comes back but far from the original place. I don't see this effect in other model viewers - Unity based or WebAR based. Surely they use ArKit under the hood (not all but most of them do). Here is a snippet of my code: private let session = ARSession() func initialize() { let configuration = ARWorldTrackingConfiguration() configuration.maximumNumberOfTrackedImages = 10 configuration.planeDetection = [.horizontal, .vertical] configuration.automaticImageScaleEstimationEnabled = true configuration.isLightEstimationEnabled = true session.delegate = self session.run(configuration) } func getCameraViewMat(...) -> simd_float4x4 { //... return session.currentFrame.camera.viewMatrix(for: .portrait) } func createAnchor(...) -> Int { // ... anchors[id] = ARAnchor(transform: mat) session.add(anchor: anchors[id]!) return id } func getAnchorTransform(...) -> simd_float4x4 { //... return anchors[id]!.transform } func onUpdate(...) { // draw session.currentFrame.rawFeaturePoints!.points // draw all ARPlaneAnchor } func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) { print("TRACKING STATE CHANGED: \(camera.trackingState)") } I can see it's not just anchors problem - everything moves including the point cloud. The tracking state is normal and changes to limited only after the drift occurred which is too late. What can I do to prevent the drift?
0
0
376
Oct ’23
WiFi access has been declined
Hi, I'm unable to get access to wifi information. My provisioning profile includes "Access WiFi Information" and entitlements include "com.apple.developer.networking.wifi-info". And yet I'm getting an exception "CoarseReloc: WiFi access has been declined" In Xcode UI "Signing & Capabilities" I see "Access WiFi Information" but there is no switch to enable/disable it. XCode version 12.4 What else do I need to set up?
6
0
1.7k
Aug ’22