akipro
akipro

Reputation: 188

HoloLens user position

Is there a way to get the position of the HoloLens user? I want to send the position of user back to PC and then update my hologram accordingly. Is there a way to do so? I haven't been able to find any API using which I can send back user's location to my computer.

We can use the initial position and orientation of user as origin and then calculate everything relative to it.

Upvotes: 4

Views: 4439

Answers (5)

Tania Chistyakova
Tania Chistyakova

Reputation: 3968

Hololens hasn't any API for getting altitude and longitude. All camera positions would be relative to initial.

You should choose the another way. Find any noticeable item at any wall (or floor, or sail). Attach Spatial Anchor to the item. And calculate positions to the anchor. Then share the anchor to all Hololenses in the room.

Upvotes: 0

GreedyAi
GreedyAi

Reputation: 2839

I recommend you to check sharingwithUNET in holotoolkit-unity or now Mixedrealitytoolkit-Unity. If you run app in the unity and also run the same app in the hololens you can see the location of the both app users. One you can control in unity and another is the location of the hololens user. When you move with your hololens you can see it updates the location in the app on computer in unity. I'm not sure if this is exactly what you need but I'm sure it will help you out if you check how it works.

Good luck!

Upvotes: 0

YPR
YPR

Reputation: 33

The HoloLens create start position, it's 0,0,0. He can't give you a longitude/latitude value because he don't have a compass !

Upvotes: 0

Gentatsu
Gentatsu

Reputation: 717

Camera.main.transform is the position of the head.

Upvotes: 4

Cameron Vetter
Cameron Vetter

Reputation: 747

The best way to do this would be to use the HoloToolkit-Unity. You end up adding a prefab called "HoloLensCamera" to every HoloLens project. The starting position and rotation for the root GameObject of HoloLensCamera are always 0,0,0. As you move around, the values of position and rotation are updated relative to your movement.

Upvotes: 2

Related Questions