Rotation order in ArduPilot's "aeronautical frame"

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

[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?


Hi Ralph,

I haven’t had the chance to verify this, but I found the following that might be of help:

  1. The MAVLink library seems to contain a library function to do that very thing for you (look for mavlink_euler_to_dcm): link
  2. It seems to be using the same conventions found here.

I need to do the same sort of thing, so I’ll report back if I find anything differently.

Best of luck!

1 Like

Thanks for the reply. It is much appreciated.

I see that the mavlink_dcm_to_euler() function in Ardupilot corresponds to the the website you linked to which itself is the inverse of what I am doing - they are showing a rotation matrix going from the inertial frame (what I call aeronautical frame) to the body frame (what I call the drone frame).

As the order of separate roll/pitch/yaw matrices which are multiplied to create the overall rotation matrix is also the opposite of what I am doing, I believe my comment ends up being correct.

I would argue that the Ardupilot code is ambiguous and could do with a comment saying which direction the rotation matrix is being used; aeronautical to drone, or drone to aeronautical frame, as they are transposes of one another.

But maybe people in the know will know which frame conversion is being done, just by looking at the matrices. :slight_smile: