Commit Graph

539 Commits

Author SHA1 Message Date
Andrew Tridgell
e9ed3540f1 AP_NavEKF2: constrain field by table after fusion
this should make for faster convergence
2019-06-03 12:21:29 +10:00
Andrew Tridgell
3835d2613e AP_NavEKF2: added EK2_MAG_EF_LIM parameter
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.
2019-06-03 12:21:29 +10:00
Randy Mackay
e19d638c0f AP_NavEKF2: support higher optical flow updates rates 2019-05-11 16:23:57 +09:00
Andrew Tridgell
cc62998d40 AP_NavEKF2: 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
7f639c1bb2 AP_NavEKF2: Allow checking all cores for failure 2019-04-09 10:53:25 +10:00
Pierre Kancir
50e99b6e1a AP_NavEKF2: use get_distance_NE instead of location_diff 2019-04-08 08:00:52 -07:00
Pierre Kancir
3f5a6a243c AP_NavEKF2: use get_distance instead of location_diff 2019-04-08 08:00:52 -07:00
Paul Riseborough
8038efc152 AP_NavEKF2: Flow use parameter updates 2019-04-02 10:51:12 +11:00
Paul Riseborough
e2148e7e2a AP_NavEKF2: 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
aa6eee82f4 AP_NavEKF2: Rework opt flow terrain height logic 2019-04-02 10:51:12 +11:00
Paul Riseborough
67d20f3b3c AP_NavEKF2: Update parameter description 2019-04-02 10:51:12 +11:00
Paul Riseborough
1862512c2b AP_NavEKF2: Use flow sensor for navigation with unknown platform type
This is the more common use case.
2019-04-02 10:51:12 +11:00
Paul Riseborough
921205f61c AP_NavEKF2: Minor amendments from review 2019-04-02 10:51:12 +11:00
Paul Riseborough
a40208ebd4 AP_NavEKF2: Improve optical flow height estimation
Updated derivation using sequential fusion of Y and X axis data.
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
Mark Whitehorn
6b70181837 AP_NavEKF2: add getQuaternionBodyToNED 2019-03-29 10:58:00 +11:00
Tom Pittenger
8506ae9c32 AP_NavEKF2: rename dataflash to logger 2019-03-28 16:40:57 +11:00
Dr.-Ing. Amilcar do Carmo Lucas
79ee52917f AP_NavEKF2: replace location_offset() and get_distance() function calls with Location object member function calls
This allows removing duplicated code
2019-02-28 11:44:09 +11:00
Arjun Vinod
78b165e36f AP_NavEKF2: fixed typos 2019-02-26 08:33:39 +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
Tom Pittenger
8a6a39b590 AP_NavEKF3: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Andrew Tridgell
ccc1f906f8 AP_NavEKF2: fixed EKF compass switching
when we had 3 compasses the lack of the 'break' meant when we switched
compass in flight we would always switch back instantly to the one
that we had just rejected.
2019-02-09 13:04:52 +11:00
chobits
3766ee1b60 AP_NavEKF2: add external navigation data lag 2019-01-31 08:30:22 +09: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
Peter Barker
ebd12b30e8 AP_NavEKF2: adjust for Location_Class and Location unification 2019-01-16 11:45:29 +11:00
Peter Barker
9be604e3ce AP_NavEKF2: adjust for location flags being moved out of union 2019-01-16 11:45:29 +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
Pierre Kancir
49d20364cb AP_NavEKF2: pass quaternion by const reference 2018-12-20 09:05:01 +09:00
Andrew Tridgell
8ea7df3efe AP_NavEKF2: added filter reset if unhealthy for 5s and disarmed 2018-11-30 11:02:30 +11:00
Michael du Breuil
29db069c75 AP_NavEKF2: Suppress clearing non-trival type warning 2018-10-30 16:17:03 -07:00
chobitsfan
1e56ad4837 AP_NavEKF2: add external nav system to POSNE_M_NSE description 2018-10-24 19:14:54 +09:00
chobits
08b9bf4a89 AP_NavEKF2: fix extNav position noise 2018-10-24 19:14:54 +09:00
Andrew Tridgell
805647df85 AP_NavEKF2: enable use of in-flight compass learning 2018-10-24 07:25:42 +10:00
Peter Barker
1c1d651979 AP_NavEKF2: add space for null-termination
This is simply to preserve existing behaviour when snprintf starts to
null-terminate strings
2018-10-21 07:54:30 +11:00
Peter Barker
3a79ae4eca AP_NavEKF2: use union to alias array and struct access to states
This avoids creating two pointers of different types to the same memory.

Having two pointers to the same memory can lead to the compiler
optimising code such that a write to one pointer is rearranged to be
either before or after a read from the other pointer depending on which
is deemed faster - not a good outcome.
2018-10-19 08:46:43 +11:00
Peter Barker
fb176b544f AP_NavEKF2: correct compilation when running MATH_CHECK_INDEXES 2018-10-19 08:46:43 +11:00
Peter Barker
889190d46e AP_NavEKF2: always set EKF control limits, even with no cores 2018-10-09 10:47:38 +11: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
Michael du Breuil
66e9286cf6 AP_NavEKF2: Fix roundoff, and missing offset handling of getLLH 2018-09-21 00:18:49 +01:00
Peter Barker
d8aa8d2b71 AP_NavEKF2: 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
Michael du Breuil
ee9cc28fda AP_NavEKF2: Utilize the GPS drivers estimate for lag 2018-08-07 09:55:26 +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
Andrew Tridgell
3d31773fb4 AP_NavEKF2: fill in gps_quality_good flag 2018-07-14 17:49:52 +10:00
Dr.-Ing. Amilcar do Carmo Lucas
59e087214f AP_NavEKF2: spell in comments (NFC) 2018-07-10 08:17:57 +09:00
Peter Barker
baa818a812 AP_NavEKF2: use compass singleton for logging 2018-07-04 20:11:27 +01:00
murata
a9b2b9dddf AP_NavEKF2: Delete unused definitions 2018-06-11 09:11:44 +09:00
murata
1e011c0c15 AP_NavEKF2: Clarify the message 2018-06-04 11:32:15 +09:00
Andrew Tridgell
fb0deba3aa AP_NavEKF2: send airspeed variance over mavlink 2018-04-30 15:41:31 +10:00
Peter Barker
578facc9ad AP_NavEKF2: do not pass GPS into Log_Write_GPS; it uses singleton 2018-04-18 13:50:55 +09:00
Peter Barker
81044760c7 AP_NavEKF2: const accessors 2018-04-04 12:20:36 +01: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
40957ec430 AP_NavEKF2: use ins singleton 2018-03-16 00:37:35 -07:00
Peter Barker
5ab89324b2 AP_NavEKF2: use baro singleton 2018-03-08 21:20:05 -08:00
Peter Barker
5b7d5a9757 AP_NavEKF2: mark getEulerAngles as const 2018-03-07 12:34:39 +00:00
Peter Barker
dbe860152d AP_NavEKF2: tight types on constants
This saves ~200 bytes on at stm32 build, at the expense of people having
to watch the type carefully when increasing the values
2018-03-01 20:27:19 +09:00
Peter Barker
3a99b2bce1 AP_NavEKF: move initialisation of EKF constants into header file
Various comments where getting out of sync with one-another, and
having everything in one place lets you match values against types.
2018-03-01 20:27:19 +09:00
bugobliterator
b1213a522d AP_NavEKF2: allocate NavEKF core from MEM_FAST region 2018-01-15 11:46:02 +11:00
Peter Barker
9c8466dc03 AP_NavEKF2: use GPS singleton 2017-12-27 00:58:02 +00:00
Pierre Kancir
171e80d8dc AP_NavEKF2: only report terrain estimator innovations with valid rng value 2017-12-18 22:51:46 +00:00
Andrew Tridgell
4d4e66d825 AP_NavEKF2: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
priseborough
3b32d583a9 AP_NavEKF2: Fix delta time use error 2017-12-12 11:39:38 +11:00
priseborough
440d361aff AP_NavEKF2: Limit range of delta times 2017-12-12 11:39:38 +11:00
Andrew Tridgell
97729a12f0 AP_NavEKF2: don't run IMU updates until buffer fills
this prevents us using bad initial data multiple times. It fixes a bug
where the IMU may pause during EK2 initialisation
2017-12-12 11:39:38 +11:00
Andrew Tridgell
4019a167a9 AP_NavEKF2: fixed inverted function setInhibitGpsVertVelUse() 2017-11-29 09:47:14 +09:00
Samuel Tabor
1b4705242c AP_NavEKF2: print reason for EKF2 arming failure when no GPS is available 2017-11-20 13:53:31 +09:00
priseborough
efdc651d1a AP_NavEKF2: Require reboot after changing ALT_SOURCE parameter
Toggling between alt sources in flight using the parameter can have unpredictable effects due to the various height offsets and the possibility that the data source may be unavailable.
2017-10-04 00:24:15 +01:00
Lucas De Marchi
3c04f4e4d1 AP_NavEKF2: add static create method 2017-09-26 03:01:21 +01:00
Peter Barker
1e83ef3c44 AP_NavEKF2: use rangefinder backend accessors 2017-08-15 18:30:45 +01:00
priseborough
f2f3067326 AP_NavEKF2: Add interface to control GPS vertical velocity use 2017-08-10 19:49:45 +10:00
Michael du Breuil
dffa3d3b40 AP_NavEKF2: Fix possible compass nullptr dereference 2017-08-01 15:25:05 +01: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
priseborough
027552ef44 AP_NavEKF2: 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
5da3759ff4 AP_NavEKF2: eliminate GCS_MAVLINK::send_statustext_all 2017-07-11 23:53:53 +01:00
Randy Mackay
7e7f78d4b5 AP_NavEKF2: final mag reset at 2.5m 2017-07-08 08:39:43 +09:00
priseborough
c69c5440a0 AP_NavEKF2: Fix calculation of predicted LOS rate in terrain estimator 2017-06-26 14:58:06 +01:00
priseborough
ce8e935896 AP_NavEKF2: Fix terrain estimator innovation consistency check 2017-06-20 02:08:56 +01:00
priseborough
b7e6e6f95f AP_NavEKF2: Fix bug in flow fusion for terrain estimation
Also remove unused class variables
2017-06-20 02:08:56 +01:00
Andrew Tridgell
cbffc29f0b AP_NavEKF2: use AHRS likely flying state
this sets inFlight when AHRS has indicated flying for 5s
2017-06-20 09:44:44 +10:00
priseborough
647db728ce AP_NavEKF2: Improve is flying check for non fly forward vehicles
Will enable use of EK3_MAG_TYPE = 0 for coptersAP_NavEKF2:
2017-06-19 06:09:07 +10:00
Dr.-Ing. Amilcar Do Carmo Lucas
7426bdb9b7 AP_NavEKF2: Fix long description of EK2_OGN_HGT_MASK parameter 2017-06-16 12:05:20 +01:00
priseborough
b42fb31d7d AP_NavEKF2: Change default value of EK2_OGN_HGT_MASK
Turn off by default.
Update parameter description
2017-06-14 12:44:41 +01:00
priseborough
fd25450632 AP_NavEKF2: Ensure reported local height = global height - origin height 2017-06-14 12:44:41 +01:00
priseborough
77d21f72d4 AP_NavEKF2: Allow reporting of origin height for specified instance 2017-06-14 12:44:41 +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
priseborough
1985dcd366 AP_NavEKF2: Fix bug in declination fusion 2017-06-03 15:16:25 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas
3f6059397c AP_NavEKF2: Add missing @RebootRequired: True 2017-05-27 01:55:55 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas
38b19b9eee AP_NavEKF2: 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
Dr.-Ing. Amilcar Do Carmo Lucas
ce37517268 AP_NavEKF2: Improve comments, typos 2017-05-03 08:44:49 +09:00
priseborough
2d4eee0cce AP_NavEKF2: documentation update 2017-05-01 14:24:55 +10:00
Andrew Tridgell
2de8777669 AP_NavEKF2: 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
priseborough
e48f46c98b AP_NavEKF2: Add monitoring of average EKF time step 2017-04-29 11:03:44 +10:00
priseborough
082f429da3 AP_NavEKF2: Fix solution validity reporting bug
Fixes bug that causes relative position status to report as false when using optical flow and using range finder as the primary height sensor.
2017-04-28 17:19:23 +01:00
Andrew Tridgell
ee5c032f27 AP_NavEKF2: added recording of timing statistics 2017-04-28 17:19:39 +10:00
priseborough
596b20eb07 AP_NavEKF2: close perf counter when doing early return 2017-04-27 20:14:21 +10:00
priseborough
88469ce80c AP_NavEKF2: Reset covariance if bad mag fusion update 2017-04-27 20:14:21 +10:00
Andrew Tridgell
d799bacd7d AP_NavEKF2: fixed reset of coviariance matrix 2017-04-27 18:33:25 +10:00
Randy Mackay
b255c7b370 AP_NavEKF: add setOrigin 2017-04-22 10:37:31 +09:00