Commit Graph

67 Commits

Author SHA1 Message Date
Paul Riseborough 8038efc152 AP_NavEKF2: Flow use parameter updates 2019-04-02 10:51:12 +11:00
Paul Riseborough 2b8b53d6b2 AP_NavEKF2: Add parameter to control how optical flow flow data is used 2019-04-02 10:51:12 +11:00
Arjun Vinod a0e7c37f8c AP_NavEKF2: fixed typos 2019-02-22 10:21:35 +11:00
Tom Pittenger b32e8a4424 AP_NavEKF2: remove HAL_CPU_CLASS_150 check, 150 is already a minimum requirement 2019-02-17 12:59:52 -08:00
Peter Barker 3774aa6619 AP_NavEKF2: remove default clause in setAidingMode
All values from the enumeration should be handled in this switch; adding
a default will hide a compiler warning which may be useful.
2018-10-03 17:49:43 +01:00
Andrew Tridgell 3d31773fb4 AP_NavEKF2: fill in gps_quality_good flag 2018-07-14 17:49:52 +10:00
priseborough 12fd19ea26 AP_NavEKF2: Clarify definition for gps_glitching flag 2018-03-27 20:28:57 +09:00
Paul Riseborough c680b931dc AP_NavEKF2: Enable fusion of external nav position data 2018-03-27 20:28:42 +09:00
Peter Barker 9c8466dc03 AP_NavEKF2: use GPS singleton 2017-12-27 00:58:02 +00:00
priseborough ac568bae53 AP_NavEKF2: Initialise EKF origin height to field elevation
Enables copters to set bit position 2 in the EK2_OGN_HGT_MASK parameter without having a large jump in reported local position height.
2017-07-17 02:22:02 +01:00
Peter Barker 5da3759ff4 AP_NavEKF2: eliminate GCS_MAVLINK::send_statustext_all 2017-07-11 23:53:53 +01:00
priseborough 36e7dfb5f6 AP_NavEKF2: Improve GPS reference height estimator
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.
2017-06-14 12:44:41 +01:00
Randy Mackay b255c7b370 AP_NavEKF: add setOrigin 2017-04-22 10:37:31 +09:00
priseborough b7c4945000 AP_NavEKF2: Fix bug preventing reset to GPS
This fixes a bug that prevented the reset to the GPS position occurring if GPS velocity observations were still passing innovation consistency checks.
2017-03-06 17:11:39 +11:00
priseborough 1a7b5538e5 AP_NavEKF2: Enable simple heading fusion to be set for specific cores 2017-02-15 19:17:53 +00:00
priseborough a1d41edc4e AP_NavEKF2: Use the same mag fusion method for all cores
The original reason for using a different method for the second core is no longer valid.
2017-02-15 19:01:10 +00:00
murata 653030b038 AP_NavEKF2: Changed if statements to switch statement.
AP_NavEKF2: Change indentation.
2016-12-26 10:15:55 +09:00
priseborough 6dc7d25fde AP_NavEKF2: Fix bug in loss of aiding fallback
Fixes a bug introduced by the introduction of range beacon fusion to the fallback test.
2016-12-21 18:08:39 +11:00
priseborough 2ee8250807 AP_NavEKF2: Changes from code review by @muramura 2016-11-30 17:56:46 +09:00
Randy Mackay 51ccfca31c AP_NavEKF2: fix format of statustext for beacon init 2016-11-30 17:56:44 +09:00
priseborough ef03a85cd3 AP_NavEKF2: add range beacon interface and fusion method 2016-11-30 17:56:43 +09:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
priseborough b0072b587c AP_NavEKF2: fix reporting of optical flow use status 2016-10-10 14:49:24 +09:00
priseborough ed9ecb28fb AP_NavEKF2: Enable entry into relative position mode on start-up 2016-10-10 14:49:21 +09:00
priseborough f9018fcc1b AP_NavEKF2: Enable simultaneous optical flow and GPS use
Enables simultaneous use of GPS and optical flow data with automatic fallback to relative position mode if GPS is lost and automatic switch-up to absolute position status if GPS gained/re-gained.
2016-10-10 14:49:02 +09:00
Jonathan Challinger d1ecc63bf1 AP_NavEKF2: change priority of statustext messages 2016-07-29 13:19:51 +09:00
Andrew Tridgell 567d5cdbe6 AP_NavEKF2: use mavlink messages not printf for state change notifications 2016-07-19 12:16:51 +10:00
priseborough e2b8807260 AP_NavEKF2: 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.
2016-07-19 12:16:50 +10:00
priseborough fcc07b5560 AP_NavEKF2: Prevent multiple aiding mode changes per update 2016-07-19 12:16:50 +10:00
priseborough f4f347fb75 AP_NavEKF2: add missing parenthesis and console message 2016-07-19 12:16:50 +10:00
priseborough 9a23152ee4 AP_NavEKF2: 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.
2016-07-19 12:16:50 +10:00
priseborough 341d070db8 AP_NavEKF2: Separate filter status update and get functions
The filter status logic calculations were being repeated every time the get function was called.
The logic is now updated once per filter update step and a separate get function added
2016-07-19 12:16:49 +10:00
priseborough 04e8726d8a AP_NavEKF2: relax bias convergence check
Enables bias convergence check to pass within 30 seconds when vehicle is static.
2016-07-19 12:16:48 +10:00
priseborough 280395afa1 AP_NavEKF2: Don't declare ready to do aiding unless gyro bias is learned 2016-07-19 12:16:48 +10:00
priseborough aaab250f13 AP_NavEKF2: Don't start GPS aiding until gyro calibration has stabilised
If we start GPS aiding before the gyro bias variances have reduced, glitches on the GPS can cause attitude disturbances that degrade flight accuracy during early flight.
2016-07-19 12:16:48 +10:00
priseborough 10470b2dc1 AP_NavEKF2: fix bug in initialisation of declination co-variances
Co-variances were being re-zeroed after being set. This meant that the initial declination learning was sensitive to measurement errors which could result in poor initial yaw accuracy.
2016-07-10 08:21:18 +10:00
priseborough 51dbed2338 AP_NavEKF2: remember mag field states between flight on same power cycle
Remember the mag bias and earth field states learned during flight when the vehicle  lands.
This improves performance for vehicles that do multiple flight on one power cycle
2016-07-10 08:21:18 +10:00
Paul Riseborough dc6836988c AP_NavEKF2: Improve ground based magnetic anomaly protection for copter
The toilet bowling check during early flight has been removed. This check caused problems where bad compass calibration was the cause of the toilet bowling and resetting to the compass was a bad option. The handling of simultaneous failed mag and velocity innovations is already handled outside the EKF by the failsafe.
A check for yaw errors due to a ground based magnetic anomaly has been introduced.
The logic for in-flight yaw and magnetic field resets has been cleaned up and variable names improved.
2016-06-28 14:20:12 +10:00
Paul Riseborough 24d8cc62e2 AP_NavEKF2: rework yaw and magnetic heading reset logic
Splits in-flight yaw alignment completed status into separate yaw and magnetic field flags.
Reduce the number of places where decisions to perform a yaw and field reset are made.
Don't perform a reset unless there is is data in the buffer
Don't use 3-axis fusion if the field states still need to be reset.
When starting 3-axis fusion request a reset if not previously performed.
Ensure magnetometer and GPs heading resets are alwasy perfomred with data at teh correct time horizon.
2016-05-31 16:12:53 +10:00
Paul Riseborough a94a19bd09 AP_NavEKF2: Fix bug causing continual yaw resets 2016-05-28 06:52:11 +10:00
Andrew Tridgell 97e2203e70 AP_NavEKF2: don't do 3D mag fusion on 2nd EKF2 core
this reduces the risk that mag fusion errors will badly affect
attitude estimation.
2016-05-27 21:27:06 +10:00
Paul Riseborough 722eb0d706 AP_NavEKF2: Fix bug for start of wind speed estimation
The commencement of airspeed fusion could cause pitch errors due to small variances and large innovations. This issue is addressed by the following changes:
1) The airspeed measurement is used to set wind states to a value that reduces initial innovations.
2) The wind state variances are set to values that better reflect the wind speed uncertainty
2016-05-27 09:00:41 +10:00
Paul Riseborough 6d34ac5ceb AP_NavEKF2: improve switch-over to use of mag field states
Set initial variances to measurement uncertainties
Always perform a field  and yaw reset
2016-05-27 09:00:40 +10:00
Paul Riseborough 5ec8d523f6 AP_NavEKF: remove unwanted co-variance reset
The co-variance resets required following a velocity and position state reset is now performed in the stte reset function
2016-05-21 15:13:53 +10:00
Paul Riseborough 08de4e6d95 AP_NavEKF: Do not perform start-up yaw alignment if no compass
Yaw cannot be aligned until in-flight when there is sufficient GPS velocity.
2016-05-21 15:13:52 +10:00
Ricardo de Almeida Gonzaga 64d14356b9 AP_NavEKF2: Fix typos 2016-05-13 19:20:06 -03:00
Paul Riseborough 7e05646316 AP_NavEKF2: Improvements to non-GPS performance
Change to user adjustable fusion of constant position (as per legacy EKF) instead of constant velocity.
Enable user to specify use of 3-axis magnetometer fusion when operating without aiding.
Don't allow gyro scale factor learning without external aiding data as it can be unreliable
2016-02-18 08:53:41 +09:00
Paul Riseborough 9b82b2200c AP_NavEKF2: Fix plane in-flight yaw reset
The copter method was being used for plane and the plane method was not being run due to the change in flight status not being detected.
The plane reset method did not trigger if the EKF had already dragged the velocity states along with the GPS or could align to an incorrect heading.
The method has been reworked so that it resets to the GPS course, but only if there are inconsistent angles and large innovations.
To stop a failed magnetometer causing a loss of yaw reference later in flight, if all available sensors have been tried in flight and timed out, then no further magnetoemter data will be used
2015-11-16 09:05:42 +11:00
Paul Riseborough 577670ccee AP_NavEKF2: Reduce memory required by 6KB when running at 400Hz
Down-sample the IMU and output observer state data to 100Hz for storage in the buffer.
This reduces storage requirements for Copter by 75% or 6KB
It does not affect memory required by plane which already uses short buffers due to its 50Hz execution rate.
This means that the EKF filter operations operate at a maximum rate of 100Hz.
The output observer continues to operate at 400Hz and coning and sculling corrections are applied during the down-sampling so there is no loss of accuracy.
2015-11-10 15:51:18 +11:00
Paul Riseborough 7294c8004b AP_NavEKF2: Enable use of backup magnetometers after a timeout
If the magnetometer fails innovation consistency checks for too long (currently 10 sec), then the next available sensor approved for yaw measurement will be used.
2015-11-09 22:07:09 +11:00