LocalJoost / BlogComments

This repo is solely used for comments on https://localjoost.github.io/
4 stars 0 forks source link

Comments on "Correct setup of OpenXR in a HoloLens 2 project including Holographic Remoting" #389

Open LocalJoost opened 3 years ago

LocalJoost commented 3 years ago

Original article: https://localjoost.github.io/Correct-setup-of-OpenXR-in-a-HoloLens-2-project-including-Holographic-Remoting/

medinags commented 3 years ago

Hand tracking and interactions not working First of all thank you for your posts guiding us on the Augmented Reality road.

I am a AR young developer in HoloLens, in fact I come from using unity 2019 and MRTK 2.5 and as you know using legacy. I cloned your repository, in the editor, everything works fine. When I compile and deploy in H2 everything Okay. But, and here comes the problem. I have no hand tracking, and I certainly can't interact with anything. I have followed the official microsoft documentation, but I am still stuck and get the same issue.

I'm using Unity 2020.3.19f1 LTS Version

XR Plugin Manager image Open XR. image MRTK Camera providers image MRTK Inputs Providers image My Packages image

I don't understand, it all looks right to me. I just hope, that you can help me. Thank you very much.

LocalJoost commented 3 years ago

Well it looks good to me too. Can you please open the generated solution in Visual Studio, open the package.appxmanifest and see what's here? image Also if you download my sample application showing hand interaction using the OpenXR plugin, does that work for you?

https://github.com/LocalJoost/HandCollider/tree/blog1

medinags commented 3 years ago

Actually that is your project, I have even downloaded the unity version which you used in your project. Unity 2020.3.6f1

image

Is enable. Gaze Input. Internet (client) Microphone Spatial Perception WebCam

In this video you can see how to run your project on my H2 device.

https://youtu.be/YnYQnGsezFU

As you can see, I don't have hand tracking, but eye tracking seems to work.

LocalJoost commented 3 years ago

I see. It does not work this way. That particular sample show a different mode of interaction. You should be able to push the cube, like I show in this article. The air tap won't work at all. See this video

medinags commented 3 years ago

It's true, the air tap doesn't work at all.

In the unity editor everything works fine

I have tried with different versions of MRTK. Different tutorials and documentations and still no, I'm still stuck. I have no idea what I am doing wrong. Or if it's a unity bug. Do you have a video or a post on how to install MRTK 2.7 in Unity using OpenXR for the HoloLens?

LocalJoost commented 3 years ago

I am sorry, by now it's not clear to me what you are trying to achieve

medinags commented 3 years ago

I am sorry if I did not make myself clear. I want to use the physical hand system. But I don't know why at the moment of running on the device it doesn't work at all. I don't know what I'm doing wrong.

I thought it is the MRTK or OpenXR version. But no, whenever I run an application on the HoloLens that built on Unity 2020 using MRTK and OpenXR, I don't get the hand tracking.

Even the repository of your project. I have tried it by remoting mode and in that case I get the hand tracking and I can interact with the cube.

LocalJoost commented 3 years ago

So to recap:

Correct?

medinags commented 3 years ago

Correct, Afeter build, deploy and run, I have no interaction. The hand tracking does not work at all. Neither does the air tap.

LocalJoost commented 3 years ago

So I cloned my repo from scratch, built and deployed it...

https://user-images.githubusercontent.com/4129183/135837932-83ccc933-456e-48ec-868a-048783136a55.mp4

LocalJoost commented 3 years ago

These are my settings in Visual Studio that I use to build an deploy: image image

medinags commented 3 years ago

Same issue. No hand tracking Unity Build image Unity Console image VS image image image

medinags commented 3 years ago

Final result. This happens when I launch the application.

https://youtu.be/7SWRyM5RadY

As you can see, I have no hand tracking at all. Something strange is that it seems as if it is launched twice.

LocalJoost commented 3 years ago

Okay. My last attempt. Uninstall the app as it is now from the HoloLens. Download the package I created here and install it using the device portal. Start making a movie before you start it the very first time. I would like to see what happens and how you launch it the first time.

medinags commented 3 years ago

Et voilà !

When I was in the device portal. I noticed that there was a field OpenXR. Which requested an update. And as I thought about it. I updated everything.

image

And then I deployed and ran my solution. And everything works perfectly.

So the solution was the Open XR update on divice portal. Again thank you very much for your time. And above all for accompanying people who are just starting on this exciting journey.

LocalJoost commented 3 years ago

LOL well glad that - in a very roundabout way I more or less helped you stumble toward the solution. Happy developing!

JCMazza commented 7 months ago

Hi @LocalJoost,

Aplogies I asked some question related to this post in the wrong place which ended up confusing you and I was also not very clear.

Basically the manual settings we set in the XR plugin manager for hololens on UWP an standalone I want to be able to do that via an editor script in code. I am able to set via the openxr api the different interaction profiles and even the meta features for android but I can not figure out how to set the "Microsoft Hololens" feature option.

Example for android I do something like this

switch (_targetDeviceOptions[_targetDeviceIndex]) {

            case "OculusQuest":
                XRPackageMetadataStore.AssignLoader(androidSettings.Manager, OPENXR_LOADER, BuildTargetGroup.Android);
                XRPackageMetadataStore.AssignLoader(standaloneSettings.Manager, OPENXR_LOADER, BuildTargetGroup.Standalone);
                SetOpenXRSettingsForMetaQuest(true);
                SwitchToAndroid();
                break;
        }

private void SetOpenXRSettingsForMetaQuest(bool enable) { var metaQuestSupportFeatureAndroid = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android).GetFeature(typeof(MetaQuestFeature)); metaQuestSupportFeatureAndroid.enabled = enable;

        var metaQuestInteractionProfileAndroid = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android).GetFeature(typeof(OculusTouchControllerProfile));
        metaQuestInteractionProfileAndroid.enabled = enable;

        var metaQuestInteractionProfileStandalone = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Standalone).GetFeature(typeof(OculusTouchControllerProfile));
        metaQuestInteractionProfileStandalone.enabled = enable;
    }

As you can see OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android).GetFeature(typeof(MetaQuestFeature)); would tick the Meta quest feature under OpenXR -> Android but I can not find any "typeof" that exist for the hololens (standalone and WSA)

LocalJoost commented 7 months ago

Ah, I see. TBH, I have no idea. I usually go for a very low tech solution. I do the Unity project settings so it builds for HoloLens. Then I commit the whole shebang to Git. Then I make the app build for Quest, and see what files are changed. I copy the changed files to a separate folder and commit them to Git, in that separate folder. A simple pull makes it compilable for HoloLens, if pull and then copy over the files from the Quest folder, it builds for Quest.