microsoft / MixedReality-QRCode-Sample

A single repository of Mixed Reality samples in Unity.
MIT License
101 stars 29 forks source link

Possible to get pose of QR code with Holographic Remoting? #9

Closed felixvh closed 2 years ago

felixvh commented 2 years ago

Hey everyone,

this is a question, not a bug report. I was wondering if it is possible to obtain the pose of the QR code with Holographic Remoting? Unfortunately, I don't have a HoloLens currently - otherwise I would try myself.

Thanks!

felixvh commented 2 years ago

In case somebody has the same question: I could not make it work this sample. I tried to change the SpatialGraphCoordinateSystem.cs script by importing the feature Mixed Reality WinRT Projections using the Mixed Reality Feature Tool. After that I could import Microsoft.Windows.Perception.Spatial library such that the methods in the script are also available in the unity editor. However, when executing the script I got the following error with the method CoordinateSystem = Microsoft.Windows.Perception.Spatial.Preview.SpatialGraphInteropPreview.CreateCoordinateSystemForNode(id);

ArgumentException: Value does not fall within the expected range.

Long story short: I found another example in which they used OpenXR instead of the Windows XR Plugin. In this case it worked.

https://github.com/yl-msft/QRTracking

vimusc commented 2 years ago

Hi @felixvh,

in general, it is possible to use QR codes with Holographic Remoting. You can find the remoting QR sample here.

This Unity sample seems to be not quite up to date. After following your steps and addressing various Unity errors/warnings, I got it in a state, where the CreateCoordinateSystemForNode() call succeeded. Nevertheless, I would recommend using the never OpenXR API and the sample you linked before.

Do you need further help?

Best regards Vincent

felixvh commented 2 years ago

Hi @vimusc,

thanks for your reply! I continued my work with the OpenXR API so I don't need further help, thanks! I wasn't sure if I should leave the issue open as the actual problem wasn't solved. But I will close it now.

Thanks again and best regards Felix