Ekf2_main.cpp or ekf.cpp

Hi.
I study position estimation in PX4 v1.6.5.
I use RTK-GPS(u-blox m8p).
I want to learn how IMU and GPS are integrated.
I am using EKF2 for position estimation.
Should I proceed with learning by referring to either Firmware/src/modules/ekf2/ekf2_main.cpp or Firmware/src/lib/ecl/EKF/ekf.cpp?

Do these two codes have a relationship?

Sorry my poor english.

Hi @jjj

The EKF is split into a frontend (ekf2_main) that interfaces with PX4, and a more general backend (ecl/EKF). I’d start in ekf2_main to see roughly how it’s called, but then you’ll quickly end up in the actual EKF code in ecl.

After all the new sensor data is collected and pushed into the EKF, this is the main update. https://github.com/PX4/Firmware/blob/master/src/modules/ekf2/ekf2_main.cpp#L874

Thank you dager.
I will try it from the main for the first time.