List
Instant tracker positioning
Posted Date: 2025-03-12 9:19     Edited Date: 2025-03-26 6:14     Writer: kirillichz941

Please provide your development details as below;

1. SDK Version: 6.2.1
2. Development Environment: Unity-Android
3. Tracker/Scanner: Instant Tracker
4. License Type Free 
5. Target Device(Optional): Samsung S20Fe

Is there a way to implement tracker positioning using instant tracker as it is done in MAXST AR VIEW app? I tried multiple approaches, but the trackable's Y vector is always aligned facing the device camera. Behavior i need is to place trackable, and have the ability to move camera around it, without object following and facing the camera (as its done in MAXST AR VIEW). I didn't find any code related to it

Tried both world center Camera and Target.

Comment (5)
Posted Date: 2025-03-13 0:04     Edited Date: 2025-03-13 0:04     Writer: admin

Hello, this is the MAXST AR SDK team.

The reason you were facing the camera when using the Instant Tracker is because the gravity sensor was not working.
Please check your Manifest file or your device's sensors to make sure they are working properly.

 

Thank you.
MAXST AR SDK Team

Posted Date: 2025-03-13 6:20     Edited Date: 2025-03-13 6:24     Writer: kirillichz941

Thank for reply. According to this code it says gravity sensor is enabled. Permission for camera is also presented in androidManifest file.
One more thing i faced - if I launch instant tacker in editor using camera from smartphone, object is placed correctly when i point the camera top down on the desk. But when i build on app, no matter how i position the device, instant tracker will at start, and always, will have its Y vector aligned to device camera

if (GravitySensor.current != null)
{
Debug.Log("Gravity sensor detected.");

// Enable the gravity sensor.
InputSystem.EnableDevice(GravitySensor.current);

if (GravitySensor.current.enabled)
{
Debug.Log("Gravity sensor is enabled.");
}
else
{
Debug.Log("Gravity sensor failed to enable.");
}
}
else
{
Debug.Log("No gravity sensor detected on this device.");
}

Maybe you can provide me example of what else i need in custom android files like manifest? However, i don't have any errors

Posted Date: 2025-03-13 8:20     Edited Date: 2025-03-13 9:20     Writer: kirillichz941

Update -- i managed to solve many problems and now i have only one -- that I need to point device camera Top-down to position instant trackable correctly, when calling FindSurface() (behavior same as in your sample). Then instant trackable is positioned correctly and i can move camera around. WorldCenter mode is set to Target. How to solve this?

upd; and a new issue - If I stop image tracker, and try to start instant tracker, i see logcat buffer error messages and tinstant tracking is not working. If I destroy tracker after turning it off, when i try to start tracker again it show invalid signature image. How to solve this? (buffer error - Error BufferQueueProducer [SurfaceTexture--1-22143-0](id:567f00000002,api:4,p:1288,c:22143) cancelBuffer: BufferQueue has been abandoned)

How i stop trackers -

SensorDevice.GetInstance().Stop();
TrackerManager.GetInstance().StopTracker();
StopCamera();

TrackerManager.GetInstance().SetTrackingOption(TrackerManager.TrackingOption.NORMAL_TRACKING);
TrackerManager.GetInstance().StopTracker();
StopCamera();

How i start trackers -
 

Application.targetFrameRate = 60;
StartCamera();
TrackerManager.GetInstance().StartTracker(TrackerManager.TRACKER_TYPE_IMAGE);
SetExtendedMode();

StartCamera();
TrackerManager.GetInstance().StartTracker(TrackerManager.TRACKER_TYPE_INSTANT);
SensorDevice.GetInstance().Start();
Application.targetFrameRate = 60;

 

Posted Date: 2025-03-26 1:16     Edited Date: 2025-03-26 1:16     Writer: admin

Hello, this is the MAXST AR SDK team.

1. The camera should not be facing straight ahead. It should be pointing slightly towards the floor for proper placement.

2. there is a logic problem with starting another tracker right away. There is a time where the thread stops inside, so it would be better to give it some sleep.

Thank you.
MAXST AR SDK Team

Posted Date: 2025-03-26 6:14     Edited Date: 2025-03-26 6:14     Writer: kirillichz941

Hello, I didnt Start another tracker right after the stopping the previous. At least 3 seconds delay (stop tracker - go through UI menu in a few clicks, then select InstantTrackerMode).
About camera - maybe You didnt't understand me. Instant tracker target are always spawned pointing with their Y vector into device camera, no matter how i position the device. That's why I am able to place tracker correctly only pointing the device top-down. World center in settings is set to Target.

And laso, I have asked you to advice ANdroidManifest file to check that error is not because of this file