adafruit / Bluefruit_LE_Connect_Android

Android port of Adafruit's Bluefruit LE Connect app
MIT License
122 stars 100 forks source link

Quat issues with Controller Data #17

Closed microbuilder closed 9 years ago

microbuilder commented 9 years ago

The Quaternion output on Android doesn't work when enabled with other sensors. Enabling Quat + Accel only sends accel, whereas Accel+Mag+Gyro (etc.) seems to work fine.

Is the issue that quats are missing here?

Also ... there should be a fourth float in the QUAT output for 'w' or rotation. If this isn't available on Android, four 00 bytes should be inserted instead.

antonio-openroad commented 9 years ago

I cannot reproduce the quat data not being sent. Added w to the data sent

microbuilder commented 9 years ago

It seems to have been because of the missing last float and on the other side ... safe to close this on altitude is added!

microbuilder commented 9 years ago

'w' still seems to be 00 00 00 00? https://github.com/adafruit/Bluefruit_LE_Connect_Android/blob/master/app/src/main/java/com/adafruit/bluefruit/le/connect/app/ControllerActivity.java#L425

microbuilder commented 9 years ago

Ah sorry ... I think it's my phone (Nexus 4). Probably doesn't have a barometric pressure sensor since it says 0.0 in the app as well.

antonio-openroad commented 9 years ago

Quaternion value on Android is obtained combining data from Accelerometer+Magnetometer. I get non-zero values on a phone. I guess that for devices without Magnetometer the precision could be far worse.

On 23 Feb 2015, at 22:30, Kevin Townsend notifications@github.com wrote:

ba

microbuilder commented 9 years ago

That's normal ... quats are a purely mathematical construct based on the accel, mag and usually the gyro (the don't use that?!?). The last value, altitude, comes from an entirely different class of sensors, usually barometric pressure sensors. Not every phone has one since they're $2-5 and not strictly necessary in every situation. They measure barometric pressure (essentially the weight of the air above you) and calculate altitude based on that measurement. The Nexus 4 probably just doesn't have a barometric pressure sensor.