Nordic-Thingy52-Thingyjs icon indicating copy to clipboard operation
Nordic-Thingy52-Thingyjs copied to clipboard

Having difficulty using a single axis from the quaternion orientation sensor

Open nigelkp9 opened this issue 5 years ago • 2 comments

After converting the quaternion to a euler vector using ThreeJS, I am left with a vector that has unusual axis. For example, when the Thingy:52 is being spun in a full circle, the y value will not run from 0 - 360 as expected, instead it will go from 0 to 90, back to 0, then to -90 and back to 0. The other axis act equally odd. So the resulting vector is useful all together, but if I just want to use a single axis, the data is useless. I believe this is something to do with how the quaternion calculated, but I can't find any solution as of now online

nigelkp9 avatar Dec 09 '19 13:12 nigelkp9

Can you try reading the euler vector directly instead of converting from quaternions? https://github.com/NordicPlayground/Nordic-Thingy52-Thingyjs#euler-orientation

ketile avatar Dec 10 '19 13:12 ketile

I'm not completely sure about that Euler data yet, I can't seem to find how it is supposed to be ordered. Right now I have it as pitch yaw roll for xyz based on another Thingy:52 demo I've seen, but that doesn't seem to be correct since when it is applied to an object it jumps around a lot. Do you know that the correct order is meant to be?

nigelkp9 avatar Dec 10 '19 14:12 nigelkp9