PTCInc / vuforia-engine

Bug and feedback issue tracker for the Vuforia Engine SDK
https://developer.vuforia.com
20 stars 0 forks source link

Tracking offset on HoloLens 2 for runtime generated image targets #157

Closed daniel1v closed 2 months ago

daniel1v commented 2 months ago

Summarize the bug:

After upgrading from 10.22.5 to 10.25.4 runtime generated image targets are tracked with rotational and positional offset on HoloLens 2.

Observed problem

I have an app which does not include any image targets in the scene, at startup. Image targets are loaded at runtime, within the OnVuforiaInitialized callback from a device database, similarly to the code examples in the vuforia documentation. The app used to work for several years and several vuforia versions.

Recently I upgraded Vuforia from 10.22.5 to 10.25.4. After the upgrade, everything worked fine in Unity Editor Play Mode, when using the Webcam. Running the app on the device (HoloLens 2) the image target tracking suffers from a large rotational and positional offset. The offset seems to depend on where the app was started.

For Image targets that are present in the scene at app startup, everything works fine. The issue only occurs, when there is no image target in the scene at startup and the target is loaded from device database at runtime.

Downgrading to 10.22.5 solved the issue for the moment.

Expected result The tracking should work like before the upgrade to 10.25.4.

Reproducible steps

Affected Vuforia Engine version: 10.25.4

Affected platform:

Affected device:

Screenshots / Video Recordings

-

Affected database vuforia mars image database

Device or platform logs

-

Workaround

Downgrade to 10.22.5

ptc-epassaro commented 2 months ago

Hi @daniel1v, thank you for the detailed report. Just for completeness, which version of MRTK did you set up your project with? Are you using OpenXR or Windows Mixed Reality? Also, one last thing: do you see the same issue if you create an ImageTarget at runtime in the Digital Eyewear sample?

daniel1v commented 2 months ago

Hello @ptc-epassaro, thank you for the fast response. I am using MRTK3 (latest, non pre packages) with OpenXR.

I did not try that explicitely with the digital eyewear sample. I tried it with my app and with a minimal example, as described above. Both apps work with 10.22.5 and do not work with 10.25.4.

Would it bring additional value, if I also try it with the Eyewear Sample?

ptc-epassaro commented 2 months ago

Thank you for the additional information. If you haven't tried with the sample, then there's no need to do it now. I will look into this and will update this thread.

Thanks again for reporting this!

ptc-epassaro commented 2 months ago

Hi @daniel1v, I'm not able to reproduce the issue. I tried by creating the target during OnVuforiaStarted, then I added a button to the scene to create the target on demand. In both cases the augmentations were displayed exactly on the target.

Could you please share the script you're using to create the ImageTarget and the augmentation?

Also, can you tell us which OS Build of Windows do you have installed on your device and which Target SDK Version + Visual Studio version you are building the project with?

daniel1v commented 2 months ago

@ptc-epassaro thank you for your quick response.

A short update from my side: I followed your hint and used the Digital Eyewear sample. I copied my scenes and assets into the Digital Eyewear sample and got it to work with 10.25.4. I do not know, what is causingt the issue inside my project, but it seems to be a setting at project level or a package. I definitely have to take a deeper look at this. I am closing the issue, as it doesn't seem to be a Vuforia issue, although it came up after upgrading the package.

Do you have any suggestions for me, how to find out, what is causing the issue?

Also: It seems that the tracking is less stable when making fast movements. Could this be related to the changes that were made under the hood?

ptc-epassaro commented 2 months ago

Hi @daniel1v, glad to know that you have a way to make it work. I would look into the XR and Project Settings to try and find differences between the two projects.

One thing that could happen when you update an existing project is that Unity might not completely recompile or reload all the assemblies. One safe way to force this is to use the Reimport All option in the Assets menu. Deleting the Library folder is much more destructive, but Unity will perform essentially the same operation when you reopen your project.

The less stable tracking is something that could have many different reasons. Lighting conditions and the scale of the targets are always the first things that come to mind, but in this case it's difficult to tell. I suggest you have a look at our Troubleshooting guide and see if you find something in there that can improve the tracking stability.

Hope it helps!