SensorApps / Sensors2OSC

Android app for sending sensor data via Open Sound Control (OSC).
http://sensors2.org/osc
Other
66 stars 18 forks source link

Sensor range and output unclear #15

Closed mxa closed 6 years ago

mxa commented 7 years ago

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.

residuum commented 7 years ago

Normalize to what range? 0 - 1? 0 - 127? -1 - 1?

mxa commented 7 years ago

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.

residuum commented 7 years ago

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°.

mxa commented 7 years ago

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

mxa commented 7 years ago

Feel free to adapt patches ReceiveSensors2OSC.pd and/or Sensors2OSC-help.pd from https://github.com/mxa/GemVR as more verbose helpfiles to Sensors2OSC

mxa commented 6 years ago

Video which illustrates the difficulty. Turning the phone horizontal will not work. https://vimeo.com/226958567

residuum commented 6 years ago

Working on it.

residuum commented 6 years ago

While I am at it, should inclination be included as well?

residuum commented 6 years ago

Should be working.