Commit Graph

55 Commits

Author SHA1 Message Date
Paul Riseborough
5d2f78996a AP_NavEKF2: Remove un-used data in IMU buffer
Recovers 416 Bytes of memory per EKF2 instance for Copter
2015-11-09 22:07:10 +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
Paul Riseborough
04165a60a7 AP_NavEKF2: Reduce false positive on EKF health check
Apply filtering to baro innovation check and and don't apply innovation checks once aiding has commenced because GPS and baro disturbances on the ground and during launch could generate a false positive
2015-11-08 15:37:27 +11:00
Paul Riseborough
49f9ea317c AP_NavEKF: Update console message and param descriptions for multiple EKF's 2015-11-08 15:37:26 +11:00
Paul Riseborough
2340e18fdc AP_NavEKF2: Offset the fusion time horizon between multiple instances
Prevents frame over-runs due to simultaneous fusion of measurements on each instance.
The offset is only applied if less than 5msec available between frames
2015-11-08 15:37:26 +11:00
Paul Riseborough
3eeff8dbc6 AP_NavEKF2: Remove unused code
This method of correcting for the fusion time horizon delay was too computationally expensive for our application and did not smooth fusion noise.
2015-11-08 15:37:26 +11:00
Paul Riseborough
d48454ee2d AP_NavEKF2: Use nominated IMU unless unavailable
We now run a separate instance of the EKF for each IMU, so input data fusion of IMU's is no longer required.
2015-11-08 15:37:26 +11:00
Andrew Tridgell
2ab2afc86a AP_NavEKF2: added EK2_IMU_MASK for multiple IMUs
no voting between multiple IMUs yet
2015-11-06 10:42:58 +11:00
Paul Riseborough
7bd61a484c AP_NavEKF2: Faster initial accel bias learning 2015-11-02 14:12:16 +11:00
Paul Riseborough
f539b597a3 AP_NavEKF2: Improve initialisation of magnetic field learning
Use the more robust, but less accurate compass heading fusion up to 5m altitude
Wait for the magnetometer data fusion time offset to be correct before using data to reset states
Don't reset magnetic field states if the vehicle is rotating rapidly as timing offsets will produce large errors
When doing the yaw angle reset, apply the reset increment to all quaternions stored in the output buffer to avoid transients produced by yaw rotations and the 0.25 second fusion time horizon offset.
Only do the one yaw and mag reset at 5m, not two at 1.5 and 5.0m
Always re-do the yaw and mag reset when leaving the ground.
2015-10-30 15:34:20 +09:00
Paul Riseborough
844ed95718 AP_NavEKF2: Add method to rotate output quaternion history 2015-10-30 15:34:17 +09:00
Paul Riseborough
74da4d8e57 AP_NavEKF2: Remove GPS glitch offset logic
Correction for steps in position and velocity caused by resets following GPS glitches and other events are now handled by the control loops.
2015-10-30 12:24:04 +09:00
Paul Riseborough
4c5ba60578 AP_NavEKF2: Remove dead code 2015-10-26 08:05:15 +11:00
Paul Riseborough
5eb7cf1fbf AP_NavEKF: Reduce roll/pitch disturbance when magnetic field is reset
Because we have changed the yaw angle and have taken a point sample on the magnetic field, covariances associated with the magnetic field states will be invalid and subsequent innovations could cause an unwanted disturbance in roll and pitch.
The reset of the Euler angles to a new yaw orientation was being done using roll and pitch from the output observer states, not the EKF state vector which meant that when roll and pitch were changing, the reset to a new yaw angle would also cause a roll and pitch disturbance.
2015-10-23 19:04:30 +11:00
Paul Riseborough
e6312d91ce AP_NavEKF2: Correct variable name 2015-10-21 17:27:00 +11:00
Paul Riseborough
cd8b9c7d26 AP_NavEKF: prevent high rate mag data locking out other data fusion 2015-10-20 20:16:04 +11:00
Paul Riseborough
ab8c28a7cc AP_NavEKF: Fix bug allowing takeoff in GPS modes without aiding
The legacy EKF switches GPs aiding on on arming, whereas the new EKF switches it on based on GPS data quality.
This means the decision to arm and therefore the predicted solution flags must now reflect the actual status of the navigation solution as it will no longer change when motor arming occurs.
2015-10-20 20:16:00 +11:00
Andrew Tridgell
cb0f7cb370 NavEKF2: use new perf counter API 2015-10-20 18:16:15 +11:00
Andrew Tridgell
d1dfd5fd01 AP_NavEKF2: use common header for optimisation level and irq disable 2015-10-20 15:21:40 +11:00
Andrew Tridgell
b6c1352e4c AP_NavEKF2: added 10 test perf counters
used for fine grained performance tuning
2015-10-20 15:21:40 +11:00
Paul Riseborough
2fbd050418 AP_NavEKF2: Use blended accelerometer data
If high vibration levels cause offsets between the two, it switches to the accelerometer with lower vibration levels. The default behaviour is to use the average of both accelerometers.
2015-10-20 15:21:40 +11:00
Paul Riseborough
2b13020c19 AP_NavEKF2: Fix bug in vertical position derivative calculation 2015-10-20 15:21:39 +11:00
Paul Riseborough
f6ad79688e AP_NavEKF2: Update start sequence console messages 2015-10-20 15:21:39 +11:00
Paul Riseborough
8526a8ba7e AP_NavEKF2: Level processor loading between frames
Don't fuse other measurements on the same frame that magnetometer measurements arrive if running at a high frame rate as there will be insufficient time to complete other operations.
2015-10-20 15:21:39 +11:00
Paul Riseborough
225b81baf4 AP_NavEKF2: Prevent users breaking filter by setting excessive time delays
If time deelays greater than the IMU buffer length are used, then it is possible for measurements to be dropped.
2015-10-20 15:21:39 +11:00
Paul Riseborough
1b8a93ef0c AP_NavEKF2: Update function header comments 2015-10-20 15:21:38 +11:00
Paul Riseborough
495809f211 AP_NavEKF2: Allow magnetic field learning to be faster 2015-10-20 15:21:38 +11:00
Paul Riseborough
52fd369b2f AP_NavEKF2: Add methods to output and calculate vertical position derivative
This patch calculates a derivative of the vertical position (positive down).
The derivative is exposed via a public function.
2015-10-20 15:21:35 +11:00
Andrew Tridgell
2ae0811458 AP_NavEK2: fixed perf counter names for EKF2 2015-10-20 14:36:49 +11:00
Randy Mackay
35769035d4 AP_NavEKF2: resolve compiler warning related to init order 2015-10-15 20:03:05 +09:00
Paul Riseborough
0c61e09b70 AP_NavEKF2: Critical big fix - states not initialised
The failure to initialise the magnetometer bias states to zero can result in a large jump in yaw gyro bias and heading when a heading reset is performed.
2015-10-15 09:52:55 +11:00
Paul Riseborough
e3013b493b AP_NavEKF2: Critical bug fix - perf counter not initialised 2015-10-15 09:48:13 +11:00
Paul Riseborough
20a3f9782e AP_NavEKF2: Add full set of selectable pre-flight GPS checks 2015-10-10 21:22:53 +09:00
Paul Riseborough
22920aafad AP_NavEKF2: Improve GPS status reporting 2015-10-10 14:48:59 +09:00
Paul Riseborough
1cb2220107 AP_NavEKF2: Critical Bugfix 2015-10-10 14:48:54 +09:00
Siddharth Bharat Purohit
1ce3276d74 AP_NavEKF2: split EKF control and output get functions from state specific libs 2015-10-10 14:48:48 +09:00
Siddharth Bharat Purohit
290ea0e1e8 AP_NavEKF2: split up EKF_core into different files 2015-10-10 14:48:44 +09:00
Paul Riseborough
cde140354a AP_NavEKF2: Clean up control logic 2015-10-05 13:35:32 +09:00
Paul Riseborough
f4db78fc11 AP_NavEKF2: Allow for larger gyro bias errors
MPU6000 data sheet indicates that variation on gyro ZRO across temperature range from -40 to +85 is +-20 deg/sec.
The limits on the gyro bias states have been increased to allow for this.
To enable the EKF to accommodate such large gyro bias values in yaw without the yaw error wrapping, leading to continual heading drift, an unwrap function has been applied to the compass heading error.
2015-10-05 13:35:29 +09:00
Paul Riseborough
325f4139fe AP_NavEKF2: Clean up mode change logic 2015-10-05 13:35:26 +09:00
Paul Riseborough
ef624199f9 AP_NavEKF2: Enable GPS velocity fusion to be inhibited 2015-10-05 13:35:23 +09:00
Paul Riseborough
53e58f1075 AP_NavEKF2: Update default parameters
Updates from preliminary tuning in Replay
2015-09-25 19:22:56 +10:00
Paul Riseborough
2fb72b6e6a AP_NavEKF2: Clean up loss of GPS logic 2015-09-25 19:20:52 +10:00
Paul Riseborough
df0eb9d9d7 AP_NavEKF2: Don't run GPS checks when not required 2015-09-25 19:20:52 +10:00
Paul Riseborough
1986af021f AP_NavEKF2: Remove un-used flight mode and duplicate variable 2015-09-25 19:20:52 +10:00
Paul Riseborough
8bcedb228b AP_NavEKF2: Bring pre-flight GPS checks up to date with EKF1 2015-09-25 19:20:52 +10:00
Randy Mackay
015f700bc0 AP_NavEKF2: getLastYawResetAngle returns last reset time 2015-09-24 16:57:38 +09:00
Paul Riseborough
80e182f827 AP_NavEKF2: Update EKF2 data logging 2015-09-24 12:58:44 +10:00
Paul Riseborough
4acd6c129a AP_NavEKF2: Update parameters 2015-09-24 12:58:43 +10:00
Paul Riseborough
9c5e48e7e9 AP_NavEKF2: Remove unused variables and improve variable names 2015-09-24 12:58:43 +10:00