wonjsohn / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

SensorManager issue with new update XE20.1 #601

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Read sensor data (ex: Sensor.TYPE_ROTATION_VECTOR)
2. Values from sensor will be random and not accurate (very strange)
3. Capture an image with the camera button
4. Dismiss the camera app, back to your app
5. Sensor is fixed

What is the expected output? What do you see instead?
Expected to see normal output, instead, the sensor values are random before I 
open the camera app (which is very weird), after going back to the app, the 
problem is resolved. Tried rebooting, uninstalling, etc..

Seems that the camera app invokes something I need to invoke in my app?

What version of the product are you using? On what operating system?
Using Google Glass XE20.1, it did not happen before that update.

Original issue reported on code.google.com by Xand...@gmail.com on 1 Sep 2014 at 3:37

GoogleCodeExporter commented 8 years ago
Hello,

Thanks for the report! Could you share a small sample app and its source code 
that demonstrate the issue (logcat is enough) so that we can easily reproduce?
It will make it easier for us to track down the issue and make sure we've fixed 
it.

Best,
Alain

Original comment by ala...@google.com on 2 Sep 2014 at 3:05

GoogleCodeExporter commented 8 years ago
Problem is still here in XE22.
It's going "erratic" mode when the device is rebooted, and sensor data are 
usable again after launching Star Chart:
https://glass.google.com/glassware/2547334194832879372

Sensor.TYPE_ROTATION_VECTOR is pretty important for this platform, any 
application that would like to use head-based navigation is pretty much screwed 
until it's fixed, so I'd suggest increasing priority for this issue.

Until then people would have to do ugly wokrarounds like reverse-engineering 
Star Chart to see what they do to make the sensor usable, and apply that part 
in their own Glassware...

Original comment by Michal.S...@gmail.com on 5 Nov 2014 at 11:32

GoogleCodeExporter commented 8 years ago
Problem is gone after you use Sensor.TYPE_MAGNETIC_FIELD:

mSensorManager.registerListener(this, 
mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD), 
SensorManager.SENSOR_DELAY_UI);

Values coming from Sensor.TYPE_ROTATION_VECTOR are OK after that. Filtered with 
"event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR" in onSensorChanged().

It's enough to do it just once per reboot - it fixes data from 
Sensor.TYPE_ROTATION_VECTOR for applications, even those who didn't touch 
Sensor.TYPE_MAGNETIC_FIELD at all.

Original comment by Michal.S...@gmail.com on 25 Nov 2014 at 11:11