petergu684 / HoloLens2-ResearchMode-Unity

Unity Plugin for using research mode functionality in HoloLens 2. Modified based on HoloLens2ForCV.
MIT License
203 stars 59 forks source link

How to make it works in unity and show in Hololens 2? #46

Open Hans86 opened 2 years ago

Hans86 commented 2 years ago

Thanks for author's project. When i try to follow the steps to put the .dll and .winmd into my unity project, it didn't show the depth camera view in hololens.

My hololens just show the view that i built before, but there is no any error msg, what's wrong with this situation, do i need to do anything to activate the .dll?

Mt-Perazim commented 2 years ago

what is your dll-path in your project? do you see the dll in the builded project in the solution explrorer of visual studio? did you enable developer mode and research mode on you hololens? did you set the capabilities the right way? starting the application the first time, do you get the typical notifications/questions about capabilities?

You are providing no information...

Hans86 commented 2 years ago

I built author's .sln to get the .dll and .winmd, then I put them into my unity project, and the path is Assets/Plugins/WSA/ARM64. image I'm sure that I turn on the mode because I have run the Microsoft sample project and it can be run. After I built my project, it looks success and there's no any error notification. image image Should I change any setting about these two files?Thanks for your help.

Mt-Perazim commented 2 years ago

Those settings are ok. What version of unity are you using? What XR Plugin-in Managment are you using? (Windows Mixed Reality or OpenXR)

Hans86 commented 2 years ago

The version I use is 2020.3.14f, I try to use the version that author provide has these problem. image

My XR Plugin-in Management is OpenXR and feature group is set to Microsoft Hololens like this. image

Mt-Perazim commented 2 years ago

You have to work with Windows Mixed Reality. Remove OpenXR.

As for the path error, I can't tell you exactly what your problem is. Maybe your path is too long? There was a issue in some unity versions with the length of a path.

Hans86 commented 2 years ago

I tried to use Windows Mixed Reality,but it still not work. image

After put two data in Plugins, should I do anything else?

Appreciate to your reply, I'll try to find wether the path is too long.

Mt-Perazim commented 2 years ago

if you followed the instruction for this plugin, there nothing else you have to do. It should work. Did you setup the manifest file the right way?

Hans86 commented 2 years ago

I think I followed the instruction, is it possible to have your successful project, I don't know what happen to my project.

petergu684 commented 1 year ago

I know it has been long but anyway. The built DLL and winmd files just give you an interface (basically functions that you can call) to access the research mode sensor data via C# script. Putting these two files directly in your own Unity project won't show you anything: you need to write your own C# script and configure materials and shaders in Unity if you want to visualize it. The UnitySample folder showed a sample Unity project on how to do that, though I guess you don't have to visualize the images in your own app if you are just interested in its computer vision applications. If you are only interested in streaming sensor data to laptop, the psi project is definitely easier to use.