this adds coreBetterScore() which takes account of tilt and yaw
alignment when comparing cores for lane switching
this ensures we don't switch to a lane that is unaligned due to the
zero error score for unaligned lanes
this allows the EKF core index to be used to select a GPS/baro/mag
instance. This is an alternative to GPS blending that allows EKF lane
switching to be used to select the right combination of GPS and IMU
add logging to XKFS message
Clarifies use of EK3_RANGE_USE_HGT and EK3_ALT_SOURCE parameters to control range finder use.
Setting EK3_RNG_USE_HGT to a positive number to enable automatic switching between the primary height source (baro or GPS) and range finder should be disabled if any primary height source other than Baro or GPS is selected via the EK3_ALT_SOURCE parameter.
AP_NavEKF3: fix failure to arm with EK3_MAG_CAL = 7
AP_NavEKF3: Fix failure to arm when not using magnetometer
AP_NavEKF3: Reduce yaw drift when EK3_MAG_CAL = 7
AP_NavEKF3: Add emergency yaw reset using a Gussian Sum Filter estimate
AP_NavEKF3: Reduce default minimum GPS velocity noise for Copters
Enables fail-safe to be set with more sensitivity and improves tracking accuracy.
Origin values were set using typical GPS performance for receivers on sale 6 years ago. Receiver performance has improved since then.
AP_NavEKF3: Prevent constant mag anomaly yaw resets
Prevents constant magnetic anomaly induced resets that can be triggered when flying with vehicle generated magnetic interference.
Allows for two resets per takeoff. Allowance for two resets is required, becasue a large ground based magnetic yaw anomaly can cause a sufficiently large yaw innovation that two resets in close succession are required.
AP_NavEKF3: Add option to fly without magnetometer
AP_NavEKF3: Rework emergency yaw reset logic
Use a separate external accessor function to request the yaw reset.
Allow reset requests to remain active for a defined period of time.
Tidy up reset function to split out accuracy check.
AP_NavEKF3: Fix vulnerability to lane switch race condition
Prevents the situation where a lane switch results in a lane being selected that does not have the correct yaw. This can occur if the primary lane becomes unhealthy before the external failsafe monitor has time to react.
AP_NavEKF3: Fix EKF_MAG_CAL = 6 behaviours
Fix bug causing the yaw alignment to be performed at startup before the GSF had a valid estimate.
Fix bug causing emergency yaw message to be output for a normal reset.
Fix vulnerability to reported negative yaw variance.
Remove duplicate timer checks.
AP_NavEKF3: Update EK3_MAG_CAL documentation
AP_NavEKF3: Relax yaw gyro bias convergence check when not using mag
AP_NavEKF3: Reduce yaw drift in hover with no yaw sensor
Uses the GSF yaw estimate if available which is better than the EKF's own yaw when no yaw sensor is available.
this allows for a magnetometer to be used as a fallback yaw source in
flight when using an external yaw source such as a GPS. The
magnetometer bias is learned while the GPS yaw is available and
fallback is only done if the mag yaw and GPS yaw are consistent when
fallback is enabled
This also learns the Z gyro bias until first yaw alignment when
MAG_CAL is EXTERNAL_YAW_FALLBACK. This prevents large gyro bias
building while waiting for GPS lock
Adapted from EKF2 implementation as of commits
3835d2613, e9ed3540f and df4fc0fff
this sets a limit on the difference between the earth field from the
WMM tables and the learned earth field inside the EKF. Setting it to
zero disables the feature. A positive value sets the limit in mGauss.
this moves intermediate variables from being per-core to being common
between cores. This saves memory on systems with more than one core by
avoiding allocating this memory on every core.
This is an alternative to #11717 which moves memory onto the stack. It
doesn't save as much memory as #11717, but avoids creating large stack
frames
this ensures we consistently fly with EKF lane1 if it is healthy at
the point we arm. Otherwise the choice of lane will be a lottery.
This is important as many systems have quite different filtering and
vibration characteristics on their different IMUs. We by default
enable fast sampling only on the first IMU for example, which means
the 2nd and 3rd IMUs are more vulnerable to high freq causing
aliasing.
this fixes an issue in selecting the best lane to change to when we
have 3 or more EKF cores. The bug is that if the current lane is
unhealthy it would always choose the last healthy lane instead of
choosing the lane with the lowest score
Previous default was to apply in-flight height origin changes to local position instead of to reported origin height. This caused problems with copters that took off before getting GPS lock.
Fix rounding error bug preventing state from updating after initial convergence.
Decouple GPS reference height from published EKf origin height.
Add bitmask parameter to control update and publishing of GPS reference height.
this changes the stragegy for load levelling between EKF cores so it
works between EK2 and EK3, and with future estimators as well.
It allows us to run EK3 and EK2 at the same time with good scheduling
performance
Use the time delay returned by the GPS driver.
Wait long enough for the GPS configuration to be determined, but time out after 30 seconds and warn the user that a default value for time delay will be used.
Switch to use of an airspeed reading averaged across the raw sensor readings. since the last update.
This avoids use of the IIR which requires a larger time delay compensation and violates the assumption of uncorrelated noise.
The time delay parameter has been reduced to compensate for the removal of the airspeed IIR filtering.
This value is a compromise between what works best for a Ublox 6 which is around 200msec delay and the more recent 7 and 8 series receivers that are around 120msec delay.
Adapt the lengths of the IMU and observations buffers on startup to the specified time delays and update rates.
This does require the EKF to be re-started if time delays are changed.
Enables the horizontal speed at which we switch from range finder to alternate to be adjusted.
Does not switch from range finder to alternate based on speed when speed estimate is invalid.
AP_NavEKF3: Implement same maths as PX4/ecl EKF
Replace attitude vector states with quaternions
Remove gyro scale factor states
Add XY accel delta velocity bias estimation
Initial tuning
Add GPS body frame offset compensation
AP_NavEKF3: Fix bugs and consolidate aiding switch logic
Switching in and out of aiding modes was being performed in more than one place and was using two variables.
The reversion out of GPS mode due to prolonged loss of GPS was not working.
This consolidates the logic and ensures that PV_AidingMode is only changed by the setAidingMode function.
AP_NavEKF3: prevent multiple fusion mode changes per filter update
AP_NavEKF3: Update tuning defaults
AP_NavEKF3: Fix bug causing switching in and out of aiding
If the GPS receiver was disconnected and no data received, then then the gpsGoodToAlign check did not get a chance to run and becasue it was previously true the EKF would switch back into aiding.
This prevents this by ensuring that gpsGoodToAlign defaults to false when the check is not being performed.
An additional check has also been dded to ensure that there is GPS data to fuse before we declare ready to use GPS.
AP_NavEKF3: Fix bug preventing planes recovering from bad magnetometers
This bug created a race condition whereby if the EKF had to reset the yaw to the GPS ground course to recover from a bad magnetometer, the new heading could be over-written by the bad magnetic heading when the plane reached the height for the scheduled reset.
AP_NavEKF3: Improve switch-over to backup magnetometer
When switching over to a back up magnetometer, ensure that the earth field estimate are reset. Otherwise mag earth field estimates due to the previous failed mag could cause data from the new mag to be rejected.
AP_NavEKF3: enable automatic use of range finder height
AP_NavEKF3: Fix bug in handling of invalid range data
AP_NavEKF3: Fix height drift on ground using range finder without GPSAP_NavEKF3:
AP_NavEKF3: Handle yaw jumps due to core switches
AP_NavEKF3: Enable simultaneous GPS and optical flow use
AP_NavEKF3: fix console status reporting
AP_NavEKF3: send messages to mavlink instead of console
This allows the GCS to better handle the display of messages to the user.
AP_NavEKF3: replace deprecated function call
AP_NavEKF3: Compensate for sensor body frame offsets
AP_NavEKF3: Fix bug in median filter code
AP_NavEKF3: save some memory in the position offsets in EKF3
We don't need to copy that vector3f for every sample. A uint8_t does the job
AP_NavEKF3: Add fusion of range beacon data
AP_NavEKF3: Bring up to date with EKF2
AP_NavEKF3: Misc range beacon updates
AP_NavEKF3: Add mising accessors
AP_NavEKF3: remove duplicate include
AP_NavEKF3: Prevent NaN's when accessing range beacon debug data
AP_NavEKF3: Update range beacon naming
AP_NavEKF3: updates
AP_NavEKF3: miscellaneous changes
AP_NavEKF3: misc updates
AP_NavEKF3: misc range beacons updates
AP_NavEKF3: add missing rover default param