When leaving the ARFragment, and attemping to then resume it.. I guess this issue:
AR_ERROR_NOT_TRACKING: Cannot create anchors while the camera is not tracking.
at first I was getting issues about the scene being paused, I was able to get past that error by calling:
arFragment.getArSceneView().getSession().resume();
However, the camera is not in tracking state apparently. Is there a way to restart that process? I did quite a bit of looking through the docs but couldn't find any sort of method to properly resume camera tracking
In ARCore NDK you'd use the following method for destroying a session and releasing its resources:
void ArSession_destroy(ArSession *session);
This method releases resources used by an ARCore session. It'll take several seconds to complete. To prevent blocking the main thread, call ArSession_pause() on the main thread, and then call ArSession_destroy() on a background thread.
Then, you have to create a new session with :
ArSession_create();
Also, in ARCore Android, there's typically onPause() and onResume() methods for current session. But I use 2 other ones: pause() for pausing the current session and resume() for starting or resuming the ARCore current session.
Read about
ArSessionmethods HERE.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With