Commit Graph

222 Commits

Author SHA1 Message Date
Andrew Tridgell a3411efdb5 AP_NavEKF3: set origin on all cores
when EKF origin is set, make sure it is set on all cores
2019-07-29 10:08:22 +10:00
Andrew Tridgell 3818d8ecda AP_NavEKF3: restrict setting of EKF origin
only allow EKF origin to be set if EKx_GPS_TYPE is set to 3, which is
used for indoor operation
2019-07-29 10:08:22 +10:00
priseborough 0c4f92d4c1 AP_NavEKF3: Add control logic to use external yaw sensor 2019-07-13 11:05:57 +10:00
priseborough 87c7649d09 AP_NavEKF3: Add interface for yaw angle measurements 2019-07-13 11:05:57 +10:00
Andrew Tridgell 5151416080 AP_NavEKF3: force first EKF lane when disarmed
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.
2019-07-04 06:48:23 +10:00
Michael du Breuil be74b631fe AP_NavEKF3: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Andrew Tridgell 60831c2878 AP_NavEKF3: added checkLaneSwitch()
this allows the vehicle code to ask the EKF to change lanes if it is
about to do an EKF failsafe
2019-06-12 09:52:20 +10:00
Andrew Tridgell e4f6ffe719 AP_NavEKF3: fixed bug in EKF lane selection
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
2019-05-07 06:59:50 +10:00
Michael du Breuil fe3b29a088 AP_NavEKF3: Allow checking all cores for health 2019-04-09 10:53:25 +10:00
Paul Riseborough 0d3e1a7d23 AP_NavEKF3: flow use parameter improvements 2019-04-02 10:51:12 +11:00
Paul Riseborough d3e9281846 AP_NavEKF3: Update default plane optical flow param values
Reduce time required to form estimate of terrain offset
2019-04-02 10:51:12 +11:00
Paul Riseborough 35c82ef67f AP_NavEKF3: Improve optical flow height estimation 2019-04-02 10:51:12 +11:00
Paul Riseborough b848e231c7 AP_NavEKF3: Add parameter to control how optical flow data is used 2019-04-02 10:51:12 +11:00
Mark Whitehorn 3c432cf25c AP_NavEKF3: add getQuaternionBodyToNED 2019-03-29 10:58:00 +11:00
Tom Pittenger 17ee20af3f AP_NavEKF3: rename dataflash to logger 2019-03-28 16:40:57 +11: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
Tom Pittenger 8a6a39b590 AP_NavEKF3: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Peter Barker 6fc76a32af GLOBAL: use AP::logger() and strip redundant Log_ from methods 2019-01-18 18:08:20 +11:00
Peter Barker b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Randy Mackay c616587b86 AP_NavEKF: increase ABIAS_P_NSE param doc range to 0.005 2018-12-27 14:09:53 +09:00
Michael du Breuil 25ef5fed82 AP_NavEKF3: Suppress clearing non-trival type warning 2018-10-30 16:17:03 -07:00
Peter Barker 281fad53c2 AP_NavEKF3: always set EKF control limits, even with no cores 2018-10-09 10:47:38 +11:00
Peter Barker be9235a581 AP_NavEKF3: fix writeOptFlowMeas signature
const some of the vectors, stop taking references to scalars that aren't
being changed
2018-09-11 09:03:22 +10:00
Randy Mackay 3d72022f6e EKF: modify ALT_SOURCE param description
We regularly find users changing the ALT_SOURCE to 1 (range finder) when trying to implement terrain following which is not the correct way to do it
2018-07-18 08:31:09 +09:00
Peter Barker 6bf5ffdb6d AP_NavEKF3: use compass singleton for logging 2018-07-04 20:11:27 +01:00
Peter Barker 901ba0034c AP_NavEKF3: do not pass GPS into Log_Write_GPS; it uses singleton 2018-04-18 13:50:55 +09:00
Peter Barker a0d874baa2 AP_NavEKF3: const accessors 2018-04-07 09:56:18 +09:00
Peter Barker 6791808ac6 AP_NavEKF3: remove unneeded initialisations
AP_NavEKF3 should never be allocated in uninitialised memory
2018-04-07 09:54:21 +09:00
Peter Barker d38ff1dd2c AP_NavEKF3: initialise EKF3 constants in declaration not constructor 2018-04-07 09:54:21 +09:00
Peter Barker 55b8a2288e AP_NavEKF3: use ins singleton 2018-03-16 00:37:35 -07:00
Peter Barker 7b1a906c4e AP_NavEKF3: use baro singleton 2018-03-08 21:20:05 -08:00
bugobliterator ea2a880d8a AP_NavEKF3: allocate from MEM_FAST region 2018-01-15 11:46:02 +11:00
Peter Barker 5dc714bf5f AP_NavEKF3: use GPS singleton 2017-12-27 00:58:02 +00:00
priseborough 2310cb6d19 AP_NavEKF3: Enable external control over use of GPS vertical velocity 2017-08-10 19:49:45 +10:00
priseborough c7f6d52065 AP_NavEKF3: Add wheel encoder odometry
Uses the existing body frame odometry observation model.
Handles each sensored wheel as a separate sensor.
2017-07-27 16:52:27 +09:00
priseborough 593437ca95 AP_NavEKF3: Add tuning of visual odometry observation error
Also adjust default values based on replay analysis.
2017-07-27 16:52:25 +09:00
priseborough 0827b13feb AP_NavEKF3: Fix default behaviour for height origin corrections
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.
2017-07-17 02:22:02 +01:00
Peter Barker 93e09c51d3 AP_NavEKF3: eliminate GCS_MAVLINK::send_statustext_all 2017-07-11 23:53:53 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas 6a01c65197 AP_NavEKF3: Fix long description of EK3_OGN_HGT_MASK parameter (NFC) 2017-06-16 12:05:20 +01:00
priseborough 49ec2b4032 AP_NavEKF3: Change default value of EK3_OGN_HGT_MASK
Turn off by default.
Update parameter description.
2017-06-14 12:44:41 +01:00
priseborough 3ae7998f51 AP_NavEKF3: Allow reporting of origin height for specified instance 2017-06-14 12:44:41 +01:00
priseborough 2b97d0f5c9 AP_NavEKF3: Add public accessor for state variances 2017-06-14 12:44:41 +01:00
priseborough 9da3caca47 AP_NavEKF3: 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
Dr.-Ing. Amilcar Do Carmo Lucas d3a57b5965 AP_NavEKF3: Use SI units conventions in parameter units
Follow the rules from:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html
and
http://physics.nist.gov/cuu/Units/checklist.html
one further constrain is that only printable (7bit) ASCII characters are allowed
2017-05-17 18:07:25 +10:00
Andrew Tridgell a04aff7a7d AP_NavEKF3: added inter-EKF scheduling cooperation
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
2017-05-01 14:24:55 +10:00
Andrew Tridgell adb281cd4e AP_NavEKF3: added timing statistics logging 2017-04-28 17:19:39 +10:00
Randy Mackay b255c7b370 AP_NavEKF: add setOrigin 2017-04-22 10:37:31 +09:00
priseborough fb7104f4e3 AP_NavEKF3: add fusion method for body frame odometry data 2017-04-19 11:04:40 +09:00
Andrew Tridgell 248773a7c8 AP_NavEKF3: allow access to quaternion for each instance 2017-04-16 14:01:36 +10:00
priseborough 18927395d7 AP_NavEKF3: log correct GPS for replay 2017-03-13 11:31:51 +11:00
Randy Mackay a80c0a231d AP_NavEKF3: attempt to set-up every core
previously we would only call setup_core for the 2nd core if the first had been setup successfully
2017-03-06 18:40:18 +11:00
Michael du Breuil 1de198883d AP_NavEKF3: Check gps vertical accuracy for aligning the GPS 2017-02-22 11:53:42 -08:00
Francisco Ferreira 23f959b92f
AP_NavEKF3: fix copied parameter descriptions 2017-02-15 19:20:04 +00:00
priseborough de7a679534 AP_NavEKF3: Enable simple heading fusion to be set for specific cores 2017-02-15 19:09:45 +00:00
priseborough 4d958952f6 AP_NavEKF3: use standard unit descriptor for milliseconds 2017-01-27 16:57:42 +09:00
priseborough 7e8f3fca53 AP_NavEKF3: Address review comments
Removes a leftover debug printf statement.
Fixes documentation errors.
Replace remaining fmaxf function calls with Ardupilot MAX function
2017-01-27 16:57:42 +09:00
priseborough 59ee074560 AP_NavEKF3: Remove EKF2 names 2017-01-27 16:57:42 +09:00
priseborough b862f0d7ad AP_NavEKF3: Enable use of GPS delay value from returned by the driver
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.
2017-01-27 16:57:42 +09:00
priseborough 8d1733cee6 AP_NavEKF3: Use FIR filtered airspeed
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.
2017-01-27 16:57:42 +09:00
priseborough 9261c34097 AP_NavEKF3: Update default GPS delay
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.
2017-01-27 16:57:42 +09:00
priseborough ed5039823f AP_NavEKF3: Adapt sensor buffer lengths
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.
2017-01-27 16:57:42 +09:00
priseborough 92b8c33b19 AP_NavEKF3: publish 3-state range beacon estimator states 2017-01-27 16:57:42 +09:00
priseborough e5e4883c72 AP_NavEKF3: Fix GPS use inhibit interface documentation 2017-01-27 16:57:42 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas cae557fb4c AP_NavEKF3: Correct display names, bitmask and units 2017-01-16 19:07:26 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas 195e32c2fc AP_NavEKF3: fix some parameter descriptions 2017-01-09 13:30:24 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas d408d25f92 More spelling stuff 2017-01-06 10:57:39 -08:00
priseborough f1c05ee320 AP_NavEKF3: Allow accel switch on bias uncertainty to be adjusted 2016-12-19 08:07:15 +11:00
priseborough 7d4a50f483 AP_NavEKF3: Prevent unwanted core switch on startup
Require primary core to be healthy for 10 seconds before starting selection logic
2016-12-19 08:07:14 +11:00
priseborough cd6fd0ea45 AP_NavEKF3: Improvements to range finder selection logic
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.
2016-12-19 08:07:14 +11:00
priseborough 7202acc1b5 AP_NavEKF3: Default EKF3 to off
Will revert this and set EKF2 to off by default after testing is completed on all platform types
2016-12-19 08:07:09 +11: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