Hello!
I've been working on an AR app where users can place nodes and (occasionally) move them around. The approach so far is by creating an ARAnchor based on the hittest location, and then saving information on core data with ARAnchor's identifier as reference. I have had no issue whatsoever with this part of the app.
However, I'm finding some difficulties when moving these nodes around. The approach I've tried so far (note that I don't include the animating process for simplicity):
-
Finding the node's ARAnchor using
self.sceneView.anchor(for: node) -
Create a new transformation matrix using the anchor's transform after applying translations:
let transform = SCNMatrix4Mult(translationOnAxis, SCNMatrix4(anc.transform))
- Create a new ARAnchor with new transformation above
- Update core data record for the Anchor by changing the identifier reference with that of the new ARAnchor.
- Add the new ARAnchor to the session's ARWorldMap file.
- Remove the previous ARAnchor from the session's ARWorldMap
- Save the core data context and the session's ARWorldMap file.
After saving the records on the core data and writing the ARWorldMap file updates, I have no issue when rendering the nodes in their current positions. However, when I closed the app and reopened the AR map, the following behavior surfaces:
- All the nodes in the world are rendered correctly, even those with new positions.
- The session continues for several seconds (2-3 seconds) and then crashes.
Error logs that I've collected:
-
Thread 3 SIGABRT (I reckon this usually happened after a user consciously terminate the app? i might be wrong though)
-
Non descriptive (or maybe I just don't understand it enough) Dynamic library Assert Error:
Assert: in line 508
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/usr/lib/libMTLCapture.dylib
That's about it. No other error description that I could find. Some stackoverflow thread mention signing issues on third party frameworks using SPM. I do use some AWS libraries using SPM, but none of its services was used during the aforementioned process, so I don't believe that would be the cause.
Any help or questions are welcome!