This technically works in editor, but on device Vuforia.TrackerManager.Instance.GetTracker<Vuforia.PositionalDeviceTracker>()
is null, meaning positional tracking never recovers.
Sample Code:
IEnumerator Test () {
Vuforia.CameraDevice.Instance.Deinit();
Vuforia.TrackerManager.Instance.DeinitTracker<Vuforia.PositionalDeviceTracker>();
yield return new WaitUntil(() => !Vuforia.CameraDevice.Instance.IsActive());
Vuforia.CameraDevice.Instance.Init(Vuforia.CameraDevice.CameraDirection.CAMERA_DEFAULT);
yield return new WaitUntil(() => Vuforia.CameraDevice.Instance.IsActive());
Vuforia.TrackerManager.Instance.InitTracker<Vuforia.PositionalDeviceTracker>();
yield return new WaitUntil(() => Vuforia.TrackerManager.Instance.GetTracker<Vuforia.PositionalDeviceTracker>() != null);
Debug.Log("worked!");
}
void Start () {
StartCoroutine(Test());
}
Hello aidanwolf,
Hello aidanwolf,
Which version of Vuforia and which device are you seeing this on? The positional tracker will return null on devices that don't support the feature.
Thanks,
Vuforia Support
Hi, quick mistake on my part.
Hi, quick mistake on my part. Needed to initialize the tracker before initializing CameraDevice. Now it returns. Also learned I need to call .Start() as well.
Unfortunately this doesn't solve my use case - I can't reposition and rotate the ARCamera no matter what I try. Any ideas?
Is there a way to detect when
Is there a way to detect when device tracking actually kicks in? Start() doesn't mean it's tracking right away, there's still a delay. Thank you.
I'm trying to take advantage
I'm trying to take advantage of the
Vuforia.TrackerManager.Instance.GetStateManager().GetTrackableBehaviours
to detect when the Positional Device Tracker is actually tracking by using the ground plane state, but unfortunately on device there are no ground planes returned.GroundPlane.GetComponent
GroundPlane.GetComponent<Vuforia.AnchorBehaviour>().CurrentStatus
only returnsUNDEFINED
. Bug?I'm also going to assume this is outdated now? https://library.vuforia.com/articles/Solution/Smart-Terrain-Workflow-in-Unity