Log in or register to post comments

Multiple MT360 targets

June 25, 2019 - 12:50pm #1

Hello,

 

I have a question about using the new MT360 with Unity on the HoloLens.

I have trained 3 models. So I have 3 datasets, and imported them in Unity.

I created 3 ModelTargetBehaviour objects, and attached a script to each to show/hide them when tracking is found/lost.

 

What I want to achieve ideally is to track all models simultaneously, but I cannot get this to work.

I understand that this may not be supported. In that case, I want to at least be able to switch between them, so I can decide at run-time which model I want to search for and track.

I am not sure how this is to be done. I looked a little at enabling/disabling datasets, but I do not understand it yet.

 

Moreover, if I do not do anything special, but just run my app with the 3 ModelTargetBehaviours enabled, it seems there is a problem "activating" any dataset after the first. This makes me think they are not loaded correctly and so I cannot possibly switch to them anyway. Here is a part of the log that shows this:

Vuforia Engine initialization successful

UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:Log(Object)

Vuforia.VuforiaRuntime:UpdateInitialization()

Vuforia.VuforiaARController:Start()

System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

System.Reflection.MethodBase:Invoke(Object, Object[])

System.Delegate:DynamicInvokeImpl(Object[])

System.MulticastDelegate:DynamicInvokeImpl(Object[])

System.Delegate:DynamicInvoke(Object[])

Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])

Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)



(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Found Trackable named ObjectA with id 2

UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:Log(Object)

Vuforia.StateManager:AssociateTrackableBehavioursForDataSet(DataSet)

Vuforia.DataSet:Load(String, StorageType)

Vuforia.DataSet:Load(String)

Vuforia.DatabaseLoadARController:LoadDatasets()

Vuforia.VuforiaARController:StartAfterInitializationCompleted()

System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

System.Reflection.MethodBase:Invoke(Object, Object[])

System.Delegate:DynamicInvokeImpl(Object[])

System.MulticastDelegate:DynamicInvokeImpl(Object[])

System.Delegate:DynamicInvoke(Object[])

Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])

Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)



(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Found Trackable named ObjectB with id 4

UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:Log(Object)

Vuforia.StateManager:AssociateTrackableBehavioursForDataSet(DataSet)

Vuforia.DataSet:Load(String, StorageType)

Vuforia.DataSet:Load(String)

Vuforia.DatabaseLoadARController:LoadDatasets()

Vuforia.VuforiaARController:StartAfterInitializationCompleted()

System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

System.Reflection.MethodBase:Invoke(Object, Object[])

System.Delegate:DynamicInvokeImpl(Object[])

System.MulticastDelegate:DynamicInvokeImpl(Object[])

System.Delegate:DynamicInvoke(Object[])

Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])

Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)



(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Could not activate dataset.

UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:LogError(Object)

Vuforia.ObjectTracker:ActivateDataSet(DataSet)

Vuforia.DatabaseLoadARController:LoadDatasets()

Vuforia.VuforiaARController:StartAfterInitializationCompleted()

System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

System.Reflection.MethodBase:Invoke(Object, Object[])

System.Delegate:DynamicInvokeImpl(Object[])

System.MulticastDelegate:DynamicInvokeImpl(Object[])

System.Delegate:DynamicInvoke(Object[])

Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])

Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)



(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Found Trackable named ObjectC with id 6

UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:Log(Object)

Vuforia.StateManager:AssociateTrackableBehavioursForDataSet(DataSet)

Vuforia.DataSet:Load(String, StorageType)

Vuforia.DataSet:Load(String)

Vuforia.DatabaseLoadARController:LoadDatasets()

Vuforia.VuforiaARController:StartAfterInitializationCompleted()

System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

System.Reflection.MethodBase:Invoke(Object, Object[])

System.Delegate:DynamicInvokeImpl(Object[])

System.MulticastDelegate:DynamicInvokeImpl(Object[])

System.Delegate:DynamicInvoke(Object[])

Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])

Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)



(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Could not activate dataset.

UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:LogError(Object)

Vuforia.ObjectTracker:ActivateDataSet(DataSet)

Vuforia.DatabaseLoadARController:LoadDatasets()

Vuforia.VuforiaARController:StartAfterInitializationCompleted()

System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

System.Reflection.MethodBase:Invoke(Object, Object[])

System.Delegate:DynamicInvokeImpl(Object[])

System.MulticastDelegate:DynamicInvokeImpl(Object[])

System.Delegate:DynamicInvoke(Object[])

Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])

Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)

So, essentially, this happens:

  • Found Trackable named ObjectA with id 2
  • [Nothing. No complaint about the dataset not being activated]
  • Found Trackable named ObjectB with id 4
  • Could not activate dataset.         [Because it was already activated for ObjectA?]
  • Found Trackable named ObjectC with id 6
  • Could not activate dataset.

I am using Vuforia 8.3.8, Unity 2018.4.2f1, and MRTK 2.0.0-Beta2

 

I just don't understand why the datasets cannot be activated.

I also don't know for sure how to switch between them so that Vuforia will actually search for the model I want.

 

If someone can help me with some specific pointers, it would be greatly appreciated.

I am not a novice with Unity or programming in general, but I am new to Vuforia and so do not know the API very well yet...

 

Thanks!

Multiple MT360 targets

June 27, 2019 - 4:37am #3

Thank you for the information.

 

I will first have a look at the samples to find out how to switch between databases. I think for our project, the freedom of not needing a guideview is significant. The regular Model Targets would be a backup option, but might not work out for us. Only tracking a single model at once is something we can work with, I think.

I will look at the samples, and hopefully I won't have to bother you again.

 

Thanks!

Multiple MT360 targets

June 26, 2019 - 3:18pm #2

Hello,

Vuforia Engine currently only allows for the activation of a single Model Target device database at any given time. This explains why you cannot activate additional device databases after the first. An additional limitation is that Vuforia Engine can only track a single Model Target at a time, which impacts your use case.

I believe you have the correct idea in activating a target's device database as a run time decision. Vuforia Engine provides APIs to do this, and recently we've updated our Core samples to version 8.3 (available for free on the Unity Asset Store) to demonstrate how this can be accomplished.

Otherwise, you can also train a Model Targets device database to contain several targets. This is different than MT360 in that you have to specify the detection areas for each target during the authoring step in the Model Target Generator. The benefit being that you can use the machine learning to detect multiple targets without having to swap device databases - with the existing limitation that you can only track a single target at a time.

Good luck and let me know if you have further questions.

Thanks,

Vuforia Engine Support

Log in or register to post comments