-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Hi,
If I understand correctly:
- The BNO055's linear acceleration output is in terms of the sensor's local frame XYZ axes, and the purpose of the readAbsAcc() function in BNO055.cpp is to rotate that linear acceleration vector into the absolute/global frame's XYZ axes.
- The quaternion output from the BNO055 represents the rotation that must be applied to a fixed initial vector (0,0,0) in the global frame in order to obtain the sensor's current orientation.
- When we "apply" a quaternion (q) rotation to a vector (v) by doing qv(q^-1) where (q^-1) is the conjugate of q, we rotate v by the rotation encoded in q.
- a rotation specified by quaternion q is the opposite of the rotation specified by conjugate (q^-1). I.e. if v2 = qv(q^-1), then (q^-1)v2q would be equal to v.
If the above are correct, then I think the readAbsAcc() function rotates the linear acceleration vector not back into the global frame but instead doubles the offset from the global frame.
If I am reading the function correctly, it multiplies qr(q^-1) where r is the linear acceleration vector. However, since q is the rotation from the initial (0,0,0) vector in the global frame to the current orientation, not the rotation needed to get to the initial vector in the global frame from the current orientation, I think the readAbsAcc() function instead needs to multiply (q^-1)rq.
I'm not 100% sure of this; please let me know if there is an error in my reasoning.
Thanks!
P.S. Thank you for posting your code! It's helped me a lot in understanding how to use the BNO055.