Setting up Hololens MRTK 2.0 with Vuforia in Unity 2019.1 - unity3d

I'm developing a Unity app for the Hololens 1 that uses Vuforia. Unfortunately, I cannot get the camera to work with Vuforia, it remains frozen in place and does not follow head movement. When I disable Vuforia, the camera tracks fine.
My setup is as follows:
* Windows 10
* Unity 2019.1.4f1
* MRTK v2.0.0 RC2
* Vuforia 8.1.11
I tried following the steps outlined here:
https://github.com/Microsoft/MixedRealityToolkit-Unity/issues/1461#issuecomment-373714387
To no avail. I also tried having both cameras active, same result. The Vuforia Hololens sample that can be found in the Unity asset store is severely outdated (using the old Holotoolkit, not MRTK), so it is not very useful to me. I noticed that older versions of Vuforia allow the script on the camera to be set to "world center": "camera", but this option is now forced to "device" when Vuforia is configured for the hololens.
Can anyone tell me how to properly configure my scene for MRTK 2 and Vuforia? I'd be eternally grateful for a link to an up to date example project.
EDIT:
This seems to be an issue only when using Unity's holographic remote. I would still very much like to resolve that though, since deploying is very time-consuming and makes debugging almost impossible.

This worked for me:
Import MRTK package and add it to the scene. This will create a MainCamera under MixedRealityPlayspace Game Object.
Then GameObject > VuforiaEngine > ARCamera. This will create an ARCamera with two components: Vuforia Behavior and Default Initialization Error Handler. Copy these two components and add them to the MainCamera created when you added MRTK.
Finally delete ARCamera.
I use Windows 10, Unity 2018.4, MRTKv2.0 and Vuforia 8.
Good luck.

Related

MRTK hand tracking does not work properly with Oculus Link

I am creating a VR game in Unity.
I am having a problem with hand tracking not working properly with PCVR (.exe build) only.
The detailed situation is as follows
I have developed a game using Unity, MRTK, and Oculus Integration, running on Oculus Quest2.
When playing the game via Oculus Link with a PCVR(.exe) build, the following situation occurs.
Hand tracking works correctly in the scene immediately after startup.
When hand tracking is performed after the scene transition, the hand mesh probably appears at (0, 0, 0) and does not move.
The Dynamic Bone Collider attached to the hand is working, so it does not seem that the hand coordinates are not tracked completely.
The controller works fine both after startup and after transition.
Hand tracking works fine in the APK build and in the mode where I press the Play button in Unity.
The version is as follows
Oculus Desktop App: 38.0
Oculus Quest2: 38.0
Unity: 2021.2.7f1
Oculus Integration: 38.0
MRTK: 2.7.3
I don't know if this is the right way to do it, but hand tracking now works.
Removed the following #if UNITY_EDITOR and #endif in OVRSkeleton.cs > Update.
#if UNITY_EDITOR
if (ShouldInitialize())
{
Initialize();
}
#endif
Do you mean by commenting out that code snippet it is possible to use hand tracking on a PC build using OVRCameraRig and Oculus Integration?

Hololens2 + Vuforia ImageTarget. Tracked Image has a position offset

I'm having an issue with a project built in Unity for Hololens 2, using
MRTK 2.7.0
OpenXR 1.0.0
Vuforia 9.8.8
Unity 2020.3.10f
The MRTK is installed using the MRTK feature tool. I installed foundations, extensions, toolkit tools and standard assets.
The Vuforia ImageTargets get a random offset from their supposed position.
I have the scene, hand tracking and the general setup for the Hololens running as intended using the MRTK. I also want to utilize the image tracking capabilities of Vuforia, but thats where my issue comes in. When starting the app on the Hololens 2 device, the ImageTargets are getting detected, but their position has a random offset, after each restart of the app. I suspect that the World coordinate system is slightly off. In the Vuforia behaviour, the World Center mode is already predefined to DEVICE and cannot be changed.
When testing in the Editor with a Webcam, everything is working as expected.
The scene is setup similar to the tutorial found at https://arvrjourney.com/hololens-2-marker-tracking-with-vuforia-engine-and-mrtk-fb582c8f8ac0
My scene hirarchy looks as follows, which is similar to the scene setup found in the Vuforia Hololens 2 samples
One of the Targets has no child, but it is actually toggling another scene gameobject, after detection and then switching over to extended tracking to use the more stable tracking of the Hololens. The SceneGameobject is following the Imagemarkers position. To verify the behaviour, there is also a second marker, with a default setup and a cube as a child. Both show the same behaviour and same offset.
I also tried to change the Image Targets' place in the hirarchy, like putting it as a child of the Playspace, or the Maincamera, to no avail.
TLDR: Vufora Image Targets do not work when using OpenXR on the Hololens 2
EDIT: I changed from OpenXR back to Windows Mixed Reality, which seems to have eliminated the issue, but I'm really puzzled about it nonetheless, especially, when OpenXR is supposed to replace Windows Mixed Reality in the future o.O
This was a problem that was caused by Vuforia not fully supporting OpenXR. As of version 10.4.4, they have fixed the problem.
If you were like me and came to this question because you were implementing your own image tracking service and suddenly there was an offset caused by updating to Unity 2020 and/or OpenXR, it's likely you are encountering the same problem Vuforia had to fix. I fixed it by changing how I am obtaining the world origin:
The proper way to obtain the world origin in OpenXR is using:
using Microsoft.MixedReality.OpenXR;
var worldOrigin = PerceptionInterop.GetSceneCoordinateSystem(Pose.identity) as SpatialCoordinateSystem;

Audio Source in Vuforia Area target scene in unity

I am having trouble playing an audio source in a unity scene using a vuforia area target. I am just learning Unity and Vuforia with not much experience. I wrote a basic unity script without using the calls for Vuforia. I am assuming I need the "DefaultTrackableEventHandler.cs" included. Vuforia documentation is not to descriptive and I am looking for some guidance if available.

How to Access the stream of HoloLens 2 camera when trying to recognize the marker in AR app?

I am beginner in unity and not so much used to HoloLens 2. Actually I am trying to make a simple AR app for HoloLens 2, when I connect the external camera it is working fine but when I want to access the stream of HoloLens 2 in recognizing the marker, it does not recognize the marker and I do not know that either the HoloLens 2 camera stream is working or not. I used the main camera as the child of MixedRealityPlaySpace and add some components from AR camera but it does not work then I tried AR camera separate and as a child of MixedRealityPlaySpace but still the HoloLens camera stream is not working. It will be great help if anyone knows about the problems. Thanks In advance
Which way are you using for marker recognizing development? Vuforia or Unity AR foundation? Without any specific context the above information does not make any sense to me.
For AR Foundation, 2D Image tracking feature is not supported on HoloLens platforms for now, you can refer to this link to learn more about feature support per platform:Platform Support.
For Vuforia, there is a closed issue that show how to make Vuforia work with the MRTK: What's the current status of using Vuforia with the MR Toolkit? #1461

Using HDRP Rendering Pipeline

I just tried to create a Smoke and Fire particle system in Unity version 2019.1.14f1. I installed ShaderGraph and followed a Tutorial by Brackeys. I couldn't go far because I didn't have HDRP on the project. It was simply a 3D project. I used this website to figure out how to change to HDRP. I did so, but it won't render the project. It says "Platform WebGL with device Open GLES3 is not supported, no rendering will occur". I then tried to switch back to the normal rendering system. Now it won't let me share my WebGl game. I don't know for sure that these two problem are connected, but seems like it. I don't know if that is a problem with my computer, but I have added the specs below. How do I switch my current rendering system to HDRP, so I can create a nice Fire/Smoke Particle System?
WebGL is based on OpenGL ES and unfortunately, HDRP doesnt support OpenGL ES devices so there is no way to run it on WebGL.
However, URP (Universal Render Pipeline) would be much better way for WebGL.
And yes, URP supports Shader Graph.
Here is URP page: https://unity.com/srp/universal-render-pipeline