Delete or clear tracked geometry and images when using ARKIT?
Is there a way to delete the tracked geometry and tracked images?
I'm using an augmented image as a trigger for another object being placed somewhere else in the scene and I need to be able to restart the whole process without closing the app. Stop AR Session doesn't seem to clear the tracked planes because when I start the AR session again it immediately has the previously detected planes, and the image as well, causing my object to be created before the user has actually looked at it.
What is the best way to flush out the current ARKit tracked data and force it to begin again?
asked Sep 07 '18 at 10:00 AM in Blueprint Scripting
So, this isn't an answer to my question but it is a method to get around it.
At the start of an AR session create and array of the current tracked geometries. Each tick, or however often you are running your updates, compare that array to the current list of all geometries. Those that aren't in that array are new so add them to a second array. Then do your position checks or whatever you need to do from that new array, not from Get all AR Geometries.
Now the only way this works is if you update that existing geometries array. For me I just stop the AR session, reopen my level and start the session again. I think stopping the session is required for it to recognise image as a "new" geometry for it to track, while the previous iteration of that image is now in the ignored list. If you can't just reopen your map you may need a more creative solution for deciding which tracked elements get put into your ignore list and when they are added.
Hopefully this helps someone else. I was maybe just being lazy about how I was using the Image detection system haha
You could do a "Line Trace Tracked Objects" per frame and see if any of the trace results match your tracked images, instead of querying whether or not something is in the list of tracked geometry? At least that's what I'm attempting to do right now, since I ran into a similar problem.
EDIT: It seems like Line tracing for tracked objects does not return images at this time, only normal tracked planes unfortunately.
Follow this question
Once you sign in you will be able to subscribe for any updates here