Commit Graph

50 Commits

Author SHA1 Message Date
Peter Barker 806b2708c1 AP_NavEKF3: change namespace of MultiCopter and FixedWing params
this stops the libraries knowing anything about AP_Vehicle
2022-11-09 19:04:37 +11:00
Tamas Nepusz 8959d35b91 AP_NavEKF3: add EK3_GPS_VACC_MAX as a threshold that decides whether to use GPS as altitude source depending on vAcc 2022-08-03 17:57:05 +10:00
Josh Henderson 3006d50f97 AP_NavEKF3: use vector.xy().length() instead of norm(x,y) 2021-09-14 10:43:46 +10:00
Andrew Tridgell 885e518741 AP_NavEKF3: allow for double EKF build 2021-07-10 07:20:41 +10:00
Peter Barker c00f110f3d AP_NavEKF3: use DAL APIs for takeoff/touchdown expected 2021-06-02 11:13:16 +09:00
Paul Riseborough 85c0040fa3 AP_NavEKF3: Improve inFlight detection for fixed wing
Better handle case where no airspeed sensor is being used with a hand launch.
2021-03-05 12:10:01 +11:00
Paul Riseborough 0971ef55a4 AP_NavEKF3: Fix bug preventing EKFGSF running when needed for reset
The gpsAccuracyGood flag should not be used because it will go false if GPS innovations become high due to bad yaw which is when the EKFGSF is required. to keep running.
2021-03-02 07:28:24 +11:00
Andrew Tridgell d242339f2e AP_NavEKF3: added have_vz flag to GPS buffer data
this ensures that we record GPS vertical velocity status for every
sample correctly
2020-12-01 10:33:50 +11:00
Andrew Tridgell 603e0c090d AP_NavEKF3: don't reset EKx_GPS_TYPE when GPS has no vertical velocity
setting the parameter to 1 causes the following issues:

 - the GPS may not have vertical velocity at the time the parameter
   set happens, but may get it later when the GPS is fully configured

 - we may switch between GPS modules which do/don't have vertical
   velocity

 - the user may download parameters after the set(1), and end up with
   incorrect parameters they may later load onto the vehicle,
   permanently disabling use of vertical velocity
2020-12-01 10:33:50 +11:00
Randy Mackay 33b6212cce AP_NavEKF3: rename _sources to sources 2020-11-20 16:43:44 +09:00
Randy Mackay 6daaa06317 AP_NavEKF3: integrate AP_NavEKF_Source::useVelXYSource
also integrate useVelZSource
2020-11-20 16:43:44 +09:00
Andrew Tridgell 72ee7d15e1 AP_NavEKF3: fixup for AP_DAL 2020-11-20 16:43:44 +09:00
Randy Mackay c21d58ebea AP_NavEKF3: integrate Source for position 2020-11-20 16:43:44 +09:00
Paul Riseborough db86a5acc8 AP_NavEKF3: Don't update yaw estimator with bad GPS 2020-11-16 16:01:13 +11:00
Andrew Tridgell 6ee1b23d28 AP_NavEKF3: removed use of another lanes gyro in optflow takeoff detection
as discussed with Paul
2020-11-10 16:15:45 +11:00
Andrew Tridgell eaa8474563 AP_NavEKF3: cope with INS_MAX_INSTANCES below 3 2020-11-10 16:15:45 +11:00
Andrew Tridgell 9b81c5a1e0 AP_NavEKF3: use dal reference in EKF backends
saves a bit of flash space
2020-11-10 16:15:45 +11:00
Andrew Tridgell 096aab9388 AP_NavEKF3: convert to use AP_DAL for new replay structure
Co-authored-by: Peter Barker <pbarker@barker.dropbear.id.au>
2020-11-10 16:15:45 +11:00
Randy Mackay eeb1a1846c AP_NavEKF3: replace prearm_healthy with pre_arm_check 2020-10-07 11:53:07 +11:00
Andrew Tridgell 458ade86f5 AP_NavEKF3: fixed segfault when IMU mask covers more IMUs than GSF mask 2020-08-28 10:17:00 +10:00
Harshit Kumar Sankhla edc3709653 AP_NavEKF3: implement sensor affinity using EK3_AFFINITY parameter
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
2020-08-27 20:20:51 +10:00
Peter Barker 6b701ae3b3 AP_NavEKF3: correct includes 2020-08-07 19:20:07 +10:00
Paul Riseborough 21ea5d5039 AP_NavEKF3: Require GSF yaw history for reset when not using a yaw sensor 2020-07-07 15:33:58 +10:00
Paul Riseborough 354b551ef0 AP_NavEKF3: Handle repeated FW flight without magnetometer
The EKF can build up large yaw errors on ground so it is safer to stop using GPS and re-align after launch as per first launch.
2020-07-07 15:33:58 +10:00
Paul Riseborough 8ff6780323 AP_NavEKF3: Clarify distinct use cases for 'takeoff expected' 2020-07-07 15:33:58 +10:00
Paul Riseborough d1a0c2eb30 AP_NavEKF3: Start EKF-GSF yaw estimator before fixed wing takeoff 2020-07-07 15:33:58 +10:00
Paul Riseborough f7c8ee807c AP_NavEKF3: Reset yaw estimator bias states at start of flight
Enables yaw bias to be learned when sitting stationary on ground.
2020-07-07 15:33:58 +10:00
Randy Mackay ec5f84c926 AP_NavEKF3: remove unused terrainHgtStableSet_ms 2020-06-24 21:16:50 +09:00
Randy Mackay dccc3e22d9 AP_NavEKF3: minor comment fix re RNG_USE_HGT 2020-06-24 21:16:50 +09:00
Paul Riseborough ed5b695c94 AP_NavEKF3: Clarify intended use of setTerrainHgtStable accessor 2020-06-24 21:16:50 +09:00
Paul Riseborough 410b5825fb AP_NavEKF3: Enable use of EKF-GSF yaw estimate
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.
2020-04-24 09:43:22 +10:00
Peter Hall dd75609599 AP_NavEKF3: get_time_flying in vehicle 2020-01-14 22:34:37 -07:00
Andrew Tridgell f3fc910abe AP_NavEKF3: continuously update gpsGoodToAlign
use it to determine how to handle a height datum reset
2019-07-07 19:20:32 +10:00
Andrew Tridgell 2208689893 AP_NavEKF3: don't use disabled gyros in opticalflow takeoff detection 2019-07-07 19:03:01 +10:00
Michael du Breuil be74b631fe AP_NavEKF3: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Peter Barker dce472745e AP_NavEKF3: take EAS2TAS from AHRS rather than airspeed 2019-06-06 12:44:36 +10:00
Pierre Kancir b3a1c9c90c AP_NavEKF3: use get_distance_NE instead of location_diff 2019-04-08 08:00:52 -07:00
Arjun Vinod f382a657bd AP_NavEKF3: fixed typos 2019-02-26 08:33:39 +11:00
Tom Pittenger 55377b234f AP_NavEKF3: remove HAL_CPU_CLASS_150 check, 150 is already a minimum requirement 2019-02-17 13:00:00 -08:00
murata f0a6cd5846 AP_NavEKF3: Clarify the message 2018-06-04 11:32:15 +09:00
Peter Barker 55b8a2288e AP_NavEKF3: use ins singleton 2018-03-16 00:37:35 -07:00
Peter Barker 5dc714bf5f AP_NavEKF3: use GPS singleton 2017-12-27 00:58:02 +00:00
Peter Barker 93e09c51d3 AP_NavEKF3: eliminate GCS_MAVLINK::send_statustext_all 2017-07-11 23:53:53 +01:00
Andrew Tridgell a1508b58c1 AP_NavEKF3: use AHRS likely flying state
this sets inFlight when AHRS has indicated flying for 5s
2017-06-20 09:44:44 +10:00
priseborough edee8396ba AP_NavEKF3: Improve in-flight check for non fly forward vehicles
This will enable the EK3_MAG_TYPE 0 option to be used for multirotors
2017-06-19 06:09:07 +10:00
murata 46cba2c970 libraries: Delete the setting value for specific editor. 2017-05-11 13:18:41 -07:00
Michael du Breuil 1de198883d AP_NavEKF3: Check gps vertical accuracy for aligning the GPS 2017-02-22 11:53:42 -08:00
priseborough 2e5ac40ef6 AP_NavEKF3: remove unnecessary stdio includes 2017-01-27 16:57:42 +09:00
priseborough 59ee074560 AP_NavEKF3: Remove EKF2 names 2017-01-27 16:57:42 +09:00
priseborough 39969e7d8e AP_NavEKF3: added EKF3 for EKF experimentation
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
2016-12-19 08:06:47 +11:00