Include the following details (edit as applicable):
- Issue category: ARDK Documentation / VPS / Scanning Framework
- Device type & OS version: Android
- Host machine & OS version: Windows 11 Version 10.0.26200 Build 26200
- Issue Environment : On Device
- Xcode version:
- ARDK version: 3.15.0-2508040839
- Unity version: 6000.0.53f1
Description of the issue:
When I am physically at the VPS location I am attempting to track, I do not get a hit on the location
I have loaded 2 VPS locations in the AR Location manager on the XR Origin (with AR Location set to none), and have successfully ran the Persistent AR Demo sample code in the past. My goal is to track these locations from code (and one day add the locations to the location manager in code as well), but I am having trouble with this.
Here is the code:
// Wait for ARSession to be tracking
yield return new WaitUntil(() => ARSessionGuard.IsSessionTracking);
//Add event listener for when the tracking state of the location being tracked
//changes
_arLocationManager.locationTrackingStateChanged += OnLocationTrackingStateChanged;
var arLocations = _arLocationManager.ARLocations;
Debug.Log($"[{DateTime.Now}] StartTracking: {arLocations[index].Payload.ToBase64()}");
_arLocationTrackingText.text = $"StartTracking: {arLocations[index].name}";
_arLocationManager.SetARLocations(arLocations[index]);
_arLocationManager.StartTracking();
After _arLocationManager.StartTracking(); is called, I do not get any event handler calls telling me that tracking has started. My handler code is simple:
private void OnLocationTrackingStateChanged(ARLocationTrackedEventArgs args)
{
Debug.Log(
$"Location Tracking State: {args.ARLocation}, {args.Tracking}, {args.TrackingConfidence}, {args.TrackingStateReason}");
}
Here’s what I have confirmed:
- I called
SetARLocations(...)beforeStartTracking()as shown in the code above - I subscribed to the event handler before calling
StartTracking() - I confirmed
ARSessionis running before callingSetARLocations(...)andStartTracking() - I confirmed location permissions are granted on the target
- I confirmed the correct event handler method name
- I confirmed that I am using a valid ARLocation to track. The same location works when it is selected in the Inspector before compiling, and in code I am just selecting the same location from the ARLocation array.
- I dump the debug out for the entire app to a text box on screen and do not see any error messages that would indicate a problem anywhere.