Post not yet marked as solved
I am building an app that uses the RoomPlan API, but I am hoping to change the UI, is it possible to, for instance, change the color of the lines that are displayed? Also, there only appears to be a way to turn off the live model, not translate it around the screen. Is it possible to do either of these things in IOS 17's RoomPlan?
Post not yet marked as solved
Is there an easy way from API to get surface area measurements?
Post not yet marked as solved
Hi,
I'm trying to implement the RoomPlan, could you tell me pls, which methods I can use to manipulate with resulted rendered room model: i.e. chenge the wall color by click etc. It can looks laughly but I didn't use this API before. If it doesnt have such functions please recoomend the api which I can use to manipulte scan results for such case: selecting a wall and change its color or marking it with some symbols which should be rendered on it. Thx
Post not yet marked as solved
Is there a method to extract the iphone position and orientation? Or to get the trajectory of the iphone during the room scan?
Post not yet marked as solved
When Running RoomPlan in a Debug session Pausing in the middle of the job to look at the data structures being carried it was noted that there were no Polygon Edges nor Polygon Corners in the data set. When are they created? One would think that they would be created when the Polygon was so they could be joined up when the sibling surfaces came into existence.
roomDataForProcessing RoomPlan.CapturedRoomData
keyframes [Foundation.UUID : RSKeyframe] 24 key/value pairs
coreAsset RSAsset 0x0000000281ebbd20
baseNSObject@0 NSObject
_isCaptured bool 0x0000000000000000
_floorPlan RSFloorPlan? 0x00000002820e69a0
baseNSObject@0 NSObject
groupId unsigned int 0x0000000000000000
ceilingHeight float 0x000000003fecf048
floorHeight float 0x00000000bf2557a1
rotationAngleAlongZ float 0x0000000000000000
walls __NSArrayI * 5 elements 0x0000000280847f00
[0] RS3DSurface? 0x0000000102819a20
baseNSObject@0 NSObject
isa Class RS3DSurface 0x010000025bdbf4b9
type unsigned char '\0'
individualUpdate char '\x01'
merged bool false
removed bool false
confidence float 0.98292613
groupId unsigned int 0
wallStatus int 1
parentWallStatus int -1
offset float 0
depth float 0
depthWeight float 1
identifier __NSConcreteUUID * 0x28198e2a0 0x000000028198e2a0
parentIdentifier id 0x0 0x0000000000000000
room_id unsigned long long 0
room_class_idx unsigned long long 0
multiroom_all_idx unsigned long long 0
storyLevel long long 0
[1] RS3DSurface? 0x0000000102819b70
[2] RS3DSurface? 0x000000010282a620
[3] RS3DSurface? 0x000000010282a770
[4] RS3DSurface? 0x000000010281c250
doors __NSArrayM * 1 element 0x0000000281e4d200
windows __NSArrayM * 0 elements 0x0000000281e4cf60
openings __NSArrayM * 1 element 0x0000000281e4d140
opendoors __NSArrayM * 0 elements 0x0000000281e4f8d0
objects _TtCs19__EmptyArrayStorage * 0x207680b60 0x0000000207680b60
curvedWalls __NSArray0 * 0 elements 0x000000020be723b8
roomTypes __NSArray0 * 0 elements 0x000000020be723b8
floors __NSSingleObjectArrayI * 1 element 0x00000002850c6e00
curvedWindows __NSArrayM * 0 elements 0x0000000281e4c750
curvedDoors __NSArrayM * 0 elements 0x0000000281e4d260
wallLists id 0x0 0x0000000000000000
storyLevel long long 0x0000000000000000
_mirrorPoints __NSArray0 * 0 elements 0x000000020be723b8
_version long long 0x0000000000000002
_rawFloorPlan RSFloorPlan? 0x00000002820e6640
error Error? worldTrackingFailure
self RoomPlanExampleApp.RoomCaptureViewController 0x0000000106811c00
Post not yet marked as solved
I am trying to find the size limitations for RoomPlan. Originally I was planning to get this data from the exceedSceneSizeLimit error. But it appears that errors are only given to the delegate once the captureSession is ended and it provides the final capture data to the delegate.
Post not yet marked as solved
I'm trying to merge room with WorldMap:
but my screen goes black when doing a scan,
First: i load world map
arWorldTrackingConfig.initialWorldMap = worldMap
//arWorldTrackingConfig.planeDetection = [.horizontal, .vertical]
arSession.run(arWorldTrackingConfig)
if #available(iOS 17.0, *) {
roomCaptureView = RoomCaptureView(frame: view.bounds, arSession: arSession)
}
else{
roomCaptureView = RoomCaptureView(frame: view.bounds)
}
roomCaptureView = RoomCaptureView(frame: view.bounds)
roomCaptureView.captureSession.delegate = self
roomCaptureView.delegate = self
view.insertSubview(roomCaptureView, at: 0)
and save when scan done:
roomCaptureView?.captureSession.arSession.getCurrentWorldMap { worldMapData, error in
if let error = error {
return
}
if let worldMap = worldMapData {
let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent("worldMapData")
do {
let data = try NSKeyedArchiver.archivedData(withRootObject: worldMap, requiringSecureCoding: true)
try data.write(to: fileURL)
} catch {
print("error ARWorldMap: \(error.localizedDescription)")
}
}
}
the first scan is fine, but the next time, when the worldMap is saved and loaded, my screen goes black,
does anyone have a solution or sample code??
-thank-
I have got a crash related with RoomPlan framework on iOs 13.5.1
Hardware Model: iPad6,11
Process: xxxxxxx [4677]
Path: /private/var/containers/Bundle/Application/15CC2737-2FFD-4A17-A111-A2DB7A6838E0/xxxxxxx.app/xxxxxxx
Identifier: xxxxxxx
Version: 1489 (4.7.3)
AppStoreTools: 14E221
AppVariant: 1:iPad6,11:13
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: xxxxxxx [1071]
Date/Time: 2023-08-05 04:34:53.0188 +0700
Launch Time: 2023-08-05 04:34:52.7050 +0700
OS Version: iPhone OS 13.5.1 (17F80)
Release Type: User
Baseband Version: n/a
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Description: DYLD, can't resolve symbol _$s8RoomPlan0A14CaptureSessionC13ConfigurationVMa in /private/var/containers/Bundle/Application/15CC2737-2FFD-4A17-A111-A2DB7A6838E0/xxxxxxx.app/xxxxxxx because dependent dylib #40 could not be loaded
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 dyld 0x0000000105ea8f68 __abort_with_payload + 8
1 dyld 0x0000000105eafee8 abort_with_payload_wrapper_internal + 100 (terminate_with_reason.c:102)
2 dyld 0x0000000105eaff18 abort_with_payload + 12 (terminate_with_reason.c:124)
3 dyld 0x0000000105ead13c dyld::halt(char const*) + 384 (dyld2.cpp:4240)
4 dyld 0x0000000105e607fc dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 168 (dyld2.cpp:4328)
5 libdyld.dylib 0x00000001b1482398 dyld_stub_binder + 60
6 xxxxxxx 0x000000010475cc38 type metadata completion function for RoomPlanCaptureViewController + 60 (<compiler-generated>:0)
7 libswiftCore.dylib 0x00000001bedcf76c swift_getSingletonMetadata + 956 (MetadataCache.h:920)
8 xxxxxxx 0x000000010475a540 type metadata accessor for RoomPlanCaptureViewController + 48 (<compiler-generated>:0)
9 libobjc.A.dylib 0x00000001b13ab958 realizeAllClasses() + 112 (objc-runtime-new.mm:2840)
10 libobjc.A.dylib 0x00000001b13ae6dc objc_getClassList + 92 (objc-runtime-new.mm:5013)
.
.
14 dyld 0x0000000105e732c4 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 428 (ImageLoaderMachO.cpp:2427)
15 dyld 0x0000000105e736b0 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 52 (ImageLoaderMachO.cpp:2524)
16 dyld 0x0000000105e6e0f0 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 536 (ImageLoader.cpp:1621)
17 dyld 0x0000000105e6c520 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 184 (ImageLoader.cpp:605)
18 dyld 0x0000000105e6c5e8 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 92 (ImageLoader.cpp:620)
19 dyld 0x0000000105e61a64 dyld::runInitializers(ImageLoader*) + 88 (dyld2.cpp:4923)
20 dyld 0x0000000105e687b8 dlopen_internal + 832 (dyldAPIs.cpp:1761)
21 libdyld.dylib 0x00000001b1483a08 dlopen + 172 (dyldAPIsInLibSystem.cpp:1545)
.
.
.
30 dyld 0x0000000105e732c4 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 428 (ImageLoaderMachO.cpp:2427)
31 dyld 0x0000000105e736b0 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 52 (ImageLoaderMachO.cpp:2524)
32 dyld 0x0000000105e6e0f0 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 536 (ImageLoader.cpp:1621)
.
.
36 dyld 0x0000000105e687b8 dlopen_internal + 832 (dyldAPIs.cpp:1761)
37 libdyld.dylib 0x00000001b1483a08 dlopen + 172 (dyldAPIsInLibSystem.cpp:1545)
38 substitute-inserter.dylib 0x0000000106019284 0x105f3c000 + 905860
39 substitute-inserter.dylib 0x0000000106326ac0 0x105f3c000 + 4106944
40 substitute-inserter.dylib 0x00000001062e7980 0x105f3c000 + 3848576
41 dyld 0x0000000105e732c4 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 428 (ImageLoaderMachO.cpp:2427)
42 dyld 0x0000000105e736b0 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 52 (ImageLoaderMachO.cpp:2524)
43 dyld 0x0000000105e6e0f0 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 536 (ImageLoader.cpp:1621)
44 dyld 0x0000000105e6c520 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 184 (ImageLoader.cpp:605)
45 dyld 0x0000000105e6c5e8 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 92 (ImageLoader.cpp:620)
46 dyld 0x0000000105e5e608 dyld::initializeMainExecutable() + 136 (dyld2.cpp:1569)
47 dyld 0x0000000105e62eb0 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 4400 (dyld2.cpp:6989)
48 dyld 0x0000000105e5d208 dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 396 (dyldInitialization.cpp:145)
49 dyld 0x0000000105e5d038 _dyld_start + 56
by framework is weakly linked
Load command 53
cmd LC_LOAD_WEAK_DYLIB
cmdsize 80
name /System/Library/Frameworks/RoomPlan.framework/RoomPlan (offset 24)
time stamp 2 Thu Jan 1 03:00:02 1970
current version 1.0.0
compatibility version 1.0.0
Post not yet marked as solved
I'm unable to debug on iPhone 12 running iOS 17 beta 3 via network. I'm running Xcode 15 beta 6
Device shows in devices and simulators and I can debug when connected with cable.
However the "Connect Via Network" option is frayed out, oddly however the checkbox is ticked
I'm developing a app using RoomPlan so network connectivity is a must for debugging
Anyone else encountered this and know how to get around this problem
Other devices running iOS 16 connect via network just fine
Post not yet marked as solved
I need to generate a thumbnail from CapturedRoom, that is either a static frame of the PIP thumbnail that we see in the result after scanning. Ideally an image, but I could also use a simplified OBJ if that's a possibility. From documentation it looks like the only option is to export as USDZ. Is there a way to generate a static image file after room scan is processed?
try finalResults?.export(to: destinationURL, exportOptions: .mesh)
Post not yet marked as solved
We want to be able to use our own prompt / coaching for RoomPlan
I see that I can override the following method to see the RoomCaptureSession.Instruction and then add or our UI to coach the customer
func captureSession(_ session: RoomCaptureSession, didProvide instruction: RoomCaptureSession.Instruction) {
Logger.log(.info, category: .roomplan, message: "RoomCaptureSession.Instruction(\(instruction))")
// Show coaching prompts
}
However, I don't know how to remove the coaching UI provided by the OS.
If I disable coaching
sessionConfig = RoomCaptureSession.Configuration()
sessionConfig.isCoachingEnabled = false
Then the callback above was not being called.
I really want a willProvide method that I can return 'false' to say that I want to give my own UI instead of the UI provided by RoomPlan.
Is there a way to provide my own ui for these RoomCaptureSession.Instructions?
Thanks in advance
Post not yet marked as solved
Is there a way to combine roomplan api with arkit+metalkit to get both pointcloud .ply output and roomplan 3d room model .usdz?
Post not yet marked as solved
I am using the RoomPlanExampleApp to export a USDZ. When I open the USDZ on Reality Converter, I get this error
Invalid Structure in USDZ file
The root layer of the package must be a usdc file and must not include any external dependencies that participate in stage composition.
Post not yet marked as solved
We are trying to save usdz file in file manager some time its saved but some time we are getting the error. Like: path.absoluteURL file:///var/mobile/Containers/Data/Application/6D14A430-47B4-45F2-9D0D-6C31588A6A03/Documents/2896837C-C7E0-4FA8-BFE2-21A59B26D801.usdz Warning: in SdfPath at line 151 of sdf/path.cpp -- Ill-formed SdfPath </2896837CC7E04FA8BFE221A59B26D801>: syntax error Coding Error: in _IsValidPathForCreatingPrim at line 3338 of usd/stage.cpp -- Path must be an absolute path: <> cannotCreateNode(path: "/2896837CC7E04FA8BFE221A59B26D801")
func saveFileLocal() {
if let finalResult {
let fm = FileManager.default
var path = fm.urls(for: .documentDirectory, in: .userDomainMask).first!
let fileName = "(UUID().uuidString).usdz"
path.appendPathComponent(fileName)
do {
try finalResult.export(to: path.absoluteURL)
}
catch{
print(error)
}
}
}
func removeFiles() {
var filePath = ""
let fm = FileManager.default
let path = fm.urls(for: .documentDirectory, in: .userDomainMask).first!
do{
let content = try fm.contentsOfDirectory(atPath: path.path)
for c in content{
filePath = path.appendingPathComponent(c).absoluteString
if let url = URL(string: filePath){
try fm.removeItem(at: url)
}
}
}
catch{
print(error)
}
}
Post not yet marked as solved
I'm just curious if anybody knows if under the hood RoomPlan is applying any sort of sorting to the CapturedRoom.walls array. Like does RoomPlan try to sort the walls so they complete a loop? Or are walls simply appended to the back of the array as they are detected?
Post not yet marked as solved
We are using the RoomPlan API to capture data, which is stored in the 'CapturedRoom' variable in our code (referred to as 'finalResult'). We then attempt to save a USDZ file in the file manager. Sometimes it works, but other times, we encounter issues like the one below
Coding Error: in _IsValidPathForCreatingPrim at line 3338 of usd/stage.cpp -- Path must be an absolute path: <>
cannotCreateNode(path: "/9EE71ED0F8D6415496A7B9F0C3671DB0321")
This is that code we are using for shaving CapturedRoom data
func saveFileLocal() {
if let finalResult {
let fm = FileManager.default
let documentsURL = fm.urls(for: .documentDirectory, in: .userDomainMask).first!
//let documentsURL = URL.documentsDirectory
let fileName = "\(UUID().uuidString).usdz"
let fileURL = documentsURL.appendingPathComponent(fileName)
do {
try finalResult.export(to: fileURL)
} catch {
print(error)
}
}
}
Please help us.
Post not yet marked as solved
We are attempting to update the texture on a node. The code below works correctly when we use a color, but it encounters issues when we attempt to use an image. The image is available in the bundle, and it image correctly in other parts of our application. This texture is being applied to both the floor and the wall. Please assist us with this issue."
for obj in Floor_grp[0].childNodes {
let node = obj.flattenedClone()
node.transform = obj.transform
let imageMaterial = SCNMaterial()
node.geometry?.materials = [imageMaterial]
node.geometry?.firstMaterial?.diffuse.contents = UIColor.brown
obj.removeFromParentNode()
Floor_grp[0].addChildNode(node)
}
Post not yet marked as solved
Hi! I'm currently doing a simple RoomCaptureView-based room capture (iOS 17, iPhone 15 super mega ultra pro max), and I'm unable to export anything I capture, even though I have a dollhouse I can play with after the export.
Attached is a screen grab of the doll-house expand/collapse view. (it always fails) My export code is in the RoomCaptureView delegate. The passed in error is nil.
func captureView(didPresent processedResult: CapturedRoom, error: (Error)?) {
let fm = FileManager()
do {
let documentDirectoryURL = try fm.url(for: .documentDirectory,
in: .userDomainMask,
appropriateFor: nil,
create: true)
let now = generateCurrentTimeStamp() // of the form 2023_10_02_09_45_58
let destinationURL = documentDirectoryURL.appendingPathComponent("\(now).usdz")
try processedResult.export(to: destinationURL)
} catch {
print("oops no processed result? \(error)")
}
}
The constructed URL is: file:///var/mobile/Containers/Data/Application/7DD98157-909A-40A1-9271-1AFCD5336E8B/Documents/2023_10_02_09_45_58.usdz
The error in the catch is (not sure where the rest of my path went...):
▿ Error
▿ cannotCreateNode : 1 element
- path : "/2023_10_02_09_45_58"
And this is printed to the console:
Warning: in SdfPath at line 151 of sdf/path.cpp -- Ill-formed SdfPath </2023_10_02_09_38_17>: syntax error
Coding Error: in _IsValidPathForCreatingPrim at line 3338 of usd/stage.cpp -- Path must be an absolute path: <>
The same sequence happens if I use any of the different export types (mesh-default, parametric, model).
I'd attach my project but looks like zip files and dropbox links are forbidden here. If you want a small sample project, feel free to email me at markd at borkware dot com (since looks like emails are forbidden here too)
Thanks in advance! I'd love to present this to my cocoaheads in a couple of weeks.
Post not yet marked as solved
How can i draw a CapturedRoom.Surface.Curve in Scenekit? Is there a way
by using an UIBezierPath or by splitting it up into segments?
Post not yet marked as solved
I am writing to seek assistance with a challenge I am facing while working on a 3D model rendering project. I believe your expertise in this area could be immensely helpful in resolving the issue.
The problem I am encountering involves difficulties in displaying textures on both parent and child nodes within the 3D model. Here are the key details of the problem:
This model contents wall_grp(doors, windows and wall) objects. We are using roomplan data in SCNView.
This code dependent on scene kit and room plan apis
When we are comment childnode code its working but in this case we don’t have windows and door on wall.
func updateWallObjects() {
if arch_grp.count > 0 {
if !arch_grp.isEmpty {
for obj in arch_grp[0].childNodes {
let color = UIColor.init(red: 255/255, green: 229/255, blue: 204/255, alpha: 1.0)
let parentNode = obj.flattenedClone()
for childObj in obj.childNodes {
let childNode = childObj.flattenedClone()
let childMaterial = SCNMaterial()
childNode.geometry?.materials = [childMaterial]
if let name = childObj.name {
if (removeNumbers(from: name) != "Wall") {
childNode.geometry?.firstMaterial?.diffuse.contents = UIColor.white
} else {
childNode.geometry?.firstMaterial?.diffuse.contents = color
}
}
childObj.removeFromParentNode()
parentNode.addChildNode(childObj)
}
let material = SCNMaterial()
parentNode.geometry?.materials = [material]
parentNode.geometry?.firstMaterial?.diffuse.contents = color
obj.removeFromParentNode()
arch_grp[0].addChildNode(parentNode)
}
}
}
}```
Please suggest us