Hi guys, I’m trying to understand exactly what the Mavlink ATTITUDE message fields mean. Here it says that they are “roll, pitch and yaw” in the “aeronautical frame”.

I have a forward-facing camera on my drone that tracks fiducial markers and so I need to understand how I should rotate in 3 dimensions the fiducial tracking vector from the camera (this vector, as provided by the camera, points at the fiducial marker in the drone frame).

The yaw from Arducopter appears to describe the compass bearing that the drone is pointing in when viewed from above.

The pitch and roll appear obvious at first glance, but I don’t think they are. I need to rotate my fiducial vector to get it in the “aeronautical frame” (as used by the ATTITUDE message) so I need to create 3 rotation matrices, each describing one of yaw, roll or pitch. This will allow me to rotate my fiducial vector to get it into the correct frame for subsequent flightpath manoeuvres

e.g.

[fiducial vector in aeronautical frame] = [yaw rotation matrix] x ( [pitch rotation matrix] x ( [roll rotation matrix] x [fiducial vector in drone frame] ) )

I am confused about the order of yaw/pitch/roll that I should perform this multiplication in. If it was just a case of yaw and pitch, or yaw and roll, it would be simple and the order would not matter.

If I multiply with **roll first and pitch second** it makes sense as this does not affect the yaw of the drone as seen from above and the final yaw multiplication sets the drone bearing correctly.

However, if I multiply the fiducial vector with **pitch first and roll second**, this does affect the yaw of the drone and then you still need to do the final yaw multiplication, which would end up giving you a yaw different to the one in the ATTITUDE message.

Is someone able to confirm what order I should be doing my multiplications in?

Cheers,

Ralph