Position and orientation almost never change and are wrong (ARKit mode)


#1

Hello,

I’m currently working on an iOS application for AR-indoor navigation and I’m facing some issues with position and orientation updates. The below code shows a condensed version of the app with only the relevant parts. I’m using the Indoor SDK in the experimentalWithARKit mode to get position and orientation and print them. I mapped my location manually with the locationBuilder, which worked fine. The location has a size of 3.5m x 4.4m and I’m using 6 location beacons which I placed in chest height.

My problems are that even though I move around, position and orientation change very rarely and are mostly wrong. The indoorLocationManager function to update those values gets called quite often but the values just almost never change.

When trying the Indoor Location App (in experimentalWithARKit mode with my location), everything works just fine and when using the built-in compass app, the orientation also shows correctly and updates regularly. So, I guess it must be my own application which is causing the bad results. I guess there is no chance of getting the source code of the Indoor Location App? :sweat_smile:

I’m using:

  • Indoor SDK 3.0.0
  • iPhone 7 Plus with iOS 12.0.1
  • Xcode 10 with Swift 4.2

#2

Hmm, everything looks fine at a first glance.

The experimental ARKit mode is, well, experimental :grin:, so maybe there’s some obscure bug in there. The Indoor Location app shares a lot of the code base with the Indoor Location SDK, but I think there are some differences, so maybe that’s why it works better in the app.

Does your own app have/requests the camera permission?


#3

Yeah, my app does have camera permission.

But I think I found the source of the problem:
I had an ARSCNView to show the current camera content. I tried to do that with:

self.sceneView.session.run(self.locationManager.arSession.configuration!)

As soon as I removed this line, everything worked as expected :blush:

Though, out of that results another question:
Since I want to build an AR-Navigation app, how can I display the current camera content of the ARSession of the LocationManager without losing the functionality of the AR navigation? I implemented a button to switch the displaying of the camera content on and off. As soon as I switch it on/off, navigation stops/starts to work properly.

Edit:
I think I got it right now. All I had to do was to put the following line before the above one:

self.sceneView.session = self.locationManager.arSession