Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hololens falls asleep if moveless

In my app I need to measure a camera data if the glasses are moving or not. I get the data with:

quaternions["x"] = Camera.main.transform.rotation.x;
quaternions["y"] = Camera.main.transform.rotation.y;
quaternions["z"] = Camera.main.transform.rotation.z;
quaternions["w"] = Camera.main.transform.rotation.w;
quaternions["tx"] = Camera.main.transform.position.x;
quaternions["ty"] = Camera.main.transform.position.y;
quaternions["tz"] = Camera.main.transform.position.z;

If I move the glasses, the app works fine. But if I leave the glasses on the table, then after 4 minutes the glasses disable display and the code returns last stored data. Even if the charge cable is plugged in. If I press enable button on the glasses, the display is on again and the data is also right.

Is there some possibility to prevent the glasses falling asleep?

like image 591
Alexander Tumanin Avatar asked Apr 23 '19 13:04

Alexander Tumanin


People also ask

What is the difference between HoloLens 1 and 2?

The new HoloLens has a Qualcomm Snapdragon 850 Compute Platform while the original HoloLens has an Intel Atom x5-Z8100p @ 1.04Ghz. Upgrading to an AMR based system means more processing power for the user's work. The CPU upgrade is most apparent when looking at the logical cores.

Who manufactures HoloLens2?

Microsoft HoloLens 2 is a pair of mixed reality smartglasses developed and manufactured by Microsoft.

Do you need a PC for HoloLens 2?

HoloLens Emulator system requirements Windows 10 Home Edition does not support Hyper-V or the HoloLens Emulator. The HoloLens 2 Emulator requires the Windows 10 October 2018 update or later.

Where is HoloLens 2 manufactured?

HoloLens2 is developed and manufactured by joint forces; Microsoft and MicroVision Inc, both companies are based in the Unites States (US), so the country of origin would be the US.


1 Answers

According to comment of @Kay, the solution is adding the line:

Screen.sleepTimeout = SleepTimeout.NeverSleep;

NOTE: this solution works if you use MixedRealityToolkit-Unity because it needs:

using UnityEngine;
like image 170
Alexander Tumanin Avatar answered Sep 21 '22 17:09

Alexander Tumanin