Restoring ARPlaneAnchor from previous sessions places object in incorrect coordinates

Originator:flavio
Number:rdar://FB7603867 Date Originated:2020-02-27
Status:Open Resolved:
Product:RealityKit Product Version:
Classification: Reproducible:
 
When restoring an ARPlaneAnchor instance (obtained via raycast or hittest) from a previous AR session, the virtual object always gets placed in the (0, 0) coordinates of that plane instead of the correct coordinates. The previous ARWorldMap is correctly restored (which can be seen because the tracked plane already exists as the camera moves, instead of getting incremented).

Expected behavior:
Initially, it was expected that raycasting or hittesting would return an actual point representation, rather than a plane representation. It's understandable that the returned type is an ARPlaneAnchor since it's a plane which was crossed by the raycase or hittest. Nonetheless, there should still be a way to represent or to access the actual point within that plane, rather than only being able to access the plane itself.

I've attached a simple example project that reproduces the behavior:
1 - Place a balloon anywhere by tapping the screen
2 - The world map representation and the anchor in which the balloon was placed will be serialized and save in the UserDefaults
3 - Restart the app
4 - The previous world map will be restored as well as the balloon
5 - Note that the balloon is placed in the (0, 0) position of the plane in which it was placed, instead of the correct coordinate within that plane

(I apologize for the code being all over the place, since this was just a PoC and a lot of attempts were made to fix this issue)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!