The AHRS and NavEKF

I have a question, both the AP_AHRS and AP_NavEKF can get the attitude estimation. Which one does the ardupilot use.

I am very appreciate for your reply!

AP_AHRS is a frontend for the various EKF backends. Currently the default is AP_NavEKF2, but we already have a AP_NavEKF3 that we hope to be the default in the coming months. Every vehicle most commonly uses AP_AHRS that then calls the active EKF backend.

1 Like

Hellow, OXINARF, thank you for your reply!
I am reading Copter-v3.3.3 recently. In AP_AHRS, the attitude is estimated with DCM. While in AP_EKF, the attitude is estimated with quaternion. I want to know whether the AP_AHRS is redundant.

Let me try to explain it this way: Copter -> AP_AHRS -> DCM or EKF. I understand it can be confusing since DCM is all contained inside the AP_AHRS library but that is because we only have one DCM backend, with EKF we have multiple backends (and each of them with lots of code).

Thank you for your explanation, May be I need to study the code in detail, then I will understand your words. I hope I can contribute my code for ardupilot, this is my target!