Reoccurring World Tracking / Scene Exceeded Limit Error

Hi,

We’ve been successfully using the RoomPlan API in our application for over two years. Recently, however, users have reported encountering persistent capture errors during their sessions. Specifically, the errors observed are:

  • CaptureError.worldTrackingFailure
  • CaptureError.exceedSceneSizeLimit

What we have observed:

  • Persistent Errors: The errors continue to occur even after initiating new capture sessions.
  • Normal Usage: Our implementation adheres to typical usage patterns of the RoomPlan API without exceeding any documented room size limits.
  • Limited Feature Usage: We are not utilizing the WorldTracking feature for the StructureBuilder functionality to stitch rooms together.
  • Potential State Caching: Given that these errors persist across sessions, we suspect that there might be memory or state cached between sessions that is not being cleared, particularly since we are not taking advantage of StructureBuilder.

Request:

Could you please advise if there is any internal caching or memory retention between capture sessions that might lead to these errors? Additionally, we would appreciate guidance on how to clear or manage this state when the StructureBuilder feature is not in use.

Here is a generalised version of our capture session initialization code to help diagnose the issue.

struct RoomARCaptureView: UIViewRepresentable {
    typealias Handler = (CapturedRoom, Error?) -> Void

    @Binding var stop: Bool
    @Binding var done: Bool
    let completion: Handler?

    func makeUIView(context: Self.Context) -> RoomCaptureView {
        let view = RoomCaptureView(frame: .zero)
        view.delegate = context.coordinator
        view.captureSession.run(configuration: .init())
        return view
    }

    func updateUIView(_ uiView: RoomCaptureView, context: Self.Context) {
        if stop {
            // Stop the session only once, multiple times causes issues with the final presentation
            uiView.captureSession.stop()
            stop = false
            done = true
        }
    }

    static func dismantleUIView(_ uiView: RoomCaptureView, coordinator: Self.Coordinator) {
        uiView.captureSession.stop()
    }

    func makeCoordinator() -> ARViewCoordinator {
        ARViewCoordinator(completion)
    }

    @objc(ARViewCoordinator)
    class ARViewCoordinator: NSObject, RoomCaptureViewDelegate {
        var completion: Handler?

        public required init?(coder: NSCoder) {}

        public func encode(with coder: NSCoder) {}

        public init(_ completion: Handler?) {
            super.init()

            self.completion = completion
        }

        public func captureView(shouldPresent roomDataForProcessing: CapturedRoomData, error: (Error)?) -> Bool {
            return true
        }

        public func captureView(didPresent processedResult: CapturedRoom, error: (Error)?) {
            completion?(processedResult, error)
        }
    }
}

Thank you for your assistance.

Answered by Vision Pro Engineer in 829125022

Hey @LewisHeatGeek and @tan-tt,

This is an issue we're aware of (FB14454922 FB15035788), but we're not aware of any recommended workaround so far. If you find something that helps you avoid the issue, please share it with the community by posting it here.

Even though we're aware of this issue, we still encourage you to open a bug report, and post the FB number here once you do. The specific info you include your bug report might help our investigation, and filing the bug report you to get notified when it is resolved.

Bug Reporting: How and Why? explains how you can open a bug report.

Thanks,
Michael

Hey @LewisHeatGeek,

It feels odd to me this worked for years and all of a sudden you are starting to see errors now. Are there any other modifications or changes that you made to your application recently? Are you able to reproduce this issue in your project or a sample project? Are you able to ask a user that has experienced this issue to take a sysdiagnose after encoring the issue?

Thanks,
Michael

Any update on this ? Im appearing the same issue

Here is my thread https://developer.apple.com/forums/thread/775853

TLDR: Im keep receiving the Room size exceeded error after doing the first scan on my iPhone 15 pro 18.3.1 regardless of the room's size. The error appeared immediately after the first scan.

Insights

  • There is no memory leaks during the scan
  • Here is my scan controller
class RoomCaptureController: RoomCaptureViewDelegate, RoomCaptureSessionDelegate, ObservableObject
{
    static let shared = RoomCaptureController()
    var roomCaptureView: RoomCaptureView
    var showExportButton = false
    var showShareSheet = false
    var exportUrl: URL?
    
    var sessionConfig: RoomCaptureSession.Configuration
    var finalResult: CapturedRoom?
    var scanError: Error?
    
    init() {
        roomCaptureView = RoomCaptureView(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
        sessionConfig = RoomCaptureSession.Configuration()
        roomCaptureView.captureSession.delegate = self
        roomCaptureView.delegate = self
    }
    
    func captureSession(_ session: RoomCaptureSession, didEndWith data: CapturedRoomData, error: (any Error)?) {
        print("Capture session ended")
        if let error {
            self.scanError = error
        }
    }

    func startSession() {
        self.scanError = nil
        sessionConfig = RoomCaptureSession.Configuration()
        sessionConfig.isCoachingEnabled = true
        roomCaptureView.captureSession.run(configuration: sessionConfig)
    }
    
    func stopSession() {
        roomCaptureView.captureSession.stop()
    }
    
    func captureView(shouldPresent roomDataForProcessing: CapturedRoomData, error: Error?) -> Bool {
        return true
    }
    
    func captureView(didPresent processedResult: CapturedRoom, error: Error?) {
        finalResult = processedResult
    }

Hey @LewisHeatGeek and @tan-tt,

This is an issue we're aware of (FB14454922 FB15035788), but we're not aware of any recommended workaround so far. If you find something that helps you avoid the issue, please share it with the community by posting it here.

Even though we're aware of this issue, we still encourage you to open a bug report, and post the FB number here once you do. The specific info you include your bug report might help our investigation, and filing the bug report you to get notified when it is resolved.

Bug Reporting: How and Why? explains how you can open a bug report.

Thanks,
Michael

Hi @Vision Pro Engineer @LewisHeatGeek

This issue is device issue.

Factory reset the device can solve the problem!

Reoccurring World Tracking / Scene Exceeded Limit Error
 
 
Q