Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

How to use HoloLens compass

martymarty
edited December 2016 in Questions And Answers

Greetings Windows Holographic community,

I'm making an application and I want to include a compass, so you know where you are looking at (north, south, east, west etc), first to try, by just using the degrees and debug it, then linking the data to a compass image, which rotates. However, I can't seem to make the compass in the HoloLens work.

I'm trying to use this code, which works inside normal Unity apps with the HoloLens, but I'm getting respond (0.0, 0.0, 0.0, 1.0)

Input.location.Start();
Debug.Log(Quaternion.Euler(0, -Input.compass.trueHeading, 0));

So, this function cannot be used with the HoloLens? Does anybody know an other way to use the compass on the HoloLens?
Thanks in advance.

Kind regards,

Marty

Answers

  • Hi @marty,

    Your device's magnetometer is accessible. Most of the HoloLens sensors, other than the localized rgb camera, are not accessible. The Unity API Input.compass is for mobile devices and not the hololens.

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

Sign In or Register to comment.