Post not yet marked as solved
Please note that my request above is for RoomObjects only. The Surface detection is perfect as is for Door, Window, Wall and Opening.
I was able to get it to work using a fresh ARKit project from Xcode 14 Beta 2 and what was presented at WWDC like so:
import UIKit
import RealityKit
import RoomPlan
import ARKit
class ViewController: UIViewController {
var roomCaptureSessionConfig: RoomCaptureSession.Configuration = RoomCaptureSession.Configuration()
@IBOutlet var arView: ARView!
// var previewVisualizer: Visualizer!
lazy var captureSession: RoomCaptureSession = {
let captureSession = RoomCaptureSession()
arView.session = captureSession.arSession
return captureSession
}()
override func viewDidLoad() {
super.viewDidLoad()
captureSession.delegate = self
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
captureSession.run(configuration: roomCaptureSessionConfig)
}
}
extension ViewController: RoomCaptureSessionDelegate {
func captureSession(_ session: RoomCaptureSession,
didUpdate room: CapturedRoom) {
print(room)
// previewVisualizer.update(model: room)
}
func captureSession(_ session: RoomCaptureSession,
didProvide instruction: RoomCaptureSession.Instruction) {
print(instruction)
// previewVisualizer.provide(instruction)
}
}
That will really fill up your console pretty quickly and turn your phone into a nice hand warmer if you're not careful. :-)