Description

Moved from Parent

Long Initialization Time on HoloLens

I am developing an offline Vuforia app for the HoloLens 2 that requires a delayed initialization. I am able to force Vuforia to wait until I call VuforiaRuntime.Instance.InitVuforia(); However, on the HoloLens, it takes 13 seconds for Vuforia to initialize and finish its tasks. During this time, the entire screen goes blank and I am unable to see any holograms or do anything. In the Unity editor, initialization takes a fraction of a second. 

 

On older forum posts, there is a line of code (VuforiaUnity.SetHint(VuforiaHint.HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION, 1);) that users are told to use, however, Unity does not recognize the VuforiaUnity namespace and the link to the documentation results in a 404. 

 

What can I do to significantly lower the load times for Vuforia initialization? I am using Vuforia 9.8.8 and my image target database only has 8 targets. 

Hello,

I believe the forum post you found is related to this text, which is in the following article: https://library.vuforia.com/articles/Solution/How-To-Migrate-a-Unity-Project.html

Dogfishlab

Wed, 10/13/2021 - 19:09

In reply to by medabit

I should have been more specific in my original post. Unity does not have a problem recognizing the VuforiaUnity namespace, but VuforiaHint. "error CS0103: The name 'VuforiaHint' does not exist in the current context". I am not sure what I should be importing to make that work. 

Finally was able to get it to compile. For those with the same issue as me, you need to put 

VuforiaUnity.SetHint(VuforiaUnity.VuforiaHint.HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION, 1);

Now, it only takes half a second to start and initialize Vuforia. 

Holograms on Image target is not interactable

Hi,

I have a image target detected and there is a cube attached on it. I was wondering if I can resize, grab or move the cube after detection to a certain place by hand in hololens 2. I searched a lot but did not find a solution. 

 

I am using Vuforia 10, MRTK 2.7 and Unity.

 

Regards,

Deploy AR Project on Hololens

Hi there,

I've been working on a AR unity project that has come together quite nicely so-far and I will be able to get hands on a Hololens 2 soon, and am hoping to deploy my project on there. I won't have the Hololens for too long, so I am hoping to get a head start with knowing to to expect. Essentially I am using Vuforias AR Camera in order to find a Marker (QR Code) with my Webcam. As a child of this marker, an Object (for simplicity in this case a white box) appears whose position is being controlled in reference to this marker. Simultaniously I have a User Interface locked to the corner of the screen showing some sensor data. See attached image.

With being quite new to unity, vuforia and never having used the Hololens, there are a couple of questions I didn't manage to find answers for and am hoping hints on:

  1. Object Positioning in relation to marker. Now my webcam really only has the visual input and therefore as soon as the marker is out of view, the object will dissapear as well, while maintaining its relative position to the marker in the scene view. This totally makes sense. However when using the Hololens, I am hoping that the marker only really acts as a starting position for the object and when the marker is out of view of the Hololens, it is still able to show the position of the marker. As far as I have looked into the Hololens should be able to do this (using further visual reference points and its own gyro etc.). Will the additional hardware capabilities of the Hololens take care of that for me, or is there additional coding to be expected?
  2. Object Scaling. It is rather important to me that the object itself maintains its size relative to the marker. My preset scaling of the object (being a child of the marker) kept changing on me. So if I have eg. a 10x10cm marker and a 5x5x5cm object, which has a 2x2x2 object attached to it, how do I preset this, for my object and the object attached to it to be of the right size. It seems as the child object tries to express its size and position based on the parent objects size and positiuon.
  3. When the image target is a bit further away, it does not get recognized. When I move the image target closer and back to original position, it gets picked up along the way and displays the object. Why wouldnt it recognize it before? The image really seems clear enough to be seeing it right away. Does the distance I set between AR Camera and the image target in the scene view play a role?
  4. Does the UI simply show holographically on the Hololens, or does it require a different interface?

I am sure I am not the first person asking those questions, however I havent come across the right answers for them. 

Thanks

Jonas

 

 

Hey,

 

From my experience:

Webcam cannot detect hololens 2 camera

Hi,

I am using Hololens2 + unity 2020.3 + vuforia 10.0 + MRTK 2.7.2 to try image target sample. It works fine when I just use computer webcam, but when connect to hololens2 camera, it shows black in play mode. In vuforia configuration->play mode -> webcam-> no camera detect. In play mode, my hololens shows text : receiving...., so I guess it connect to unity. However, there is still no image show in playmode, it is always black.

Do anybody have suggestions? thank you very much!

 

Regards,

YUAN

Hello,

Vuforia Engine SDK does not support the HoloLens Emulator, nor does it support the HoloLens remoting feature where the HoloLens webcam is used in Play Mode.

Integrating Vuforia into CloudXR

Hello,

I've been trying to integrate Vuforia into NVIDIA CloudXR client, however I still haven't succeded. I've tried using both Vuforia SDK versions 10 and 9.8. My application fails right after Vuforia starts the camera. As far as I understood Vuforia has to be initialized in a non-UI thread so I've just adopted the UWP sample. Executing the callback function startAR() seems to be the point where things go wrong. The CloudXR client can establish a connection to the server but right after the camera starts there are no more frames getting rendered. To my understanding the callback function gets executed in a dedicated thread and that seems to somehow interfere with the single-threaded game loop from the CloudXR Update() function. The CloudXR client uses CoreWindow::GetForCurrentThread().Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent) in order to stay responsive to input events.

Is there an alternate soultion to initialize Vuforia or a workaround to use it with a single-threaded game loop?

Kind regards, Julian

Julian243

Wed, 08/04/2021 - 06:59

In reply to by medabit

Hello,

To my knowledge CloudXR does not require access to the camera.

Kind regards,

Julian

Vuforia UWP sample 10.0.12 build for SDK version 9.8.5?

Hello,

I've tried to use the SDK UWP 10.0.12 with the UWP sample 10.0.12 but it seems like the sample was actually built for Vuforia Engine 9.8.

Am I missing something or is the UWP sample simply not updated to the latest engine version? When will the UWP sample be released for Vuforia Engine 10?

Kind regards

Julian

Hello,

Thanks for the report. We are investigating the issue and will look to resolve ASAP.

Will post back here once there is an update.

-Vuforia Engine Support

Hello @Julian243,

We've resolved the issue with the 10.0 native UWP samples posted on the Vuforia Developer Portal: https://developer.vuforia.com/downloads/samples

Can you please try again?

Thanks, and apologies for any inconvenience.

-Vuforia Engine Support

Hello,

thank you it works now!

Unfortunatly I get the error message: "AR:ERROR: Vuforia does not support RenderingPrimitives for optical see-thru eyewear" on HoloLens2 and I don't get any output displayed.
Everything else seems to work now.

Kind regards,

medabit

Tue, 08/03/2021 - 17:20

In reply to by Julian243

Hello,

Unfortunately, our UWP samples are not meant to be run on HoloLens. They are specific to UWP tablets. Currently, we only release HoloLens samples for Unity.

Object Alignment using Vuforia and Hololens

Hello, we are currently working on a project using vuforia on the hololens, and we want to be able to overlay a model of an object over the object once scanned. The scanning process is working, and the model is placed into the world, but it is inconsistent in its alignment. Sometimes the model is in the same place, but other times it is angled or in a completely different location. We are using Unity and Model Targets. We have been trying to work around this issue for quite a bit now, but nothing appears to make it consistently go in the same place. Your help is very much appreciated!

Hello,

I think there are several options to check:

Hololens2 ImageTarget World center issue

Hi,

 

in my app, the world center seems to be off.

I'm using MRTK 2.7.0 with OpenXR 1.0.0 and Vuforia 9.8.8

On the Hololens, the Image Target gets recognized, but its position has a random fixed offset after the App initializes. The Setup is similar to the hololens2 Samples from the Asset store, but I cannot verify that the samples works as intended, because it doesn't compile.

I suspect, that the WorldCenterMode "Device" wich is enforced does not work properly? Extended Tracking and "Track Device Pose" are enabled.

the MRTK Maincamera under the Playspace has the VuforiaBehaviour and DefaultInitializationErrorHandler script attached. the Image marker are separate like in your samples.

running the app in the Editor with a Webcam works as expected. With that random offset on the Hololens, the ImageTargets are basically useless for me.

EDIT: I think I found the Culprit: OpenXR. Switching back to Windows Mixed Reality in the Project settings and using a default mixed reality profile in the MRTK solved the issue. This cost me hours! As far as I have understood, OpenXR is supposed to replace windows mixed reality in the future, which is why i opted for it. 

 

tldr: DO NOT USE OPENXR!!!!!!!!!!!!!!!!!!!!!!!!!!

br

Laurenz

Hi,

I have the same issue, using OpenXR and I had to switch back to Windows Mixed Reality. As it is marked as deprecated, it is a shame, that the issue still exists and there is no answer from PTC.

Walkramis

Fri, 08/06/2021 - 15:47

I am also having issues with OpenXR and vuforia, when using model targets. Since Windows Mixed Reality is not recommended for new projects I hope that this is being looked at.

I have the same issue and would really appreciate some reactions from PTC. The problem is probably easily fixed, it's just an offset from the original position, depending on the distance between user and target, as it seems to me.

Hey there,

 

First of all, I'm sorry that all of you are currently being affected by this issue. It's recognized and look at internally by our R&D team.

I also have the same problem. It can not be a setting problem? I tried it with both Vuforia 10 and 9 on a HoloLens 2. It's really messy.

When do you plan to solve the problem? Will it work this year?

Thank you very much!

Hey everyone,

 

Your feedback is very important, so keep it coming!

Sadly this is a deeper issue where no temporary fix has been found yet. Our R&D team has been working with Microsoft to find a solution and is still working on it.

 

Does the problem only occur with OpenXR? Or on the entire Hololens 2? That would be very important for me, since we have to do another trial this week.

Hey there,

 

Unless someone else knows otherwise, the latest I know is that this only happens when using OpenXR.

Hope that helps for your trials next week. Good luck! 

 

Kind regards,

Patrick Scheper

Spent the whole day with Unity and Vuforia and the HoloLens 2. So I can't find a combination that is runnable. Does anyone have any project that runs correctly?

Best regards

Hello @bpuladi,

So the Engine Unity Samples for HoloLens do not work? This is built and tested with each release, so our expectation is that if you build it as-is, it will work.

@medabit, @pscheper, sadly it does not work with the standard example and Windows Mixed Reality either.
This is what does not work with Unity 2020, Vuforia 10.3.2, and gives an offset

robotechnology1

Wed, 09/08/2021 - 06:48

Can confirm tracking offset with Vuforia and OpenXR. The offset seems to be random or at least dependent on when and where the image comes into sight. Orientation seems to roughly match, but location is offset by anywhere between a few centimeters and a couple of meters.

Well, for me the problem occurs independently of OpenXR. This is a general problem with HoloLens 2.

Is there any news in the meantime? I mean, it worked well for so long, why not suddenly now?

Is there a Vuforia version where it works?

 

Hey everyone,

 

Thank you for the great feedback that was provided over the past months. Because of your feedback we fixed the offset issue by officially supporting the OpenXR plugin with the newest Vuforia Engine release (v10.4.4)! 

Hi,

the issue seems to persist even after 10.5.5.

There seems to be a same issue described below when using OpenXR.

Using Unity 2020.3. 

pscheper

Mon, 02/28/2022 - 17:44

In reply to by Jotham

Hey there,

 

Would you be able to provide reproducible steps for us to be able to test? The issue presumably was fixed in v10.4.4. 

 

Kind regards,

Patrick Scheper

Technical Community Manager

Hello

 

I'm not able to share my project but I can tell you that I'm using latest release of MRTK from Github - copied code - not from package.

Disabling VuforiaBehaviour component causes Null Reference Exception error to log each frame

I need to disable the VuforiaBehaviour script in my scene (in Unity), and do so with VuforiaBehaviour.Instance.enabled = false;. Every frame after this, an error is logged in the console "NullReferenceException: Object reference not set to an instance of an object."

I have no other custom scripts that make a direct mention of the VuforiaBehaviour script instance that could cause this, and this issue occurs anywhere I place the disable command, whether it be a coroutine or function or on Update(). Start() is the only function it could be placed without the issue occurring. Unfortunately I can't keep it in Start(). The issue occurs of the HoloLens 2, the intended device for the app, though I don't know if that plays a role.

Has anyone ran into this or something similar? Is there a proper method of toggling Vuforia that I'm missing? Any insights welcome.

Unity 2019.4.5

Vuforia 8.5.9 and 9.8.8 (tried updating to see if it helped)

HoloLens 2 

Interactable Scripts Not accessible - Vuforia Sample for Hololens 2- Unity 2019.41f

Respected Sir/Madam,

I am currently doing a Project which involves Vuforia sample for Hololens 2 for Unity version 2019.4.10f1 Personal, which involves Image Tracking. I understand there is an Inbuilt MRTK Version 2.5.3. While developing an Application I encountered a bug after switching from Game mode to Scene mode in Unity. I am not able to access the Interactable Script of any Prefab Object (Example: A PressableButton) in the Project and therefore

I am not able to add any Interaction for a particular Button to perform an action.

When I click on the InteractableScript in the Inspector Window it just doesn't open and I get a NullReferenceException.

May be there is some dependency Problem and some piece of code gives rise to this Exception.

NullReferenceException: Object reference not set to an instance of an object Microsoft.MixedReality.Toolkit.UI.Editor.InteractableInspector.TryGetInputActions (System.String[]& descriptionsArray) (at Assets/MRTK/SDK/Editor/Inspectors/UX/Interactable/InteractableInspector.cs:559) Microsoft.MixedReality.Toolkit.UI.Editor.InteractableInspector.OnInspectorGUI () (at Assets/MRTK/SDK/Editor/Inspectors/UX/Interactable/InteractableInspector.cs:82) UnityEditor.UIElements.InspectorElement+c__DisplayClass58_0.b__0 () (at :0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

But the Interactable Script is working in the Runtime (Game Mode) but not in the Scene Mode. 

I am not able to understand why this occurs and I have also raised a Issue in github of MRTK and I got an answer which I am not able to implement it into the Project. https://github.com/microsoft/MixedRealityToolkit-Unity/issues/9882#issuecomment-856317545 --- this is the link for your reference.

Please do help me with this issue.

Thanking you,

Yours sincerely, Avinash Shanmugam

-

Hi, 

This is an issue related to MRTK, we suspect that somethings gets corrupted on their side and its not working anymore. 

A workaround that you could try is as follows:

1. Close Unity

2. Delete the Library folder from the project