given that DCM doesn't specify to use the primary accel or gyro when fetching the data from the Ins library, it shouldn't be special-cased here when asked what the primary IMU and accel are. Note that this was asking for the *configured* backend type, rather than the active EKF type, making these clauses even stranger.
This also changes the definition of the "primary IMU index" to be whichever gyro is active rather than the accel. Since we don't currently split primary gyro/primary accel, this is a reasonable change.
the comment here was incorrect; we do not need EKF3 to have a good wind estimate to fall back to DCM here.
Also restructure the code to make it more obvious that this is what's going on.
with the change to cache results inside AP::ahrs().state we no longer need to worry about the backend's attempts to project the last-known-location forwards according to amount of time elapsed since that last-known-location was calculated.
when dead-reckoning the EKF wind estimate can diverge from reality,
leading to us rejecting a valid airspeed sensor. We are best off
trusting airspeed if we are dead-reckoning
clang reports this could be a problem when compiling under some EABIs. Remove it from most places as it is just noise, replace with class where we want to avoid including Location.h
this copes with quadplanes with no compass. With a compass we are
better off using EKF when not in fly-forward as it will give better
height control.
This makes QHOVER for takeoff in quadplanes with no compass a lot more
flyable
this fixes a "climb away" in quadplanes when AHRS_EKF_TYPE=2 and
EK2_ENABLE=0. The user has ARMING_CHECK=5390 to disable key arming
checks, and the plane flew on DCM as the configured EKF wasn't
enabled.
This resulted in AHRS::get_origin() returning false as it couldn't ask
EKF2 for the origin (as EKF2 was not enabled or instantiated)
The result was an incorrect calculation for target height during the
descent stage of QRTL, resulting in a climb away until the user took
over
we need to overwrite _omega with the filtered gyro value, so we get
both the low pass filter and the notch filters. Otherwise we will fly
with very high noise gyro data
this also fixes the accel_ef_blended to use the filtered accel. It is
not blended, and removing "_blended" from the API will be worthwhile
as a followup
In the case that you have INS_USE indicating IMUs should be used, but
EK3_IMU_MASK leaving some IMUs unused, we subtract the bias from the
wrong INS data