Missing w of Quaterion in Sensor Fusion
I'd like to rotate and move a cube in WebGL according to the motion of a MetaMotionC (1.3.7). I'm using NodeJS SDK on Linux. I stream the data to a chrome using client/server socket.io
I'm mixing this Android tutorial with it's magic formula with the Python code of @schuster in his SensorFusion question:
https://mbientlab.com/community/discussion/2594/sensor-fusion-question
Here is my NodeJS code:
https://gist.github.com/JpEncausse/23066976905cf15a5f7cfc5cabdc8a56
1) As you can see, the pt.w is undefined, I don't understand why ? Where am I wrong ?
2) The quaternion should provide the angle of the cube but how should I move it in 3D space ? Should I use the Linear Acceleration ? Any sample code ?
3) According to the documentation there is a calibration is it a mandatory ?
Many Thanks !
Jean-Philippe
Comments
Enum names are wrong for getting data signals and setting acc/gyro range. You need to use the enum types defined in the bindings file not the C++ names, just like the sample python code.
https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/0.16.0/bindings/javascript/cbindings.js#L16
https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/0.16.0/bindings/javascript/cbindings.js#L27
https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/0.16.0/bindings/javascript/cbindings.js#L186
https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/0.16.0/bindings/javascript/cbindings.js#L246
Quaternions only tell you orientation. Yes, you will need linear acceleration to map linear motion. No, we do not provide any sample code.
Calibration isn't mandatory but you should do it.
Thanks Eric !!!
It works with quaternion :-)
https://t.co/HTsOZAwi7W
Got issues with linear acceleration but i'll find out
https://t.co/YzDPqluCWI
For those intereseted I put my code here
https://t.co/fMFLlhhN5Q
I also find an old conversion of Eric about linear acceleration with links to Stack Overflow, seems not so easy. I think my issue is also related to the calibration that I'll have to do