Search Unity

Vuforia & Unity database load problem

Discussion in 'Vuforia' started by Arkadiy_S, May 11, 2018.

  1. Arkadiy_S

    Arkadiy_S

    Joined:
    May 11, 2018
    Posts:
    1
    Hey, I can not tick the database as it's said 'Databases will be automatically loaded and activated if it's TrackingBehaviour is enabled on scene load'.
    I use Vuforia 7.1.34 & Unity 2018.1.0f2
    I am new to Unity, but have been trying to solve this issue for a while and haven't seen solution.
    Thank you very much!
     
    k_jeonghun and sawthinkar like this.
  2. bsebag

    bsebag

    Joined:
    Apr 5, 2017
    Posts:
    10
    Same issue here!
     
  3. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    You no longer manually check the databases to load in 7.1.34. Instead you either place the targets you want to use in a scene and the right databases will be automatically loaded, or you can load and enable the databases you want to use via the APIs.
     
    sawthinkar and Silvedko like this.
  4. bsebag

    bsebag

    Joined:
    Apr 5, 2017
    Posts:
    10
    When upgrading a project from Unity 2017 to 2018.1.0f2, there are alarms related to databases coming from the Vuforia scripts. Please check the alarms below.

    A project that is perfectly compilable and perfectly runs on Unity 2017 is not compilable on Unity 2018.1.0f2 due to the alarms below. The vuforia was upgraded to version 7.1.34

    Aren't the alarms related to database issues?

    Assets/SamplesResources/VuforiaSamplesUI/Scripts/SamplesMainMenu.cs(127,31): error CS1061: Type `Vuforia.VuforiaConfiguration' does not contain a definition for `DatabaseLoad' and no extension method `DatabaseLoad' of type `Vuforia.VuforiaConfiguration' could be found. Are you missing an assembly reference?

    Assets/SamplesResources/VuforiaSamplesUI/Scripts/SamplesMainMenu.cs(131,44): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
     
    Silvedko likes this.
  5. Silvedko

    Silvedko

    Joined:
    Jan 8, 2013
    Posts:
    1
    Have similar problem with update project from Unity 2017 to Unity 2018.1.0 f2.
    Error occured after "Import Vuforia Assets" when add any Vuforia object on scene manually.
     

    Attached Files:

  6. sindika

    sindika

    Joined:
    May 30, 2018
    Posts:
    2
    how to load and enable the databases via APIs? i have same problem. Please help me thank u
     
  7. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    The APIs for loading the databases have not changed in this new version if you were using them before.

    Here are some examples of loading a dataset as well as activating targets all via APIs.

    Code (CSharp):
    1. public void LoadAndActivateDataset(string loadThisDataset)
    2. {
    3.     TrackerManager trackerManager = (TrackerManager)TrackerManager.Instance;
    4.     ObjectTracker objectTracker = TrackerManager.Instance.GetTracker<ObjectTracker>();
    5.     //Stop the tracker.
    6.     objectTracker.Stop();
    7.    
    8.     //Create a new dataset object.
    9.     DataSet dataset = objectTracker.CreateDataSet();
    10.     //Load and activate the dataset if it exists.
    11.     if( DataSet.Exists( loadThisDataset ) )
    12.     {
    13.         dataset.Load( loadThisDataset );
    14.         objectTracker.ActivateDataSet( dataset );
    15.     }
    16.  
    17.     //Start the object tracker.
    18.     objectTracker.Start();
    19. }
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Vuforia;
    5. public class CreateImageTarget : MonoBehaviour {
    6.     public GameObject augmentationObject;
    7.     // Start once Vuforia is initialized
    8.     void Start () {
    9.         VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);
    10.     }
    11.     void OnVuforiaStarted()
    12.     {
    13.         int counter = 0;
    14.         // Loop through all activated trackables
    15.         IEnumerable<TrackableBehaviour> tbs = TrackerManager.Instance.GetStateManager().GetTrackableBehaviours();
    16.         foreach (TrackableBehaviour tb in tbs) {
    17.             // This will filter by trackables that haven't been defined previously in the scene.
    18.             if (tb.name == "New Game Object") {
    19.                 // Change generic name to include trackable name
    20.                 tb.gameObject.name = ++counter + ":DynamicImageTarget-" + tb.TrackableName;
    21.                 // Add additional script components for trackable
    22.                 tb.gameObject.AddComponent<DefaultTrackableEventHandler>();
    23.                 tb.gameObject.AddComponent<TurnOffBehaviour>();
    24.                 // This section will add an augmentation based off the GameObject defined on the script.
    25.                 // Replace this with whatever you prefer to augment
    26.                 if (augmentationObject != null) {
    27.                     // instantiate augmentation object and parent to trackable
    28.                     GameObject augmentation = (GameObject)GameObject.Instantiate(augmentationObject);
    29.                     augmentation.transform.parent = tb.gameObject.transform;
    30.                     augmentation.transform.localPosition = new Vector3(0f, 0f, 0f);
    31.                     augmentation.transform.localRotation = Quaternion.identity;
    32.                     augmentation.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
    33.                     augmentation.gameObject.SetActive(true);
    34.                 } else {
    35.                     Debug.Log("<color=yellow>Warning: No augmentation object specified for: " + tb.TrackableName + "</color>");
    36.                 }
    37.             }
    38.         }
    39.     }
    40. }
     
  8. sindika

    sindika

    Joined:
    May 30, 2018
    Posts:
    2
    error.PNG
    i want to make an augmented reality with video player, but the video cant play when i scan the marker(image target)
     
    Last edited: May 31, 2018
  9. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    I'll need more info about what you are trying in order to assist you. Have you referenced the video playback sample in the core samples?
     
  10. Taki24

    Taki24

    Joined:
    Jun 6, 2018
    Posts:
    9
    Hello,

    Sry to interrupt but i have the same problem as @sindika but in a different situation. Im a newbie and id like to create an object tracker app, wich has some visual effect on the tracked object. I scanned the object and i can see it on the scenes but in the vuforia configuration at the databases section i have the same error message.

    Reference video:


    I tried to fully describe the aplication and i hope u can help me. :)
     
  11. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Which error message?
     
  12. Taki24

    Taki24

    Joined:
    Jun 6, 2018
    Posts:
    9
    "Databeses will be automatically loaded and activated if its TrackingBehaviour is enabled on scene load"

    the same as @sindika
     
  13. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    This is not an error, but an info box explaining the new functionality of loading databases. If you've added your database to the project in 2018.1 with Vuforia 7.1, you can create an object in your scene that utilizes this database and it will automatically be loaded and activated.

    Alternatively you can load and active that database via APIs and then set up your objects in the scene via code.
     
    Taki24 likes this.
  14. Taki24

    Taki24

    Joined:
    Jun 6, 2018
    Posts:
    9
    Sry i meant for the information box :D.
    Im not exactly sure what a im doing badly. As u can see on the pictures i added the database and on the scene if im right i have the scanned object's box wich represents my object, but at the vuforia configuration i have that information box still and when i go for adding a database and still opening the database and it wont work after that either.

    And again sry that im this newbie :( but i ve just started learning.
     

    Attached Files:

  15. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    The info box will remain there regardless and the Vuforia Configuration will not change. This is meant to now show which databases are detected by Vuforia and inform you that they will be loaded and activated once in the scene.

    In your screenshot, the Object Target you've added to your scene will now be loaded and activated when you are running your app. When you run it you should see some log lines mentioning your database was loaded. Are you seeing this message?

    On a separate note, I have a recommendation. If your object is a cube such as the one seen in your screenshot, I would recommend using our Multi-Target feature instead of Object Target as Multi-Target was primarily designed to address this use case. The Object Target feature will likely work with a cube, but you might find it easier to use Multi-Target instead.
     
    Taki24 likes this.
  16. WantingUnity666

    WantingUnity666

    Joined:
    Oct 30, 2017
    Posts:
    1
    Hi Bsebag,
    i have same issue here after upgrading the Unity from 2017 to 2018.1.0f2, did you solve the problem ??
    Thanks !
     
  17. exhibitit

    exhibitit

    Joined:
    May 6, 2018
    Posts:
    1
    Can you provide more information about how to use either of these scripts?

    Thanks
     
  18. loop_frame

    loop_frame

    Joined:
    Jul 22, 2018
    Posts:
    2
    I am still facing the same problem since last three days . I so wanna make it work and move on .
     
  19. jariwake

    jariwake

    Joined:
    Jun 2, 2017
    Posts:
    100
    @Vuforia-Strasza How does one load a database? I have created my database with the targetManager, added the App licence key to Vuforia configuration in Unity, but the Databases section does not list my database (only the default VuofriaMars_xxx ones). And when I try to create an image target, I do not see my database listed in the Database dropdown of the ImageTargetBehavious component - only --- EMPTY --- and VuforiaMars_Images are available.

    To me this seems like a chicken and egg problem - the database cannot load because there is no image target and I cannot create an image target because the database is not loaded.
     
  20. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello @jarileon,

    The Vuforia Target Manager allows you to download device databases in the .unitypackage format. After downloading this from the Vuforia Developer Portal, import it into your project via the Unity Editor: Assets->Import Package->Custom Package...

    Once imported, you can select the database and target you want to recognize in the prefab.

    Thanks,
    Vuforia Engine Support
     
  21. jariwake

    jariwake

    Joined:
    Jun 2, 2017
    Posts:
    100
    Thanks for the answer. I had accidentally set my database type to "cloud", and that why I did not see the download button in the Target Manager (which then led me to believe the downloading the targets is not required anymore because of the automatic loading thing..)
     
  22. CMI_Corrie

    CMI_Corrie

    Joined:
    Apr 11, 2018
    Posts:
    3
    With the added functionality of loading databases automatically, will this rectify having multiple model target scenes and only one dataset being active at a time?
     
  23. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Rectify it in what way?
     
  24. Kaltik

    Kaltik

    Joined:
    Nov 14, 2013
    Posts:
    2
    Hello! I sucessfully imported database to my project, but i can't select image target from example database and my own database either.
    Unity version 2018.2.3f1 and Vuforia 7.2.24
     
  25. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Can you share a screenshot of what you are seeing?
     
  26. mayessbaccari

    mayessbaccari

    Joined:
    Sep 10, 2018
    Posts:
    2
    Hello, I have the same problem:
    I cannot detect my databases in the vuforia configuration
    CaptureVuforia.PNG
     
  27. clarenceyang284

    clarenceyang284

    Joined:
    Jun 22, 2018
    Posts:
    1
    Hi, i also have the same problem and I've been stuck on this for a while now.
    The databases are not activated.
     

    Attached Files:

  28. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    @mayessbaccari @clarenceyang284 In both of your screenshots your databases are present. As the info box mentions, databases are now automatically activated when a target in the database is added to your scene. Please try creating a target in your scene with this database and it should work as expected.
     
  29. mertmercan

    mertmercan

    Joined:
    Aug 6, 2018
    Posts:
    1
    Hi,

    I have a little different problem here.
    I have uploaded my database (which is created in Vuforia Model Target Generator) to unity. After that, I have created a model target in the scene and selected the database as the target database.
    The problem is, when I run my app, I see the target helper on my screen, however, it does not detect the object. I have added the screenshot, please find the attached file.
    Can anyone help me out with this?
     

    Attached Files:

  30. Chris_yes

    Chris_yes

    Joined:
    Feb 25, 2018
    Posts:
    2
    I need help. I created a project in Unity 2017, which I am now opening in Unity 2018. I am now getting the following error: Type `Vuforia.ImageTarget' does not contain a definition for `StartExtendedTracking' and no extension method `StartExtendedTracking' of type `Vuforia.ImageTarget' could be found. Are you missing an assembly reference? Please help
     
  31. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello @Chris_yes ,

    Likely the version of the SDK in Unity 2018 you've downloaded is not compatible with the Unity 2017 version of the samples.

    Suggest you look through our migration guides to see if there is anything that can assist: https://library.vuforia.com/content...lution/How-To-Migrate-Your-Existing-Apps.html

    Otherwise, you likely have to review the sample code to see what API changes have occurred.

    Apologies for the inconvenience.

    Thanks,
    Vuforia Engine Support
     
  32. miqbalag

    miqbalag

    Joined:
    Nov 5, 2018
    Posts:
    1
    thankyou
     
  33. Kromian

    Kromian

    Joined:
    Dec 18, 2018
    Posts:
    1
    I am new to Vuforia and Unity, but creating a basic AR app is simple enough to understand. The problem I am having is that I have tried different ways to make Unity upload the database and target image I created in Vuforia but under database in Unity is says "Empty". So i can't move on from that. I see some people in this tread have a similar problem, and I'm not seeing a solution. I have checked on line and there seems to be no solution for this. Can someone please hep with this.
     
  34. jariwake

    jariwake

    Joined:
    Jun 2, 2017
    Posts:
    100
    You must download your database from https://developer.vuforia.com/targetmanager/ where you created your targets. After pressing the "Download Database (All)" button choose "Unity Editor" and it will download a unitypackage file. Import that package to your project and then your database should be available in the inspector.

    upload_2018-12-21_9-31-37.png
     
  35. Studio-Raef

    Studio-Raef

    Joined:
    Jul 1, 2013
    Posts:
    9
    I had the same issue.

    I couldn't select any database nor image under Image Target Behaviour even when I imported the default (Mars) Database. No way of figuring it out, until I found someone online that said:

    Change "." to "," in your float variables, in your *.xml files.

    And now it works.

    @meedabit have you guys looked into it being a localization issue?
     
  36. AttanoAiden

    AttanoAiden

    Joined:
    Dec 22, 2018
    Posts:
    1
    I have the same problem as most
    And....
    When I try to add a Vuforia Mars database or my database, the console displays a lot of errors (below is a screenshot), and after that my database does not appear in the list in the ImageTarget menu and by default / --- EMPTY --- /
    1.png 2.png 3.png



    I apologize if I made a stupid mistake as I am a beginner in this)
     
  37. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    @Studio-Raef,

    I've seen scattered reports of users needing to manually edit the XML files in their device database to overcome issues, but had not made the localization connection.

    Can you explain further why this may be an issue? Are you using Unity in a different spoken language?

    Thanks,
    Vuforia Engine Support
     
    Dracos150 likes this.
  38. Dracos150

    Dracos150

    Joined:
    Jan 6, 2019
    Posts:
    7
    @meedabit hello, can you help me please?
    have same problems....
    When I try to add to Imagetarget my database with image target, they does not appear in the list in the ImageTarget menu and by default / --- EMPTY --- / upload_2019-1-6_22-41-53.png
    BUT There is my database in ARcamera vuforia configurarion
    upload_2019-1-6_22-44-1.png
    when I Change "." to "," in my float variables, in my*.xml files.
    database and imagetarget appears
    upload_2019-1-6_22-45-33.png
    but an error occurred in the console
    "Could not associate DataSetTrackableBehaviour 'q' - no matching Trackable found in DataSet!"

    and when my image detecte unity is crashing.
    help please
     

    Attached Files:

    m-poyade likes this.
  39. Dracos150

    Dracos150

    Joined:
    Jan 6, 2019
    Posts:
    7
    database
     

    Attached Files:

  40. domhanak

    domhanak

    Joined:
    Jan 7, 2019
    Posts:
    5
    @Dracos150 @meedabit Same here
    1. I had to edit my .xml file so that . is replaced with , in decimals
    2. Now it shows like @Dracos150 but I get error like he gets
     
  41. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello @Dracos150 @domhanak,

    Which version of Vuforia SDK and Unity Editor? Are you using any localization settings?

    Thanks,
    Vuforia Engine Support
     
  42. domhanak

    domhanak

    Joined:
    Jan 7, 2019
    Posts:
    5
    @meedabit
    Vuforia SDK is 7.5.26:c2db52fe8dd1a69ea95637a3df8aa59c
    Unity is 2018.3.0f2

    No localization settings from what I know.
     
  43. domhanak

    domhanak

    Joined:
    Jan 7, 2019
    Posts:
    5
    @meedabit Steps to reproduce

    1. Create a simple scene with AR Camera and one ImageTarget.
    2. Import the database from Target Manager
    3. Change the '.' to ',' in dbName.xml
    4. Set target for ImageTarget
    5. Add a cube or whatever
    6. Play it and you should see error in console.
    7. Now showing the marker on camera crashes whole unity. This also happens if I build it and run it on my phone.

    What is strange for me is that in log I can see:
    • Found Trackable named goalmarker with id 1
    and right on the next line I see
    • Could not associate DataSetTrackableBehaviour 'goalmarker' - no matching Trackable found in DataSet!"


    and when I google a bit I find this example which indicates it was discovered and it shouldnt throw this error.
    https://csharp.hotexamples.com/exam...hp-dataset-gettrackables-method-examples.html
     
    Last edited: Jan 8, 2019
  44. domhanak

    domhanak

    Joined:
    Jan 7, 2019
    Posts:
    5
    @meedabit I can also confirm it happens when importing & using vuforia samples

    Also I am really happy for your quick responses, let me know tomorrow :)
     
    Last edited: Jan 8, 2019
  45. domhanak

    domhanak

    Joined:
    Jan 7, 2019
    Posts:
    5
    @meedabit @Dracos150 So I got rid of this error by modifying ImageTarget width and height ind advanced to match the size attributes in DataSet. Let me know if it helps.
     
  46. Dracos150

    Dracos150

    Joined:
    Jan 6, 2019
    Posts:
    7
    @domhanak

    where exactly did you change sizes
    can you show screenshot please?
     
  47. Dracos150

    Dracos150

    Joined:
    Jan 6, 2019
    Posts:
    7
    @meedabit
    Vuforia SDK is 7.5.26
    Unity is 2018.3.0f2
     
  48. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello,

    We believe this is is related to the scripting run time version in the Unity Player settings. With 2018.3, this defaults to .NET 4.x, which is not supported with Vuforia Engine 7.5.

    Old projects upgraded to Unity 2018.3 won't be affected, but new projects created with Vuforia 7.5 and Unity 2018.3 will be. We can offer with two possible resolutions:
    1. Upgrade to Vuforia 8.0.X (which supports .NET 4.x)
    2. Switch the scripting run time version to .NET 3.5 if you don't want to/cannot upgrade the Vuforia Engine SDK version
    With either of the above resolutions, developer's won't need to replace "." with "," in the device databases XML file.

    The root cause of this problem is that with .NET 4.x, the locale of the user's operating system is used which has an effect on the parsing of floating point numbers if your system language is German, French, etc.

    As mentioned, this has been fixed this Vuforia Engine SDK 8.0, but unfortunately our release was not in time for Unity 2018.3 commercial release. Apologies for any inconvenience.

    @Dracos150 @domhanak let me know how it goes.

    Thanks,
    Vuforia Engine Support
     
  49. Dear_Slim

    Dear_Slim

    Joined:
    Feb 5, 2019
    Posts:
    1
    hello, I am a beginner of unity.
    now I have met the same problem as someone above ,about database. upload_2019-2-5_13-8-57.png
    just like this...
    could you please help me to solve the problem??
    thank you so much!!
     
  50. aminaabidi353

    aminaabidi353

    Joined:
    Mar 14, 2019
    Posts:
    1
    Hey, I can not tick the database as it's said 'Databases will be automatically loaded and activated if it's TrackingBehaviour is enabled on scene load'.
    I use Vuforia 7.1.34 & Unity 2018.3.9f1
    I am new to Unity, but have been trying to solve this issue for a while and haven't seen solution.
    Thank you very much