Commit Graph

391 Commits

Author SHA1 Message Date
Andrew Tridgell e8017a5079 AP_NavEKF: cope with the changed semantics of airspeed.use() 2015-01-20 11:28:14 +11:00
priseborough c40c3632bb AP_NavEKF: Critical Bug Fix
Prevents possible loss of attitude reference for flights without optical flow and GPS.

The optical flow measurement timeout can reset the velocity states which decouples the position states from IMU errors and therefore significantly reduces the amount of attitude error correction.
2015-01-13 16:05:31 +13:00
Andrew Tridgell ef5cdb0d6c AP_NavEKF: use more array bounds checked variables 2015-01-09 11:05:07 +11:00
priseborough 3d46680348 AP_NavEKF: Make NED origin independent of home position
This enables the filter to report the last known position after disarm.
The LLH location of the filters NED origin is published and should be logged every time the vehicle is armed to assist with post-flight trajectory reconstruction.
The LLH location of the filters NED origin can be set externally whilst the vehicle is disarmed.
2015-01-09 10:51:24 +11:00
priseborough f0ea858e4c AP_NavEKF: Make LLH output report last known position in const pos mode 2015-01-09 10:51:24 +11:00
priseborough a0957a83f8 AP_NavEKF: Fix bug in reported position and velocity
The last known position was being output on the velocities when in constant position mode.
2015-01-09 10:51:24 +11:00
priseborough 7d1cd604a8 AP_NavEKF: Report last known position when GPS is lost 2015-01-09 10:51:24 +11:00
priseborough 1789dc08a3 AP_NavEKF: Correctly report position timeout when GPS is lost 2015-01-09 10:51:24 +11:00
Randy Mackay e6e6a781c1 AP_NavEKF: init filter status bits to zero 2015-01-09 10:51:23 +11:00
priseborough ffd9f7a4ed AP_NavEKF: Predict filter solution status 2015-01-09 10:51:23 +11:00
Randy Mackay 657afcfe7a AP_NavEKF: add pred_horiz_pos flags to filter status 2015-01-09 10:51:23 +11:00
Randy Mackay f4d8bc586c Nav_EKF: getFilterStatus returns nav_filter_status struct 2015-01-09 10:51:23 +11:00
Randy Mackay 8a914af4a8 AP_NavEKF: add nav_filter_status definition 2015-01-09 10:51:23 +11:00
priseborough d57e0b6bde AP_NavEKF: Remove compiler warning messages 2015-01-09 10:51:23 +11:00
priseborough a4ba4d1000 AP_NavEKF: Fix bug in optical flow innovation variances
Also improves protection against badly conditioned variances
2015-01-09 10:51:23 +11:00
priseborough 8bc8d1444a AP_NavEKF: Extend definition of GPS availability to include user inhibit 2015-01-09 10:51:22 +11:00
priseborough d0d49065e7 AP_NavEKF: Prevent potential repeated use of optical flow data 2015-01-09 10:51:22 +11:00
priseborough b0c703e4f7 AP_NavEKF: Fix bug in optical flow fusion control logic 2015-01-09 10:51:22 +11:00
priseborough d656c94bbc AP_NavEKF: Fix out of bounds index bug 2015-01-09 10:51:22 +11:00
priseborough 300ba65f64 AP_NavEKF: Remove duplicate flow measurement state correction 2015-01-09 10:51:22 +11:00
priseborough 92bb75a635 AP_NavEKF: Prevent load leveling from dropping flow measurements 2015-01-09 10:51:22 +11:00
priseborough 2f5aa210ce AP_NavEKF: Enable recovery from extended flow measurement rejection 2015-01-09 10:51:21 +11:00
priseborough 9f4baaa865 AP_NavEKF: Update flow debug logging 2015-01-09 10:51:21 +11:00
priseborough 8d1dae3ac1 AP_NavEKF: Improve optical flow terrain height estimation
The two state auxiliary EKF has been replaced with a single state filter that only estimates terrain offset. The new filter fuses a optical flow line of sight rate scalar (length of the optical flow LOS rate vector) which provides a terrain offset estimate that is less affected by yaw errors.
Estimation of focal length scale factor error in flight wasn't accurate enough and will be replaced with a pre-flight intrinsic sensor calibration procedure as the scale factor error does not change over time provided the lens assembly is not adjusted.

AP_NavEKF: Remove unwanted printf
2015-01-09 10:51:21 +11:00
priseborough d599fa588e AP_NavEKF: Don't allow EKF to initialise without GPS lock if we are a plane
This is needed because planes arm automatically.

AP_NavEKF: Fix bug in GPS patch
2015-01-09 10:51:21 +11:00
priseborough 2f0b1b3d9c AP_NavEKF: Fix bug preventing use of optical flow without GPS 2015-01-03 21:49:22 +11:00
Andrew Tridgell 16affe51be AP_NavEKF: avoid an extra quaternion copy 2015-01-03 15:44:07 +11:00
priseborough 69e86d3ea4 AP_NavEKF: Update EKF optical flow data logging 2015-01-03 14:09:12 +11:00
priseborough b651eac48d AP_NavEKF: Apply timeout to terrain offset validity reporting
The terrain offset solution status is usable for a short period of time without state updates so a timeout has been added which prevents the rapid changes in solution status due to short duration sensor read errors.
2015-01-03 14:09:09 +11:00
priseborough e6474d676e AP_NavEKF: Report correct horiz vel sol'n status during optical flow nav 2015-01-03 14:09:05 +11:00
priseborough 75201c8968 AP_NavEKF: Prevent divide by zero casued by Tnb_flow.c.z = 0 2015-01-03 14:07:13 +11:00
priseborough 8d3940ce1b AP_NavEKF: Improved use of enumerated type for aiding mode 2015-01-02 12:10:41 +09:00
priseborough 76d1378962 AP_NavEKF: Fix compiler warning messages 2015-01-01 23:39:48 +11:00
priseborough 3e3dd9d695 AP_NavEKF: Fix parenthesis error in EKF status reporting and clean up logic
This fixes a bug which could have caused the realative position status to be incorrectly reported under some conditions and also caused a compiler warning message. the logic used to report the filter solution status has been broken down into smaller, easier to understand statements.
2015-01-01 23:39:48 +11:00
priseborough c06f6e105e AP_NavEKF: Consistent initialisation of tuning parameters and variables
Non user adjustable parameters are now declared as 'const' in the header.
The _ prefix has been removed from non user adjustable tuning parameters.
We use a function call rather than a constructor to initialise variables because it enables the filter to be re-started in flight if necessary.
For consistency some signed integer type declarations have been changed to unsigned where appropriate.
2015-01-01 23:39:31 +11:00
priseborough f1dfa282dc AP_NavEKF: Consolidate constant velocity mode decision logic
The decision to switch to constant velocity mode during optical flow operation and te decision to switch back were previously being made in two different places in code. Both decisions are now made in the one place which makes the code easier to follow and maintain.
2015-01-01 19:53:21 +11:00
priseborough 9caf2ac895 AP_NavEKF: Make reversion to no GPS mode unambiguous 2015-01-01 19:53:21 +11:00
priseborough 58e9dd5dcd AP_NavEKF: Enumerate Position and Velocity aiding status 2015-01-01 19:53:21 +11:00
priseborough b016bae445 AP_NavEKF: Clean up reset of constant velocity mode
Move velocity store out of optical flow to velocity and position fusion control as it is a velocity fusion function.
Always clear the previous mode status
2014-12-31 13:16:16 +09:00
priseborough 3d207c316a AP_NavEKF: Change names for position and velocity hold modes
Name change done to avoid confusion with flight modes. modes are now referred to as constant position and constant velocity mode.
2014-12-31 13:16:15 +09:00
priseborough b650ee51a9 AP_NavEKF: Consolidate arming checks 2014-12-31 13:16:15 +09:00
priseborough 48cae0df15 AP_NavEKF: Fall back to attitude and hgt estimation for copter if GPS lost 2014-12-31 13:16:14 +09:00
priseborough b21f9daa90 AP_NavEKF: Update solution status reporting
This patch makes the reporting of an absolute position solution less abbiguaous and ensures that relative position is always true if absolute position is true
2014-12-31 13:16:13 +09:00
priseborough b6d300db19 AP_NavEKF: clean up determination of GPS availability 2014-12-31 13:14:22 +09:00
priseborough 40b02fc19a AP_NavEKF: Ensure filter doesn't try to use GPS after initialisation 2014-12-31 13:14:20 +09:00
priseborough bab1a69f1c AP_NavEKF: make position and velocity resets consistent with GPS usage 2014-12-31 13:14:18 +09:00
priseborough 0dc2356175 AP_NavEKF: Ensure initialisation methods read required sensor data 2014-12-31 13:14:16 +09:00
priseborough 5d1de79f08 AP_NavEKF: Modify initial values to make startup behaviour more consistent 2014-12-31 13:14:14 +09:00
priseborough a63af34d8f AP_NavEKF: Allow 10 seconds for the filter to settle after initialisation
Filter is declared unhealthy and will not arm for first 10 seconds after initialisation
2014-12-31 13:14:12 +09:00
priseborough 0a5de21dc7 AP_NavEKF: Fix bug in reporting of solution status
Because synthetic  position measurements at 0,0 are fused during position hold mode, a position timeout cannot be used as the only means of detecting position solution status.
2014-12-31 13:14:09 +09:00