Fail to read map file.
Please provide your development details as below;
1. SDK Version: 5.0.2
2. Development Environment: Unity-Android
3. Tracker/Scanner: Cloud Tracker
4. License Type: Free
5. Target Device(Optional): Xiomi Poco X3 NFC
Hello, i develop app for Android and download 2dmap's from server, but have some problem when 2dmap's are added for tracking.
This my code when I Add tracker data:
public void Launch()
{
Init();
cameraBackgroundBehaviour = FindObjectOfType<CameraBackgroundBehaviour>();
if (cameraBackgroundBehaviour == null)
{
Debug.LogError("Can't find CameraBackgroundBehaviour.");
return;
}
FindMapImages();
}
public void FindMapImages()
{
BetterStreamingAssets.Initialize();
if (Application.platform == RuntimePlatform.Android)
{
path = Directory.GetFiles(Application.persistentDataPath, "*.2dmap");
Prepare();
}
else
{
path = BetterStreamingAssets.GetFiles("MaxstAR/Test", "*.2dmap");
Prepare();
}
}
public void Prepare()
{
trackingObject = GameObject.FindGameObjectsWithTag("Trackable");
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = 60;
AddTrackerData();
TrackerManager.GetInstance().StartTracker(TrackerManager.TRACKER_TYPE_IMAGE);
StartCamera();
}
private void AddTrackerData()
{
if (Application.platform == RuntimePlatform.Android)
{
for (int i = 0; i < path.Length; i++)
{
TrackerManager.GetInstance().AddTrackerData(path[i], true);
}
}
else
{
for (int i = 0; i < path.Length; i++)
{
TrackerManager.GetInstance().AddTrackerData(Application.streamingAssetsPath + path[i], false);
}
}
TrackerManager.GetInstance().LoadTrackerData();
}
Thank you for your interest in MAXST AR SDK.
The forum of MAXST AR SDK doesn't provide any code review.
The forum provides answers to the usage and bugs of MAXST AR SDK.
Also, If you want to download 2dmap through server, please use Cloud Recognizer of MAXST.
With Cloud Recognizer, millions of images can be recognized with no limit.
Cloud Recognizer recognizes image by transmitting real-time camera images to MAXST recognition server.
After recognizing the image, it downloads the trained image file to perform image tracking function on the mobile device.
Please refer to link below.
https://developer.maxst.com/MD/doc/5_0_x/cloud/unity/ex
If you have related the MAXST AR SDK questions, feel free to ask.
Best regards,
Francisco
MAXST Support Team
Are there other ways besides your solution? Because cloudrecognition doesn't work, i have written about it at previous thread.
https://developer.maxst.com/MD/doc/5_0_x/cloud/unity/ex
I tried this but it doesn't work, I want to find how to download 2dmap files to persistentDataPath and add for tracking.
Have you check your recognition count??
If you exhausted the available recognition time without adding the number of recognition, the recognition function will not be activated.
The number of recognition is calculated as the total number of attempts to recognize, regardless of whether it was successful or not.
If you have related the MAXST AR SDK questions, feel free to ask.
Best regards,
Francisco
MAXST Support Team