jsyang / gearvr-controller-webbluetooth

Gear VR controller web bluetooth demo
GNU General Public License v3.0
114 stars 39 forks source link

Magnetometer and #1

Open gb2111 opened 6 years ago

gb2111 commented 6 years ago

Hello, Great work! I am author of first attempt and it is very interesting how you approached this problem. I was sure that these three values are ready to use orientation but I was not able to figure out how to decode them. They change very consistently as you rotate GearVR around and also make other rotations.

Perhaps you can take a look and we can get consistent rotation from that ?

Komak57 commented 4 years ago

Finally managed to dig into this from a C# direction. I've found a lot of bad data in the example.

His Magnometer calculations make NO GD SENSE! He reads byte 32, 33 for X, multiplies by 0.06, and converts it to a float. byte[32] is Timestamp data. byte[48] is Magnometer data

I've attempted reading this as a Quaternion as 2 double packed numbers like touch, as Vector3 int16's, and also as a Vector3 int16*0.06f. So far, none of these values are valid for all 3 axis of Magnometer data.