Roll, pitch, and yaw computation


Is there a documentation (block diagrams) on how the roll, pitch, and yaw angles are computed, as well as the height and position? Would you happen to know which part of the Ardupilot code these are seen?

I would like to verify if my understanding is correct that:

  1. Accelerometer and gyroscope raw values end up with the roll and pitch angles
  2. Magnetomer raw values end up with yaw angles
  3. Barometer raw values end up with the altitude reading
  4. GPS reading provides the position

Thank you very much.

ArduPilot uses an Extended Kalman Filter (EKF) to estimate attitude and position. There’s documentation at