I'm trying to run ARWorldTracking Session and ARFaceTracking Session at the same time on iPhoneX, but the first running session stopped after the later session begun to run.
Is is impossible to implement? This is my ViewController.swift code.
import UIKit
import ARKit
class ViewController: UIViewController, ARSCNViewDelegate,
ARSessionDelegate {
@IBOutlet weak var frontView: ARSCNView!
@IBOutlet weak var backView: ARSCNView!
override func viewDidLoad() {
super.viewDidLoad()
startTracking()
}
func startTracking() {
let backConfiguration = ARWorldTrackingConfiguration()
backView.session.run(backConfiguration)
let frontConfiguration = ARFaceTrackingConfiguration()
frontConfiguration.isLightEstimationEnabled = true
frontView.session.run(frontConfiguration)
}
}
Nope.
ARKit relies upon the AVCapture system, and that doesn’t support using more than one capture device (camera) at a time. If you start a capture session using the front camera while another session is using the back camera, the existing session stops.