Log in or register to post comments

VuMark HexStringValue method

January 21, 2019 - 3:03am #1

Hello,

 

I've been recently doing some additional tests on VuMarks, and I faced a problem with those with BYTE type ID. Everything works just fine for designing and generation, however there is a major issue with the HexStringValue() method which should retrieve the VuMark's id. Additionnaly, the description of the method in the API documentation is foggy : "TEMP: Helper method for displaying the instance ID."

What exactly does this method do? It is unclear, and in my case it doesn't work for retrieving the ID. And if it isn't its purpose (considering the name of the method, I suppose the odds are low), which method should be used to retrieve BYTE type IDs?

 

Thanks for helping.

VuMark HexStringValue method

January 28, 2019 - 10:44am #9

Hello @dkos,

Thanks for the resources. I was able to upload the SVG file to our Target Manager and generate an instance using the specified string: "abcd1101ccbe5984dda0c5479802". I then downloaded the device database and imported it into our Core Samples. I also used a Development Key.

Unity Editor: 2018.3.1f1

Vuforia SDK: 8.0.10

Vuforia Core Samples: 8.0.11

Once I selected and activated the VuMark device database in the inspector, I was able to decode the instance correctly and it displayed both in logs and UX. Taking a further look at the scripts used to display this data (/Assets/SamplesResources/SceneAssets/VuMark/Scripts/VuMarkHandler.cs), I see that is is using the same API that you're using.

Perhaps this is related to the license type? Keep in mind that if you have a device database with more than one VuMark, and you're not using a Pro license, it will select the first dataset listed in the device database. There is a table (under Adding a License Key) that better describes this behavior here: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/Working-with-VuMarks.html

Thanks,

Vuforia Engine Support

VuMark HexStringValue method

January 25, 2019 - 10:10am #8

Hello,

Oops - typo. What I meant to ask for is the .SVG file for the byte encoded VuMark template that you uploaded to the Vuforia Target Manager (the step previous to downloading the device database). This will allow me to replicate the workflow and test the API in our automation harness.

Sorry about that...

Thanks,

Vuforia Engine Support

VuMark HexStringValue method

January 25, 2019 - 8:10am #7

Hello,

The ID was initially a test ID, so it isn't a problem to post it here: abcd1101ccbe5984dda0c5479802.

Thanks.

VuMark HexStringValue method

January 24, 2019 - 8:53am #6

Hello,

Can you share the byte encoded ID that is problematic? We'd like to plug it into our automation framework to see if we can get a similar error.

If you don't want to post here, please DM me a download link.

Thanks,

Vuforia Engine Support

VuMark HexStringValue method

January 24, 2019 - 12:57am #5

Hello,

Okay, so it seems I must be doing a mistake somewhere, however I just can't find it. I will design a VuMark with shorter ID and see what happens. Maybe there is an issue with my Vuforia version, which is 7.1.31, but I don't remember seeing any fix concerning this in later releases. I checked if I was using the right license key (just in case) and all is good. I also didn't mention it, but I'm working on HoloLens, which could help you a bit, sorry for not providing you this piece of information sooner.

Yes, I am. The issue shows up only with my VuMark design with a BYTE encoded ID (at design, ID size of 14, so 144 bright and dark elements required, and 28 hex characters asked at generation via the portal for the ID), because the HexString Value method will only be called when I use this type of design.

Thanks for your active support.

 

VuMark HexStringValue method

January 23, 2019 - 3:14pm #4

Hello,

Thanks for the feedback. We did some internal testing and found that our byte encoded VuMark was able to return the hex value of the instance.

Are you testing with different VuMark designs that have been encoded for String, Numeric and Bytes? In other words, are you testing this API on a VuMark device database whose instance IDs have been byte encoded?

Thanks,

Vuforia Engine Support

VuMark HexStringValue method

January 23, 2019 - 1:23am #3

That would be great!

Here is the code snippet:

private void OnVumarkFound()
{
        //infoComponent.text = "Found";
        string id = "Found";
        //Display works here => VuMark is found
        foreach (var item in myVumark.GetActiveBehaviours())
        {
            string vuMarkID = GetVuMarkId(item.VuMarkTarget);
            id = vuMarkID;
            //This id is never retrieved, all that is passed down is an empty String
            current = augmentationsMeshes.transform.Find(vuMarkID).gameObject;
            current.SetActive(true);
        }
        infoComponent.text = "id:" + id;
        //This is not displayed. This part of the code is never actually reached, and the display
        //via the infoComponent is "Found" (affected only in this method)
    }

string GetVuMarkId(VuMarkTarget vumark)
    {
        switch (vumark.InstanceId.DataType)
        {
            case InstanceIdType.BYTES:
                infoComponent.text = "id: " + vumark.InstanceId.HexStringValue;
                //The issue seems to be here. This never return more than an empty string
                return vumark.InstanceId.HexStringValue;
            case InstanceIdType.STRING:
                return vumark.InstanceId.StringValue;
            case InstanceIdType.NUMERIC:
                return vumark.InstanceId.NumericValue.ToString();
        }
        return string.Empty;
    }
   

 

It is inside a class inherited from ITrackableEventHandler, and works similarily to a DefaultTrackableEventHandler, except it is designed for VuMarks.

Also, I must point out that this code works perfectly for VuMarks with both numerical and string type IDs, so when StringValue of NumericValue are called. The only exception is BYTE type, and I can't understand why even more if the HexStringValue method behaves as it should. Maybe the ID's length is too big (28 hex characters asked at generation), but it would be strange because such an ID is allowed at design step.

Thanks for your help.

VuMark HexStringValue method

January 22, 2019 - 11:38am #2

Hello,

I'm working with the development team to get a more accurate text.

Looking at similar APIs, like NumericValue(): "Returns the byte buffer as a 64bit unsigned long if the data type is marked as a NUMBER. 0 is returned otherwise." My expectation is that HexStringValue() would behave similarly.

What is actually being returned when you try to use the HexStringValue() API? Can you provide a snippet of the sample code you're using to call this API, and from which script you are calling it from?

Thanks,

Vuforia Engine Support

Log in or register to post comments