madgwick_py icon indicating copy to clipboard operation
madgwick_py copied to clipboard

Acc/Gyro/Mag axis reference - which is which?

Open mungewell opened this issue 5 years ago • 0 comments

I've been trying to implement the AHRS with the sensors from the PlayStationVR headset, and getting confused about which axis should be which.

From reading the sensor values, as arrays, I have:

Structure of the PSVR sensor: Gyros (when wearing headset normally). 1 - yaw, +ve right hand forward 2 - pitch, +ve look up 3 - roll, +ve right hand down Accelerometers, largest when 'x' is highest point 1 - top+, bottom- 2 - right+, left- 3 - front+, back-

And on the other end, when the rendering the scene from the output of Madgewick I know that the following are true (tested by setting during init and not updating the AHRS):

Quaternion that points directly forward refq = Quaternion((1,0,0,0))

Quaternion pointing/pitched directly up refq = Quaternion.from_angle_axis(np.pi/2,1,0,0)

No matter how I've tried swapping various axis I have not yet reached a working system, it either 'moves' incorrectly or the Quaternion ends up pointing in the wrong direction....

Can someone/any provide a reference for how the axis should be arranged?

mungewell avatar Nov 06 '18 21:11 mungewell