Reset HoloLens Origin

Is there a way to reset the HoloLens camera origin. I’m finding that if I get too close to a wall, or look down, I get the lost tracking notification, then sometimes my height doesn’t match where I was. I’d like to be able to reset the Camera’s origins rather than having to set a world anchor.

Anyone know if there’s that ability? I’ve tried resetting the camera position, but that doesn’t seem to help me.

Maybe VR.InputTracking.Recenter(), this might help you. Are you seeing this happen in a low light situation? Is this happening in the Shell as well or just in the app?

It happens specifically when I put the HoloLens down on a table, and it loses tracking (for example, I put it upside down in the case to charge). The next time I pick it up to continue where I left off, the tracking resumes only once I’ve lifted it high enough to clear the case. Under normal circumstances, the HoloLens usually gains tracking once the user has it near head level, resulting in the user being very short in the Unity App.

I tried your solution, but it only moved the HoloLens camera back to 0,0,0, not resetting what 0,0,0 actually is.

Any other ideas?

What did work for me was reloading the scene. I would love to find a solution that fixes it without having to reload the scene though…

Interesting, this might be an issue with the world coordinate system. Does this happen to you in the shell as well? We might need a bug report with a min repro project for this as well, can you put the case number here so we can investigate?.

i’m not sure how to test in shell only - I’ll submit bug report and past case number in here

I’m at the point now where it’s necessary that I address this issue. I can’t be reloading the scene many times when the HoloLens loses tracking.

I noticed this issue as well as other team members, for me it appears to be the OS that is causing the issue. You can test this in the shell following the repro steps you mentioned. The shell is the main HoloLens menu were you can access all your apps, it has spatial mapping as well.

You can see the whole world tilt when tracking is regained even if you are not close to a wall. Can you give me the case number so I can investigate this further?

Case 909869

I’m bumping this as I’ve not gotten word back or updated bug status.

In doing more research, Recenter does not work for RoomScale, as outlined here:

I’ve got a partial fix by creating world anchors, that solves the loss of tracking, but what if I load elements at runtime, and notice that the start position is slightly off.

Other than tracking the rotation and position manually and sending an offset to all shared hologram members, I would really love a way to reset where I am standing to 0,0,0 without having to reload the scene.

Hello,

I have updated the bug to the dev team, from what we can see is the API hasn’t been hooked up for the HoloLens.

Any updates on this? I wanted to do something similar: setting the HoloLens origin to the position of a QR Tag.

I have some changes that landed recently (you should be able to expect them in 2017.2.0-p1 and 2017.3-b8), and part of those changes were hooking up InputTracking.Recenter properly on WindowsMR.

But if I understand your use case, that’s not how Recenter works. To my understanding, you want to specify the position of a particular object as the origin - Recenter doesn’t take any parameters, and just makes it so the device’s position when Recenter is called then becomes the origin. In other words, to set the QR tag position as the origin, you would have to call Recenter when the HoloLens is exactly at the position of the QR tag in question.

Can I ask why you need to set the position of a QR tag to the origin? It sounds like an odd way to solve the problem at hand, was wondering if I can help by pointing you in a different direction - or whether you can correct my understanding of your problem so that we can figure out a change or improvement to the API to help support your use case moving forward.

Currently I solve this by making all objects a child object of that QR code so multiple MR devices can share the same environment. This works but for some reason (at the time I had a good explanation why) I think that setting the hololens origin to a specific point in space can facilitate when I have multiple devices that are not only MR e.g. Rifts, tablets, tabletops + MR;

Maybe the better answer for your reply will come back to my mind soon :slight_smile:

Have tried using UnityEngine.VR.InputTracking.Recenter(); in a variety of methods to bring my Unity app back into user focus.

Main case to be handled here is when a user places a Windows App Tile to activate the Unity app and then performs the bloom gesture sending the app into a suspended state and/or removes the Hololens headset without first properly closing the application and takes the app out of the viewing frustum. this as well results in either a suspended or terminated state.

Then the app is opened again (without closing the prior instance), the application will resume from its suspended/tombstone state at the position of the first instance, not the new instance. This is not ideal or desired behavior. The app needs to always be in the users FOV otherwise they will get lost.

With that said, I tried using the Recenter method inside of OnApplicationFocus, OnApplicationPause, WorldManager_OnPositionalLocatorStateChanged, OnSuspending, OnResuming, OnLaunched.

It doesn’t do anything. If it is indeed merely updating the world positional system to place the Hololens at the center (0,0,0) and not updating the objects in the hierarchy I am not sure what purpose that serves. Nevertheless, it doesn’t appear to be working @unity_andrewc

See issue 1075676 - “[XR][WMR] HEADSET DOES NOT RECENTER WHEN USING XR.INPUTTRACKING.RECENTER”. Unfortunately it was resolved as “Won’t Fix” with the note “XR Management has evaluated this issue and determined that it does not meet our current bug severity threshold”. Considering that the Microsoft Unity documentation specifies it’s usage I hope Unity might reconsider this decision or at least work with Microsoft to find another solution.

I’ve verified recenter works on 18.4.8f1 which is our current LTS version, which editor are you working on? You may need to upgrade

I’m using 2019.1.5f1

Hey.

Not to invalidate your original request to go without world anchors. From the very beginning of HoloLens development I’ve just gotten used to the fact that there is no concept of universal coordinate system when developing for HoloLens. No origin, no zero. Simply none, from the app developer perspective. You have to rely on an anchor if you want something to be fixed in relation to the environment. Or you have to rely on your camera if you want something to be fixed in relation to yourself. Any other coordinate systems are fundamentally volatile. You can only derive from / combine the two, very creatively sometimes. That said you can always turn your initial camera position into an anchor temporary for this application launch and not persist it.

I know it’s not a direct answer to your question but this way of thinking helped me countless times to not rely on something that fundamentally can’t be relied on.

“You’re not supposed to need it”.

Cheers

I’m using the version of Unity 2018.4.17f1 but it seems that Recenter does not work on the y axis. I mean it recenters the hologram on the x and on the z axis but not on the y. Do you know if there is a way to recenter also on the y axis?