I am trying to use ARWorldmap to save and load the data to relocalize the scene. The example I used was from apple's documentation: https://developer.apple.com/documentation/arkit/world_tracking/saving_and_loading_world_data
However, this example uses scenekit to render, and I want to use realitykit.
In the example, they use: Scenekit renderer didAdd to render everytime a new anchor has been added.
What I did was to swap out the scenekit in the example and replace the method above with ARsession's didAdd Anchors and create a new anchorentity from the anchor added.
The app runs with no problem until I tried to load the saved world data. The anchor restored with no problem at all with the correct coordinate. ARsession's didAdd Anchors function was called and it recreates my AnchorEntity at the anchor location.
However, my anchorentity created in the didAdd anchors method is at the wrong location as they randomly drifted from where they were supposed to be.
Anyone has any clue on how to solve this?
However, this example uses scenekit to render, and I want to use realitykit.
In the example, they use: Scenekit renderer didAdd to render everytime a new anchor has been added.
What I did was to swap out the scenekit in the example and replace the method above with ARsession's didAdd Anchors and create a new anchorentity from the anchor added.
The app runs with no problem until I tried to load the saved world data. The anchor restored with no problem at all with the correct coordinate. ARsession's didAdd Anchors function was called and it recreates my AnchorEntity at the anchor location.
However, my anchorentity created in the didAdd anchors method is at the wrong location as they randomly drifted from where they were supposed to be.
Anyone has any clue on how to solve this?