Running multiple ARKitSessions in the same app?

I would like to implement the following but I am not sure if this is a supported use case based on the current documentation:

  1. Run one ARKitSession with a WorldTrackingProvider in Swift for mixed immersion Metal rendering (to get the device anchor for the layer renderer drawable & view matrix)
  2. Run another ARKitSession with a WorldTrackingProvider and a CameraFrameProvider in a different library (that is part of the same app) using the ARKit C API and using the transforms from the anchors in that session to render objects in the Swift application part.
  • In general, is this a supported use case or is it necessary to have one shared ARKitSession?
  • Assuming this is supported, will the (device) anchors from both WorldTrackingProviders reference the same world coordinate system?
  • Are there any performance downsides to having multiple ARKitSessions?

Thanks

Answered by Engineer in 803317022

It's okay to run multiple ARKitSession's in a single app. Further, they will share the coordinate system of the running app. There is a bit of a cost for additional running DataProvider's, as they all have their own connections to receive data. But in most cases that shouldn't have a big impact on your app's performance.

Accepted Answer

It's okay to run multiple ARKitSession's in a single app. Further, they will share the coordinate system of the running app. There is a bit of a cost for additional running DataProvider's, as they all have their own connections to receive data. But in most cases that shouldn't have a big impact on your app's performance.

Running multiple ARKitSessions in the same app?
 
 
Q