Closed mxa closed 6 years ago
Normalize to what range? 0 - 1? 0 - 127? -1 - 1?
That's a good question. I'm not 100% it should be normalized, maybe I just can't see the logic behind the current mix of ranges. If it's normalized, I think that 0.0 - 1.0 would make most sense, that would follow the standard in Gem. 0 - 360 would be possible too for rotation. On stackowerflow I'm reading that the current numbers are Radians, so that is probably okay as well, there should just be documentation somewhere so that this is more clear. I'm happy to help there.
IMHO it is a problem with understanding the different values for rotation:
Rotation around one axis has a range of 0 - 360° (X) Rotation around the second axis has a range of -180 - 180° (Y) Rotation around the third axis has a range of -90 - 90° (Z)
Normalization of these values does not make sense, because these are derived from the mathematical properties.
Compare that to latitude / longitude on earth: longitude ranges from -180° to 180°, latitude only from -90° to 90°.
I think i'm looking for SensorManager.getRotationMatrix
as in https://stackoverflow.com/questions/15315129/convert-magnetic-field-x-y-z-values-from-device-into-global-reference-frame#15317814
Feel free to adapt patches ReceiveSensors2OSC.pd and/or Sensors2OSC-help.pd from https://github.com/mxa/GemVR as more verbose helpfiles to Sensors2OSC
Video which illustrates the difficulty. Turning the phone horizontal will not work. https://vimeo.com/226958567
Working on it.
While I am at it, should inclination be included as well?
Should be working.
I'm trying to make sense of the sensor values and their specific uses. https://developer.android.com/reference/android/hardware/Sensor.html has some information and explanations.
It's confusing that the ranges of the sensors are not normalized.