RoomPlan AR Frame Position wrong after combining Rooms

Hello everyone,

I am struggling to find a solution for the following problem, and I would be glad and thankful if anyone can help me.

My Use Case: I am using RoomPlan to scan a room. While scanning, there is a function to take pictures. The position from where the pictures are taken will be saved (in my app, they are called "points of interest" = POI).

This works fine for a single room, but when adding a new room and combining the two of them using:

structureBuilder.capturedStructure(from: capturedRooms)

the first room will be transformed and thus moved around to fit in the world space.

The points are not transformed with the rest of the room since they are not in the rooms structure specifically, which is fine, but how can I transform the POIs too, so that they are in the correct positions where they were taken?

I used:

func captureSession(_ session: RoomCaptureSession, didEndWith data: CapturedRoomData, error: (Error)?)

to get the transform matrix from "arFrameReferenceOriginTransform" and apply this to the POIs, but it still seems that this is not enough.

I would be happy for any tips and help! Thanks in advance!

My Update function:

    func updatePOIPositions(with originTransform: simd_float4x4) {

        for i in 0..<(poisOldRooms.count) {
               
                var poi = poisOldRooms[i]
                let originalPosition = SIMD4<Float>(
                    poi.data.cameraOriginX,
                    poi.data.cameraOriginY,
                    poi.data.cameraOriginZ,
                    1.0
                )
                 
       
        let updatedTransform = originTransform * originalPosition

                poisOldRooms[i].data.cameraX = updatedTransform.x
                poisOldRooms[i].data.cameraY = updatedTransform.y
                poisOldRooms[i].data.cameraZ = updatedTransform.z
 
            }
    
    }

I am also looking into the same use case atm.

I tried to map the images to the UUID of the detected structure (wall, door, opening, object etc.) but then again, when merging into a multi-room structure, the room builder creates new UUIDs for the common walls and openings, and I haven't found a way to map the previous UUIDs to the new updated UUID.

I am trying now the approach to snap the image and map it to the camera position, in order to access them via position in the final result.

Did you found any solutions yet to the multi-room structure issue?

Had any luck since? Encontering the same issue with multi room scans

Additionally I noticed that when I already have scanned a room before and try to re-localize with the stored world map the previous frames are completely off like the world origin has changed.

RoomPlan AR Frame Position wrong after combining Rooms
 
 
Q