Questions on EKF

Hello everyone, I was reading EKF wiki page in and I have few questions to people who have the knowledge. Sorry if my questions are too noob, in advance. I hope this is the correct category to discuss EKF.


  1. As far as i understand, EKF fuses IMU output with other sensors to get better estimate. When EK2_ALT_SOURCE set to 0, It never uses other altitude information to fuse but fuses %100 Barometer into IMU altitude, right? I am asking this because it is written in the description of parameter EK2_ALT_NOISE that, “Increasing it reduces the weighting of the baro measurement and will make the filter respond more slowly to baro measurement errors, but will make it more sensitive to GPS and accelerometer errors.” Does filter use both GPS and Baro at the same time?
    By the way, can someone give more information about being ‘sensitive to errors’? What I understand is, ekf will trust more to gps and IMU if param value increases and loses its trust to baro. Also lower values indicate baro is more accurate rather than gps and accel?

  2. I see EK2_ALT_SOURCE is highlighted as Reboot Required. The question is, it can not be changed during flight, so in which case EKF algorithm decides to switch back to Baro as altitude source? What happens if one of the barometers fail or glitch? does it just switch EKF core with proper baro?
    See the quote from docs, "If a switch to Baro height needs to be made when the filter is operating, then the Baro height is corrected for the learned offset to prevent a sudden step in height estimate."

  3. Is this instruction still valid?
    “EK2_ALT_SOURCE= 2 is useful when GPS quality is very good and barometer drift could be a problem. For example if the vehicle will perform long distance missions with altitude changes of >100m.”

I have found that GPS may be used as a backup height sensor in
But I could not found any switching to other height sensor in case of primary height source failure. Maybe @priseborough would help me!

Is there anybody who masters EKF codebase?