{"action":"created","issue":{"url":"https://api.github.com/repos/YCAMInterlab/MOTIONER/issues/9","labels_url":"https://api.github.com/repos/YCAMInterlab/MOTIONER/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/YCAMInterlab/MOTIONER/issues/9/comments","events_url":"https://api.github.com/repos/YCAMInterlab/MOTIONER/issues/9/events","html_url":"https://github.com/YCAMInterlab/MOTIONER/issues/9","id":116204002,"number":9,"title":"Bug in the calcQuaternion algorithm","user":{"login":"jtragtenberg","id":5085536,"avatar_url":"https://avatars.githubusercontent.com/u/5085536?v=3","gravatar_id":"","url":"https://api.github.com/users/jtragtenberg","html_url":"https://github.com/jtragtenberg","followers_url":"https://api.github.com/users/jtragtenberg/followers","following_url":"https://api.github.com/users/jtragtenberg/following{/other_user}","gists_url":"https://api.github.com/users/jtragtenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jtragtenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtragtenberg/subscriptions","organizations_url":"https://api.github.com/users/jtragtenberg/orgs","repos_url":"https://api.github.com/users/jtragtenberg/repos","events_url":"https://api.github.com/users/jtragtenberg/events{/privacy}","received_events_url":"https://api.github.com/users/jtragtenberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-10T21:17:42Z","updated_at":"2015-11-19T18:51:57Z","closed_at":null,"body":"Hi there,\r\nI've been all this time learning C++ and figuring out how the Motioner and RazorIMU libraries work.\r\nI make my own prototyping board with just an arduino UNO soldered with a HMC8553L magnetometer and MPU6050 gyro+accel. I'm doing all my tests connecting the board through USB.\r\nI made a code out of the Motioner.ino where in the loop() I just added the lines:\r\n\r\n  float qx = motioner.mRazorIMU.getQuatX();\r\n  float qy = motioner.mRazorIMU.getQuatY();\r\n  float qz = motioner.mRazorIMU.getQuatZ();\r\n  float qw = motioner.mRazorIMU.getQuatW();  \r\n \r\n  Serial.print(qw);\r\n  Serial.print('|');\r\n  Serial.print(qx);\r\n  Serial.print('|');\r\n  Serial.print(qy);\r\n  Serial.print('|');  \r\n  Serial.println(qz);\r\n\r\n\r\nwhere the getQuat* functions I added are just:\r\n\r\n    float getQuatX() const { return quat.x; }\r\n    float getQuatY() const { return quat.y; }\r\n    float getQuatZ() const { return quat.z; }\r\n    float getQuatW() const { return quat.w; }\r\n\r\nand I made the mRazorIMU object public on the Motioner class.\r\n\r\nOut of this I noticed a bug in the angles as I tilt them, where the quaternions change sign for no reason...\r\nI have calibrated my board with the IMUDebug.ino firmware and it all worked well in the IMUvisualization Processing sketch.\r\n\r\nhere is what the serial monitor shows:\r\nhttps://youtu.be/AYBm-mMuhkI\r\n\r\nDoes anyone know why this bug keeps bugging me?\r\nIs this discontinuity and sign inversion expected?\r\n\r\nthank you"},"comment":{"url":"https://api.github.com/repos/YCAMInterlab/MOTIONER/issues/comments/158154036","html_url":"https://github.com/YCAMInterlab/MOTIONER/issues/9#issuecomment-158154036","issue_url":"https://api.github.com/repos/YCAMInterlab/MOTIONER/issues/9","id":158154036,"user":{"login":"jtragtenberg","id":5085536,"avatar_url":"https://avatars.githubusercontent.com/u/5085536?v=3","gravatar_id":"","url":"https://api.github.com/users/jtragtenberg","html_url":"https://github.com/jtragtenberg","followers_url":"https://api.github.com/users/jtragtenberg/followers","following_url":"https://api.github.com/users/jtragtenberg/following{/other_user}","gists_url":"https://api.github.com/users/jtragtenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jtragtenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtragtenberg/subscriptions","organizations_url":"https://api.github.com/users/jtragtenberg/orgs","repos_url":"https://api.github.com/users/jtragtenberg/repos","events_url":"https://api.github.com/users/jtragtenberg/events{/privacy}","received_events_url":"https://api.github.com/users/jtragtenberg/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T18:51:57Z","updated_at":"2015-11-19T18:51:57Z","body":"Has anyone an example of a Motioner IMU working just outputting the quaternion values ?\r\nIt really seems to me that the bug is in the calcQuaternion algorithm, the Gamasutra code that transforms the Matrix into quats...."}}