Closed jimmy-jam closed 6 years ago
Currently, tracking state can be found by whether or not the VRDisplay is reporting a position; the more granular state info on ARKit (ARTrackingStateLimited) doesn't have an equivalent on ARCore, and unlikely we'll expose this to the web beyond general position information; @judax thoughts?
I agree that exposing explicit tracking state is interesting but the WebVR spec seems to think differently and tracking loss is exposed as the lack of a pose. In these prototypes we could use the fact that VRDisplays are event emitters to expose these state but as @jsantell explained, we should try to be consistent between ARKit and ARCore.
Is using the "trick" of using the position as a way to know if tracking is lost, a temporary solution for your use case?
I think AR is different in the respect that we can ask the user via UI/UX hints to change their environment in low light or looking for more feature points - and we can also recover from these tracking losses. So if we have a way to realize this happened, and to hint to the user how to recover, it will provide a more enjoyable experience.
I want to be able to find out what the tracking state is on my device from JS, so that I can provide UI to improve the experience.
the native code to detect these states appear to be there on webARonARKit at least.
https://developer.apple.com/documentation/arkit/artrackingstate?language=objc https://developers.google.com/ar/reference/java/com/google/ar/core/Frame.TrackingState - though it seems to have more granular methods on planes and anchors