Commit Graph

178 Commits

Author SHA1 Message Date
Peter Barker 13e7d04497 AP_NavEKF3: make AP_RANGEFINDER_ENABLED remove more code 2024-07-02 09:17:26 +10:00
Peter Barker 563c3e7c62 AP_NavEKF3: rename ins get_primary_accel to get_first_usable_accel 2024-06-26 17:12:12 +10:00
Paul Riseborough 61874da020 AP_NavEKF3: Rework method of synthesising airspeed for dead reckoning
The previous method resulted in data incest and fusion of predicted airspeed on every EKF internal time step.
This was not apparent during flight where the vehicle was turning, but during long straight legs did not constrain along track drift.
2024-06-09 14:25:02 +10:00
Paul Riseborough 720c2da807 AP_NavEKF3: Rework GPS jamming resiliency
Make it user selectable.
Remove potential for a race condition between decisions based on latest data and the EKF fusion processing which operates on a delayed time horizon. This is achieved by preventing data entering the buffer if awaiting checks to pass ensuring that no EKF fusion time horizon processes can use data that hasn't passed checks.
Log the waitingForGpsChecks class variable
2024-06-09 14:25:02 +10:00
Paul Riseborough 568972c0f0 AP_NavEKF3: Fix bug preventing use of default or synthetic airspeed 2024-06-09 14:25:02 +10:00
Paul Riseborough 2c3174b77b AP_NavEKF3: Strengthen protection against GPS jamming
These changes prevent the EKF from consuming GPS data too soon when it is recovering from jamming if the EKF is able to navigate using dead reckoning.
2024-06-09 14:25:02 +10:00
Paul Riseborough 324d5da811 AP_NavEKF3: Use last observed wind states to enable dead reckoning
These changes enable the EKF to use the last observable wind velocity vector estimate to synthesise an airspeed measurement if operating without an airspeed sensor and when all other measurement types that can constrain velocoty drift are lost. This enables the EKF to use dead reckoning to continue after loss of GPS when there is no air speed sensor fitted and without the need to set a default airspeed value.
The logic used to fuse a default airspeed value has also been cleaned up and the call to FuseAirSpeed() from inside SelectBetaDragFusion() has been removed.

AP_NavEKF3: Fix error in default airspeed observation variance

AP_NavEKF3: Enable shadow fusion of airspeed when sensor is disabled
2024-06-09 14:25:02 +10:00
Paul Riseborough e53416e77b AP_NavEKF3: Apply GPS quality checks following loss of 3D fix if velocity error is bounded 2024-06-09 14:25:02 +10:00
Paul Riseborough 5fded75eb6 AP_NavEKF3: Adjust sensor height when EK3_OGN_HGT_MASK bit 2 is set 2024-05-23 10:35:51 +10:00
Paul Riseborough 3c8b3be7a7 AP_NavEKF3: Change yaw source to stop compass use when calibrating 2024-04-23 15:19:56 +09:00
Peter Barker 0afed2f8c2 AP_NavEKF3: allow compilation with HAL_LOGGING_ENABLED false 2024-01-17 18:25:55 +11:00
Peter Barker 5d68f44694 AP_NavEKF3: move beacon variables into structure
AP_NavEKF3: change beacon variable names
2023-04-18 09:28:02 +10:00
Paul Riseborough 5ab17496f6 AP_NavEKF3: Improve protection against GPS glitches during yaw alignment 2023-04-17 08:48:03 +10:00
Peter Barker 2af6a05fa2 AP_NavEKF3: include writeWheelOdom symbol even if no body-odom
like the method above it, we need this symbol or we won't compile
2023-02-11 10:36:33 +11:00
Peter Barker 35a5a73f52 AP_NavEKF3: avoid using struct Location
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
2023-02-04 22:51:54 +11:00
Tatsuya Yamaguchi 366a325fc0 AP_NavEKF3: do not check the second range finder if RANGEFINDER_MAX_INSTANCES is 1 2022-12-20 10:05:24 +11:00
Stephen Dade abcacec25f AP_NavEKF3: Add support for fixed height optical flow 2022-12-01 08:03:47 +09:00
Paul Riseborough 33349ed92a AP_NavEKF3: Prevent on ground range to ground being used in flight 2022-11-22 11:23:44 +11:00
Peter Barker 5cb6906968 AP_NavEKF3: add and use AP_BEACON_ENABLED 2022-11-16 08:16:31 +11:00
Paul Riseborough 399f30bfce AP_NavEKF3: Allow reporting of airspeed consistency for a deselected sensor 2022-09-26 14:17:53 +10:00
Paul Riseborough 608b4c0713 AP_NavEKF3: Enable monitoring of unhealthy airspeed sensors
Innovations and innovation test ratios will still be calculated and reported for an unhealthy sensor, but the EKF states wnd covariance matrix will not be modified.
2022-09-26 14:17:53 +10:00
Peter Barker 0b16c4063e AP_NavEKF3: stop libraries including AP_Logger.h in .h files
AP_Logger.h is a nexus of includes; while this is being improved over
time, there's no reason for the library headers to include AP_Logger.h
as the logger itself is access by singleton and the structures are in
LogStructure.h

This necessitated moving The PID_Info structure out of AP_Logger's
namespace.  This cleans up a pretty nasty bit - that structure is
definitely not simply used for logging, but also used to pass pid
information around to controllers!

There are a lot of patches in here because AP_Logger.h, acting as a
nexus, was providing transitive header file inclusion in many (some
unlikely!) places.
2022-04-08 19:18:38 +10:00
Paul Riseborough c0d88e2673 AP_NavEKF3: Fix vertical velocity reset
Fixes bug that prevents the vertical velocity being reset to the GPS if the position aiding has already timed out and improves sensitivity of the bad IMU data check.
2021-09-23 18:55:28 +10:00
Josh Henderson 3006d50f97 AP_NavEKF3: use vector.xy().length() instead of norm(x,y) 2021-09-14 10:43:46 +10:00
Randy Mackay 85ade10e85 AP_NavEKF3: ofDataNew made local 2021-08-24 16:49:04 +09:00
Randy Mackay 5779ebd177 AP_NavEKF3: remove unused Tbn_flow 2021-08-24 16:49:04 +09:00
Pierre Kancir 8216905f47 AP_NavEKF3: remove unecessary assignements 2021-08-12 10:39:49 +09:00
Peter Barker c34284b6eb AP_NavEKF3: stop using AHRS as conduit for Compass pointer 2021-07-30 12:19:42 +10:00
Paul Riseborough 0088b0f3fe AP_NavEKF3: Revert EK3_BETA_MASK parameter extension
These are not required due to use of bit 7 in FLIGHT_OPTIONS to achieve the same function.
2021-07-22 18:20:45 +10:00
Paul Riseborough 59d31cc7d5 AP_NavEKF3: Rework non-airspeed wind estimation
Faster wind estimation when not using airspeed with acceptable noise in wind velocity estimates.
2021-07-22 18:20:45 +10:00
Andrew Tridgell fc2118f42b AP_NavEKF3: process GPS yaw independently of GPS fix
this processes GPS yaw with its own timestamp and as a separated step
from fusing position and velocity. This makes the yaw time handling
more accurate as yaw for moving baseline GPS comes in as a separate
piece of data from the position and velocity
2021-07-21 17:59:49 +10:00
Andrew Tridgell 0b9cde5812 AP_NavEKF3: fixed indentation in readGpsData() 2021-07-21 17:59:49 +10:00
Andrew Tridgell 6b73c2151a AP_NavEKF3: implement moving origin
this shifts EKF_origin to the current location at 1Hz, while leaving
public_origin alone. All output APIs and logging are relative to
public_origin.

The effect of this change is to remove the distortion caused by a
spherical earth, which allows the EKF to operate without errors at
very long distances from the public_origin.
2021-07-14 17:34:40 +10:00
Andrew Tridgell a8c6d742aa AP_NavEKF3: update earth field at 1Hz
this prevents large mag errors on long distance flights
2021-07-10 07:20:41 +10:00
Andrew Tridgell 885e518741 AP_NavEKF3: allow for double EKF build 2021-07-10 07:20:41 +10:00
Josh Henderson 64dc3bbe41 AP_NavEKF3: Fix #17789 core's ekf origin altitude different if flying 2021-06-22 12:01:10 +10:00
Josh Henderson 0ae3730f11 AP_NavEKF3: non_GPS modes ensure EKF origin set only once and stays in sync
ekf3
2021-06-22 12:01:10 +10:00
Paul Riseborough 76d0dcc25c AP_NavEKF3: Use common method for handling baro ground effect 2021-06-02 11:13:16 +09:00
Andrew Tridgell dc9435a88d AP_NavEKF3: don't limit baro change when we are in fixed wing mode 2021-06-02 11:13:16 +09:00
Peter Barker c00f110f3d AP_NavEKF3: use DAL APIs for takeoff/touchdown expected 2021-06-02 11:13:16 +09:00
Paul Riseborough 53c4b163ce AP_NavEKF3: Allow adjustment of on ground not moving test sensitivity
Also re-tune default sensitivity based on user supplied logs with noisy gyro data.
2021-03-23 10:05:59 +11:00
Peter Barker 4605870788 AP_NavEKF3: remove separate calls to get delta-times for vel and ang 2021-03-13 11:29:29 +11:00
Paul Riseborough 3634a942a1 AP_NavEKF3: Fix bug causing unwanted use of default airspeed 2021-03-05 12:10:01 +11:00
Paul Riseborough 9a5a264aa0 AP_NavEKF3: Improve wind estimation without airspeed sensing
Enable default airspeed variance to be specified externally
Improve control of sideslip fusion
Don't modify non wind states unnecessarily when using synthesised air data measurements
2021-03-05 12:10:01 +11:00
Andrew Tridgell ddc4d08e8f AP_NavEKF3: make drag fusion optional 2021-01-24 11:56:52 +11:00
Andrew Tridgell 1ccda938cb AP_NavEKF3: make external navigation optional 2021-01-24 11:56:52 +11:00
Andrew Tridgell 8da511f039 AP_NavEKF3: make body odomotry build depend on vehicle type
saves about 11k of flash
2021-01-24 11:56:52 +11:00
Randy Mackay 27c998ad94 AP_NavEKF3: rename source and yawFusionMethod from EXTERNAL to GPS 2021-01-05 10:58:06 +11:00
Randy Mackay c14b4a8b6c AP_NavEKF3: add support for GSF as yaw source 2021-01-05 10:58:06 +11:00
Randy Mackay 5891c6ace8 AP_NavEKF3: separate GPS yaw from ExtNav yaw 2021-01-05 10:58:06 +11:00