Randy Mackay
a9cbd5aa29
AP_NavEKF2: getDataEKFGSF and getYawData pass by reference
2020-04-24 09:43:23 +10:00
Randy Mackay
d61c517e76
AP_NavEKF2: minor format fix
2020-04-24 09:43:23 +10:00
Randy Mackay
91ef87064a
AP_NavEKF2: rename GSF_RUN_MASK, GSF_USE_MASK, GSF_RST_MAX
2020-04-24 09:43:23 +10:00
Paul Riseborough
abc821ad36
AP_NavEKF2: Split GSF yaw estimator processing
...
Separate prediction and correction steps are required to provide an up to date yaw estimate using IMU prediction before it may be required by SelectMagFusion() whilst still doing the velocity update after GPS data haw been pulled from the buffer by SelectVelPosFusion()
2020-04-24 09:43:23 +10:00
Andrew Tridgell
c83e2d7c0e
AP_NavEKF2: fixed loss of GPS fusion
...
we must not do a storedGPS.recall unless we will be using the data,
otherwise we will lose GPS samples and risk stopping GPS fusion
2020-04-24 09:43:23 +10:00
Andrew Tridgell
6c3889b04f
AP_NavEKF2: fixed typos
2020-04-24 09:43:23 +10:00
Andrew Tridgell
3edbe81b1e
AP_NavEKF2: removed 2nd set of imuSampleTime_ms
2020-04-24 09:43:23 +10:00
Paul Riseborough
6952d83f00
AP_NavEKF2: Fix casting build error
2020-04-24 09:43:23 +10:00
Paul Riseborough
0d965d2a1c
AP_NavEKF2: Fix timer wrapping bugs
...
Also replaces tab characters
2020-04-24 09:43:23 +10:00
Paul Riseborough
de0040ad69
AP_NavEKF2: Enable use of EKF-GSF yaw estimate
...
Enables the yaw to be reset in flight to a value estimated from a specialised yaw estimator. This allows faster recovery if taking off with a bad magnetometer and also allows yaw alignment and GPS use to commence in-air when operating without any yaw sensing.
AP_NavEKF2: Add missing accesor functions for default airspeed
2020-04-24 09:43:23 +10:00
Randy Mackay
35dcb0d752
AP_NavEKF2: CorrectExtNavForSensorOffset made const
2020-04-21 10:21:23 +10:00
Randy Mackay
85704e4989
AP_NavEKF2: CorrectGPSForAntennaOffset made const
...
also reduce scope of call to slightly reduce CPU load
2020-04-21 10:21:23 +10:00
Peter Barker
f1fc05d357
AP_NavEKF2: rename APMrover2 to Rover
2020-04-14 09:50:34 +09:00
Randy Mackay
8749f30c64
AP_NavEKF2: external nav pos offsets from AP_VisualOdom library
2020-04-14 10:28:03 +10:00
Randy Mackay
fb7e68c53a
AP_NavEKF2: writeExtNavData reset handles system time wrap
2020-04-14 10:28:03 +10:00
Randy Mackay
9f81da1bf9
AP_NavEKF2: minor comment fix
2020-04-13 14:39:53 +09:00
Andrew Tridgell
c9755cf9e6
AP_NavEKF2: make mag variance reporting consistent
...
logged scaled variance should match the value used in MAVLink
EKF_STATUS_REPORT
2020-04-06 17:30:29 +10:00
Peter Barker
903d81c263
AP_NavEKF2: use compass reference rather than repeatedly asking AHRS for it
2020-03-13 08:26:18 +11:00
Andrew Tridgell
9030590a88
AP_NavEKF2: fixed use of antenna position when switching GPS primary
...
when GPS primary switches we were using a position which had not been
corrected for antenna offset. This was used for calculating the reset
for sensor change.
This fixes that (trivial fix) and also fixes a similar issue on
position reset
2020-02-19 18:12:54 +11:00
Siddharth Purohit
4cca1c307c
AP_NavEKF2: Primary compass is always at serial number 0
2020-02-19 13:59:53 +09:00
Peter Hall
e0eeb4f863
AP_NavEKF2: add initalized flag and change to uint32_t
2020-02-19 06:45:07 +11:00
chobits
a54f24c8c0
AP_NavEKF2: switch to optflow if gps is jammed
2020-02-04 10:13:57 +09:00
Peter Barker
da3d3cc21b
AP_NavEKF: stop taking ahrs in constructor
2020-01-21 11:53:18 +11:00
Peter Hall
2970334c0d
AP_NavEKF2: get_time_flying in vehicle
2020-01-14 22:34:37 -07:00
Peter Barker
524647d221
AP_NavEKF2: use instance number when logging rather than multiple message IDs
2019-12-17 12:22:07 +11:00
Peter Barker
060c851709
AP_NavEKF2: make send_status_report const
2019-12-11 07:54:41 +09:00
Peter Barker
369292f7f3
AP_NavEKF2: stop relying on the presence of a RangeFinder
2019-12-11 08:09:01 +11:00
Peter Barker
239df941e5
AP_NavEKF2: use instance # when logging EKF core timings
2019-12-06 12:52:03 +09:00
Andrew Tridgell
fce4d6952f
AP_NavEKF2: don't use WMM tables unless we have a compass scale factor set
2019-12-03 20:48:23 +11:00
Mark Whitehorn
5f6b3a1f5b
AP_NavEKF2: clean up init failure handling
...
only attempt to allocate memory once
2019-11-26 11:59:10 +11:00
Peter Barker
99689f65f8
AP_NavEKF2: adjust for renaming of RangeFinder files
2019-11-12 07:14:37 +08:00
Peter Barker
9735684184
AP_NavEKF2: use enum-class for RangeFinder Status
2019-11-09 08:01:53 +11:00
Mark Whitehorn
23ee9eef5f
AP_NavEKF2: fail prearm on any core setup failure
2019-11-05 11:23:54 +11:00
Mark Whitehorn
489ae83604
AP_NavEKF2: handle core setup failures
2019-11-05 11:23:54 +11:00
Mark Whitehorn
7c6630e216
AP_NavEKF2: EKF2 prefix for prearm failures and camelCase
2019-11-05 11:23:54 +11:00
Mark Whitehorn
95ea6ad807
AP_NavEKF2: provide reasons for init failures
2019-11-05 11:23:54 +11:00
Randy Mackay
cc5facf6d2
AP_NavEKF2: initialise pre-arm failure message
2019-10-31 09:51:27 +08:00
Mark Whitehorn
6e73feca5c
AP_NavEKF2: add prearm failure message for null core pointer
2019-10-29 11:59:29 +08:00
Randy Mackay
e32a8556b2
AP_NavEKF2: suppress ekf fail-to-set-origin if core disabled
2019-10-22 07:15:48 +08:00
Randy Mackay
e2d3afaaa7
AP_NavEKF2: reduce EK2_HRT_FILT max to 30
2019-10-18 11:15:25 +09:00
Paul Riseborough
c26c6fd078
AP_NavEKF2: Add missing vertical position derivative calculation
...
Use a third order order complementary filter to estimate the rate of change of vertical position output.
2019-10-18 11:15:25 +09:00
Andrew Tridgell
cbe34320b5
AP_NavEKF2: fixed build
...
broken by recent common variable change
2019-10-01 17:35:26 +10:00
Andrew Tridgell
f7e138bddd
AP_NavEKF2: use parent class for intermediate static variables
...
this makes the code faster as well as using less memory when both EK2
and EK3 are enabled
2019-10-01 15:39:03 +10:00
Andrew Tridgell
8dd2119b14
AP_NavEKF2: make it easy to do EK2 timing tests
...
for future benchmarking
2019-09-28 08:57:26 +10:00
Andrew Tridgell
163efd0df5
AP_NavEKF2: change optimisation from -O3 to -O2
2019-09-28 08:57:26 +10:00
Peter Barker
952d4d2cbc
AP_NavEKF2: initialise Kfusion stack variable to fix compilation
...
This fixes the compilation, as previous patches have done.
2019-09-25 12:54:55 +10:00
Andrew Tridgell
d40d812ea4
AP_NavEKF2: fixed build with g++ 9.1
...
this is a false positive, but the cost of clearing this array is low,
and it saves a much more complex fix
2019-09-24 14:59:17 +10:00
Andrew Tridgell
9226899c6f
AP_NavEKF2: added comment (review request)
2019-09-24 12:51:54 +10:00
Andrew Tridgell
255981c60c
AP_NavEKF2: moved some of the intermediate vars to the stack
...
this keeps stack frames below 1k, while giving faster access to the
variables and saving more memory
2019-09-24 12:51:54 +10:00
Andrew Tridgell
96c6544997
AP_NavEKF3: moved intermediate variables to common memory
...
this moves intermediate variables from being per-core to being common
between cores. This saves memory on systems with more than one core by
avoiding allocating this memory on every core.
This is an alternative to #11717 which moves memory onto the stack. It
doesn't save as much memory as #11717 , but avoids creating large stack
frames
2019-09-24 12:51:54 +10:00
Andrew Tridgell
0041874826
AP_NavEKF2: moved intermediate variables to common memory
...
this moves intermediate variables from being per-core to being common
between cores. This saves memory on systems with more than one core by
avoiding allocating this memory on every core.
This is an alternative to #11717 which moves memory onto the stack. It
doesn't save as much memory as #11717 , but avoids creating large stack
frames
2019-09-24 12:51:54 +10:00
Andrew Tridgell
1d47f9186e
AP_NavEKF2: fixed use of old irqsave() API
2019-09-21 15:36:47 +10:00
Peter Barker
3619856fc9
AP_NavEKF2: correct return of empty prearm string
2019-09-19 08:47:47 +09:00
Randy Mackay
94a52b3525
EKF2: RNG_USE_HGT param only used when ALT_SOURCE = rangefinder
2019-09-10 18:44:52 +10:00
Michael du Breuil
a4d10b2e86
AP_NavEKF2: Allow the GPS to be responsible for logging
2019-09-10 09:09:17 +10:00
Peter Barker
c8fac758ee
AP_NavEKF2: use timing logging from AP_NavEKF
2019-09-03 09:28:37 +10:00
Andrew Tridgell
414d3eb670
AP_NavEKF2: don't fuse GPS when EK2_GPS_TYPE=3
...
when using a vision position system, the user may have vision derived
GPS data coming in using GPS_INPUT msgs. We should not fuse these when
EK2_GPS_TYPE=3 as we end up fusing both vision data and GPS data,
which does not work with the current EK2 code
This change makes it possible to run EK2 and EK3 in parallel in a
Vicon, wityh EK2 using VISION_POSITION_ESTIMATE data and EK3 using
GPS_INPUT (with yaw) data.
2019-08-26 12:27:31 +10:00
hoangthien94
fc9ff2b09a
AP_NavEKF2: add method to check if ext nav is used for yaw
2019-08-03 08:44:11 +09:00
Andrew Tridgell
098701ec79
AP_NavEKF2: fixed baro innovation gate when on ground with AIDING_NONE
...
when on the ground without a position source we would disable the
innovation gate for the barometer. This meant that a single (or small
number of) really bad baro readings would be fused into the EKF,
causing it to destabilise
Fixes #11903
2019-07-30 08:23:21 +10:00
Andrew Tridgell
e7163afe06
AP_NavEKF2: review fixes
...
thanks Paul!
2019-07-29 10:08:22 +10:00
Andrew Tridgell
c57b25b4c9
AP_NavEKF2: ensure that EKF origin stays in sync on all cores
...
this prevents the EKF origin on different cores from being initialised
to different values. A common value is stored in the frontend and used
by a core if it doesn't have an origin
2019-07-29 10:08:22 +10:00
Andrew Tridgell
a01faa2f00
AP_NavEKF2: use origin lat for earth rates
...
home may not yet be set when this code is run, so using home may be
invalid
2019-07-29 10:08:22 +10:00
Andrew Tridgell
742ae0b750
AP_NavEKF2: 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
5db41147ed
AP_NavEKF2: 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
Siddharth Purohit
1527a5b97c
AP_NavEKF2: do logging for 3rd EKF core
2019-07-23 12:34:38 +10:00
Andrew Tridgell
2427440e13
AP_NavEKF2: origin handling fixes from Francisco
2019-07-11 06:40:55 +10:00
Andrew Tridgell
e8d9a1fae9
AP_NavEKF2: don't allow height datum reset when not on ground
2019-07-07 19:20:32 +10:00
Andrew Tridgell
f5fd38aef2
AP_NavEKF2: set terrainState to zero on height datum reset
2019-07-07 19:20:32 +10:00
Andrew Tridgell
9372073f63
AP_NavEKF2: continuously update gpsGoodToAlign
...
use it to determine how to handle a height datum reset
2019-07-07 19:20:32 +10:00
Andrew Tridgell
20ebb2500b
AP_NavEKF2: ensure that both AMSL and relative alt are correct after a reset
...
this forces the EKF origin to the GPS alt on a height datum reset if
we have GPS lock. If we don't do this then the reported AMSL alt will
drift over time away from the GPS alt when we reset while on the
ground
2019-07-07 19:20:32 +10:00
Andrew Tridgell
ddef40fa3d
AP_NavEKF2: don't use disabled gyros in opticalflow takeoff detection
2019-07-07 19:03:01 +10:00
Andrew Tridgell
1c4c5a6850
AP_NavEKF2: learn gyro biases for inactive gyros
...
this allows us to learn the gyro biases each lane would need if it had
to switch to another gyro due to a sensor failure. This prevents a
sudden change in gyro bias on IMU failure
2019-07-07 19:03:01 +10:00
Peter Barker
6a0a466f42
AP_NavEKF2: factor out and logging functions, reuse for 2nd core
2019-07-06 19:05:51 +10:00
Peter Barker
5175d23cc1
AP_NavEKF2: move logging in from AP_Logger
2019-07-06 19:05:51 +10:00
Andrew Tridgell
567c902e75
AP_NavEKF2: 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
Peter Barker
82df167ad4
AP_NavEKF2: use beacon singleton
2019-07-01 07:20:58 +09:00
Michael du Breuil
f04e47fc17
AP_NavEKF2: Reduce scope of AP_Baro.h
2019-06-27 14:56:21 +10:00
Michael du Breuil
892b687c09
AP_NavEKF2: Fix AP_GPS.h include
2019-06-18 10:02:05 +10:00
Andrew Tridgell
3073c4da7a
AP_NavEKF2: 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
df4fc0fff0
AP_NavEKF2: default EK2_MAG_EF_LIM to 50
...
this was supposed to be part of the original PR (agreed with Paul to
enable by default)
2019-06-08 20:24:58 +10:00
Peter Barker
11f31c2851
AP_NavEKF2: take EAS2TAS from AHRS rather than airspeed
2019-06-06 12:44:36 +10:00
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