Log in or register to post comments

Download Datasets with QCar Unity Extension

February 3, 2012 - 7:21am #1

Hello,

I want to use multi-Dataset with QCar 1.5 beta Unity3D extension.

Is it possible to load a dataset from the web ?

I have try to user this code, but it consider that the dataset doesn't exist.

private bool LoadDataSet(string dataSetPath, DataSet.StorageType storageType)
{
// Check if the data set exists at the given path.
if (!DataSet.Exists(dataSetPath, storageType))
{
Debug.LogError("Data set " + dataSetPath + " does not exist.");
return false;
}

// Request an ImageTracker instance from the TrackerManager.
ImageTracker imageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);

// Create a new empty data set.
DataSet dataSet = imageTracker.CreateDataSet();

// Load the data set from the given path.
if (!dataSet.Load(dataSetPath, storageType))
{
Debug.LogError("Failed to load data set " + dataSetPath + ".");
return false;
}

// (Optional) Activate the data set.
imageTracker.ActivateDataSet(dataSet);

return true;
}

...

LoadDataSet("http://www.mysite.com/datasettest/Tarmac.dat", DataSet.StorageType.STORAGE_ABSOLUTE);

Does anyone have an idea ? Help !

Re: Download Datasets with QCar Unity Extension

February 5, 2012 - 2:23am #3

It works fine ! I didn't find this post.

Thanks you very much ksiva !!!

Re: Download Datasets with QCar Unity Extension

February 3, 2012 - 3:42pm #2

You have to download the dataset to the device first, the absolute path refers to a location on the device. Try using Unity's WWW class to download the file, and System.IO.File.WriteAllBytes to save it. You can find some sample code in this thread:

http://ar.qualcomm.at/node/2001352

- Kim

Log in or register to post comments