Hello,
I used to be able to encode CapturedRoomData using JSONEncoder with the code below:
// Encode CapturedRoomData
func encodeRoomData(_ roomData: CapturedRoomData) -> Data? {
print("#ECRD1 - Data: \(roomData)")
do {
let encodedRoom = try JSONEncoder().encode(roomData)
print("#ECRD2 - Encoded: \(encodedRoom.description)")
return encodedRoom
} catch {
print("#ECRD3 - Failed with error: \(error)")
}
return nil
}
A few weeks ago I noticed this approach is no longer working. The encoding fails and I get the following error printed:
#ECRD3 - Failed with error: invalidValue(RoomPlan.CapturedRoomData, Swift.EncodingError.Context(codingPath: [], debugDescription: "Invalid data", underlyingError: nil))
Can anyone help me find the root of this problem?
For reference, here’s what the printed CapturedRoomData looks like (with the keyframes omitted):
#ECRD1 - Data: CapturedRoomData(keyframes: [...], coreAsset: <RSAsset: 0x283988bd0>, arFrameReferenceOriginTransform: simd_float4x4([[0.9995456, 0.0, 0.030147359, 0.0], [0.0, 1.0, 0.0, 0.0], [-0.030147359, 0.0, 0.9995456, 0.0], [0.38664898, 0.93699455, 0.38685757, 1.0]]))
RoomPlan
RSS for tagCreate parametric 3D scans of rooms and room-defining objects.
Posts under RoomPlan tag
69 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
start the session and took a scan everything looks perfect in the 3d while taking but after completing the scan, the 3d model that is presented on the screen is getting morphed within 4 sec gap . first it shows the correct one after 4 to 5 sec the usdz is getting morphed like all the straight walls are transforming into curved and if i have one walls getting some 2 to 3 walls with overlapping. not able to know why it is getting morphed like that.
All I do was presenting the 3d model on the screen from the delegate method should Present -
func captureView(shouldPresent roomDataForProcessing: CapturedRoomData, error: Error?) -> Bool {
print("shouldPresentdelegate")
if let error = error {
print("shouldPresent error::",error)
}
return true
}
first it shows correct next in 4 to 5 sec its again reloads to another 3d form which is not correct at all . is there any reason behind this. can anyone please help me with this.
your help is appreciated. Thankyou.
It has been awhile since I looked at RoomPlan. I noticed when I was poking at the CapturedRoom, that there is binary data called coreModel... Does anyone know what this is? Is this related to ModelProvider?
Thanks in advance.
I'm trying to decipher this roomplan api data output. Dimensions:
the simd3 is width and height and I think thickness in meters but the spacial information is not clear to me and I can't find any info on it. an insights on this?
*** CAPTURED ROOM OBJECTS ***
Walls:
Identifier: 9F4BEEBB-990C-42F3-A0BC-912E1F770877
Dimensions: SIMD3(5.800479, 2.4299998, 0.0)
Category: wall
Transform:
SIMD4(0.25821668, 0.0, 0.966087, 0.0)
SIMD4(0.0, 1.0, 0.0, 0.0)
SIMD4(-0.966087, 0.0, 0.2582167, 0.0)
SIMD4(2.463065, -0.27346277, -0.5366996, 1.0)
Identifier: A72544F5-068D-4F19-8FA4-60C1331003E3
Dimensions: SIMD3(2.28993, 2.4299998, 0.0)
Category: wall
Transform:
SIMD4(0.966087, 0.0, -0.2582166, 0.0)
SIMD4(0.0, 1.0, 0.0, 0.0)
SIMD4(0.25821656, 0.0, 0.966087, 0.0)
SIMD4(0.608039, -0.27346277, -3.0429342, 1.0)
Hello Everyone, I want to know whether roomplan gives us the complete info about the furniture sizing and alignment like how the object is being positioned in the room (wither forward/backward like that).
Is there any working sample code that demonstrates the 2nd multiroom approach, i.e., capture multiple rooms over more than one scan session using the ARWorldMap approach that's described in the WWDC presentation?
I've tried working from the code snippets provided in the transcript but cannot get it working reliably enough.
Do I need an entitlement to use the ARWorldTrackingConfiguration and get that data in RoomPlan enhancements being done?
Will Roomplan API be available for Vision OS? Currently its not available.
I am using the room plan api to implement the function of multiple space merging, but I found that after performing multiple space merging, the generated json would miss some of the newly added areas, but the usd file and plist file were complete.Does anyone have this problem? Look forward to official support
this is my code:
public func mergeScan(_ data:String,_ scanName:String,_ directoryName:String){
var capturedRoomArray: [CapturedRoom] = []
//解析主结构
let jsonURL = getRootURL().appending(path: "/\(directoryName)/\(scanName)/scan.json")
guard let mainStructureRoom = try?loadCapturedRoom(from: jsonURL) else { return }
capturedRoomArray.append(mainStructureRoom)
// 添加子结构
if let subStructureRoom = try? loadCapturedRoom(from: data) {
os_log("loadCapturedRoom string data success: %@", type: .error, String(describing: data))
capturedRoomArray.append(subStructureRoom)
}
os_log("merge scan capturedRoomArray: %@", type: .error, String(describing: capturedRoomArray.count))
//合并
Task {
do {
finalStructureResults = try await structureBuilder.capturedStructure(from: capturedRoomArray)
}catch {
print("Merging Error:\(error.localizedDescription)")
return
}
do{
//保存
//导出json
guard let finalStructureResults else { return }
try exportJson(from: finalStructureResults, to: jsonURL)
//导出usd
let meshDestinationURL = jsonURL.deletingPathExtension().appendingPathExtension("usdz")
//导出plist
let metadataDestinationURL = jsonURL.deletingPathExtension().appendingPathExtension("plist")
try finalStructureResults.export(to: meshDestinationURL,
metadataURL: metadataDestinationURL,
exportOptions: [.mesh])
} catch {
print("Merge Error:\(error.localizedDescription)")
return
}
}
}
func exportJson(from capturedStructure: CapturedStructure, to url: URL) throws {
let encoder = JSONEncoder()
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
let data = try encoder.encode(capturedStructure)
try data.write(to: url)
}
Note: Only json is missing the content of this or the next scan, usdz and plist are complete
I'm using RoomPlan to create a 2-d layout of a room. Because it's just a single room, I want to present it 'squared' up, see my picture
First off, is there any options in the ARView that was used with the scan to sort of zero out the orientation so that it creates a room layout that is not on an angle?
If not...
Is there a well known mathematical formula to snap this to the closest 90 degrees? I tried just changing the rotation of each wall to snap to the nearest 90 degrees, but it wasn't quite good enough as they no longer joined together cleanly. Perhaps there's an algorithm for doing this while preserving the relative locations of everything?
I am scanning with ios17.2 on iphone12/ iPad with M1
attributes is always an empty array although I can see object categories and dimensions.
They are not in the CapturedRoom object at the end or during the scan (printing the capturedRoom objects ), nor in the JSON export.
what am I missing?
Model provider can see them so it seems the data is in the unreadable "coreModel":"\/cCE2z0D7YOs5AV+590PFcMLD75UZjfuGUoGD8......"
I have a tracking issung with the latest beta 17.4 and want to know if anyone encountered the same problem.
My app is using the pause=false functionality for multiroom that apple provided to let the ARSession run in the background:
roomCaptureView?.captureSession.stop(pauseARSession: false)
When resuming the scan/scanning the next room I initialize a new RoomCaptureView with the running ARSession:
let roomCaptureView = RoomCaptureView(frame: rcvc.view.bounds, arSession: arSession!)
This worked fine on all previous versions and different devices. Since the update to 17.4 I noticed that the tracking will be lost after initializing the next scan which feels like the pauseARSession is not working (the ARSession has still the same ID)
Devices:
This behaviour/error does not occur on devices with 17.3 or lower: 15 Pro Max, 14 Pro Max, 13 Pro
This behaviour/error occures on devices with 17.4: 15 Pro Max, 14 Pro Max
If anyone has noticed the same issue I would like to know that I'm not the only one. Thanks.
RoomPlan- Getting error for ceiling Height and floor Height from CapturedRoom.
I am using RoomPlan version-2 Framework to scan houses. I need ceilingHeight and floorHeight. I am parsing the data of CapturedRoom successfully into Json and getting all keys and their value except "coreModel" of type: (RSFloorPlan) value.
Does Apple support coreModel: RSFloorPlan yet?
In "coreModel" key, there are some keys values of ceilingHeight and floorHeight.
In the last I am getting encoded string as value of key "coreModel".
CoreModel: qkgdxIDMaicOkpwW1I/h/V4C.........................7nCom3Lpu0CM=
I will really appreciate your hard work.
I want to have realtime image anchor tracking together with RoomPlan.
But it's frustrating to not seeing any thing that can support this.
Because it is useful to have interactive things in the scanned room.
Ideally it should be running the same time, but if not possible, how do you align the two tracking space if running RoomPlan and then ARKit image tracking? sounds like headache
how can we change the image quality, size, camera and cadence used during RoomPlan's scanning. We are getting the images from RoomCaptureSession.
Error:
RoomCaptureSession.CaptureError.exceedSceneSizeLimit
Apple Documentation Explanation:
An error that indicates when the scene size grows past the framework’s limitations.
Issue:
This error is popping up in my iPhone 14 Pro (128 GB) after a few roomplan scans are done. This error shows up even if the room size is small. It occurs immediately after I start the RoomCaptureSession after the relocalisation of previous AR session (in world tracking configuration). I am having trouble understanding exactly why this error shows and how to debug/solve it.
Does anyone have any idea on how to approach to this issue?
Is there a way to handle Roomplan ExceededSceneSizelimitError. in documentation also there is nothing . For me after taking just small small scans about 5 to 6 after the 7 th scan getting this error . only killing the app and restarting is working, if i come to back page and again go to start newscan also it is not working
We scan the room using the RoomPlan API, and after the scan, we obtain objects with a white color along with shadows and shading. However, upon updating the color of these objects, we experience a loss of shadows and shading.
RoomPlan scan
After Update
Im working on Apple RoomPlanAPI MergescansFeature which is an update of ios17.
In this it is said mergescans can be done in 2 ways
continuous ARsession
ARRelocalization
I've worked on ARRelocalization . I take a first scan and then come nextday and want to take another scan . can we start the scan anywhere in that particular house. and can merge them. Because currently what I was doing was I take a scan and when i stop the scan ..then save the world map like the snapshot/anchors of that point where I've stopped the scan and again come nextday and start a scan then load the saved map... it says we should go where we've stopped the last scan then only it will sense the environment and it relocalizes with the previous scan coordinatesystem.
now we can take a scan and these 2 can be merged.
but now what i want was i will take a scan and due to some reasons i didn't take the bedroom of the house now I'll come next day and want to take only the bedroom scan can i start it from the bedroom scan directly without going to the last point where we stopped the scan and merge these two scans? is it even possible?
Has anyone had success with RoomPlan to scan an entire home? We use floor plan scanning technology for our real estate business and RoomPlan is great as it has instant results but we need the entire home with a staircase for total square footage purposes.
Thanks in advance,
Luke