Commit Graph

424 Commits

Author SHA1 Message Date
Andrew Tridgell 3289d38339 AP_NavEKF: make the init functions return bool
we need to know if it has initialised successfully
2015-03-28 10:51:38 -07:00
Andrew Tridgell de3f461a55 AP_NavEKF: use compass->last_update_usec() 2015-03-14 12:31:39 +11:00
Randy Mackay 230ca583d1 NavEKF: support sending EKF_STATUS_REPORT 2015-03-12 12:20:00 +09:00
Paul Riseborough 9f552eaa4b AP_NavEKF: Fix bug that resets position to origin when vehicle arms 2015-02-12 12:40:55 +11:00
Paul Riseborough b8d3da3846 AP_NavEKF: Report last known position when vehicle is disarmed 2015-02-12 12:40:55 +11:00
Andrew Tridgell 55041c7a7a AP_NavEKF: prevent division by zero in SmallEKF 2015-02-12 09:02:59 +11:00
Jonathan Challinger 50466848f7 AP_NavEKF: use hal.util soft_armed state 2015-02-11 20:25:11 +11:00
Grant Morphett 4860c84dff AP_NavEKF: Changes to fix the warnings in rover sitl build.
We are starting the process of resolving all the warnings in the
ardupilot builds of all vehicles and platforms.
2015-02-11 18:16:46 +11:00
Paul Riseborough aa94ff629d AP_NavEKF: Prevent bad GPS pre-arming casuing initial position errors
If the vehicle moves significantly or the GPS changes position significantly pre-armed, then the GPS glitch logic was being invoked when the first GPs measurements were fused. This patch resets the position to the GPS when the vehicle arms.
2015-02-03 15:57:10 +09:00
priseborough bc5581d634 AP_NavEKF: Prevent arming delays from failing GPS
Due to the way that gyro calibration is done, the EKF could be effectively not run for up to 30 seconds in extreme cases, making it possible that the GPS would be failed on arming and the copter put into a non-GPS mode.

the longer term solution is to update the gyro calibration so that it does not hold up other processing. the short tyermfix in thsi patch is to look for evidence of a 3D lock in the last received GPS message.
2015-02-03 15:57:09 +09:00
priseborough 2c012c2763 AP_NavEKF: Always check for new GPS data
This fixes a bug that meant that once the EKF had started up in a non-GPS mode, it would no longer read the GPS and therefore would never be able to use GPS again until reset.
2015-02-03 15:57:08 +09:00
Paul Riseborough 925d625ed1 AP_NavEKF: fix bug in small EKF velocity fusion 2015-02-03 09:49:17 +11:00
Paul Riseborough 5f24603ceb AP_NavEKF: Publish small EKF quaternion and gyro bias outputs 2015-02-03 09:49:16 +11:00
Andrew Tridgell 4c8b663200 AP_NavEKF: added initial version of SmallEKF
This will be used for gimbal bias estimations. 

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2015-02-03 09:49:16 +11:00
Andrew Tridgell 850af14949 AP_NavEKF: raise EKF_POS_GATE and EKF_GLITCH_RAD for planes
This weights GPS position more heavily for planes

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2015-01-31 21:49:20 +11:00
priseborough 5df733a883 AP_NavEKF: Allow flight transition to optical flow mode if GPS is lost 2015-01-22 14:41:04 +09:00
priseborough 04810c012d AP_NavEKF: Increase flow data valid timeout to handle arming delays
When Copter arms, the AHRS/EKF may not be run for a few hundred msec depending on conditions. This can cause the arming check to fail the optical flow sensor and place the EKF in a constant position mode.
2015-01-22 14:41:01 +09:00
priseborough 073b8e7c43 AP_NavEKF: Always explicitly set required const pos or vel mode when arming
This additional explicit setting of the constPosMode and constVelMode reduces the likelihood of logic errors being introduced in the future as it places the intended setting of these parameters at arming in the one place. the constVelmode and constPosMode only have one set of conditions each that can trigger these modes in flight, so if these modes are true after arming it will be clear that it was the in-flight condition that triggered.
2015-01-22 14:40:59 +09:00
priseborough 9c6dabe1cc AP_NavEKF: Add separate flow default parameters for platform types
Also reduces flow measurement noise default for copter only and increases gate to compensate.
2015-01-22 14:40:57 +09:00
priseborough d2da16e652 AP_NavEKF: Consistently set timeout flags whenever aiding is inhibited
This ensures the position and velocity measurement status will be set as timed out immediately after use of those measurements is inhibited. This will improve the timeliness of filter status reporting.
2015-01-22 14:40:55 +09:00
priseborough 824425625c AP_NavEKF: Update public method used to inhibit GPS use
This method is not currently used by any of our vehicle types, but will be required to enable a user selectable 'indoor mode'.
2015-01-22 14:40:52 +09:00
priseborough 1033f5fc1e AP_NavEKF: Apply flow nav vehicle limits regardless of sensor health
It does not make sense to relax the limits on vehicle speed and nav gains just because we have received some invalid flow data. This could make the situation worse if the invalid data was being caused by too much speed.
If we are relying on flow data the vehicle limits should always be applied.
2015-01-22 14:40:50 +09:00
priseborough 14b51f6d74 AP_NavEKF: Unconditionally fuse velocity in constant velocity mode
The zero velocity measurements in this mode are by definition always correct and should never be rejected
2015-01-22 14:40:48 +09:00
priseborough 6663d80176 AP_NavEKF: Simplify nested logic - functionally equivalent
Additional if else statement was unnecessary
2015-01-22 14:40:45 +09:00
priseborough 12c3368c4d AP_NavEKF: Bypass GPS glitch logic when not aiding
When we are not using GPS measurements, we should not be allowing the GPS glitch logic to reset position states as this can interfere with operation of non GPS modes.
2015-01-22 14:40:43 +09:00
priseborough 5c8e71a8d1 AP_NavEKF: Don't reset the position measurement timeout if not aiding
When PV aiding is disabled, then the timeout time reference should not be reset becasue we want the position measurement timeout status to remain true the whole time the measurement is not being used.
2015-01-22 14:40:41 +09:00
priseborough c505a458de AP_NavEKF: Always declare a position measurement timeout if aiding not used
If position and velocity aiding is turned off, then the position measurement should always be reported as timed out.
2015-01-22 14:40:39 +09:00
priseborough 3b166372cc AP_NavEKF: Always declare a velocity measurement timeout if velocity not used
If position and velocity aiding is turned off, then the velocity measurement should always be reported as timed out.
2015-01-22 14:40:36 +09:00
priseborough 95c3197170 AP_NavEKF: Ensure velocity will not be reset unless needed for aiding 2015-01-22 14:40:34 +09:00
priseborough 8aeec82846 AP_NavEKF: Continually turn off aiding whilst the vehicle is disarmed
This prevents the possibility of any logic errors turning aiding back on.

AP_NavEKF: Fix bug in logic
2015-01-22 14:40:31 +09:00
priseborough 81ee339e25 AP_NavEKF: Synchronise non-aiding mode state corrections
Synchronise with covariance prediction to improve numerical stability and accuracy of angle corrections. The 'noise' this produces in the position and velocity estimate is irrelevantbecause these are not used by the control loops during this mode of operation (they are nominally zero anyway).
2015-01-22 14:40:29 +09:00
priseborough ae6b85e63d AP_NavEKF: Explicitly set aiding to off when disarmed
This fixes a bug that could cause the AHRS to drift whilst the vehicle was disarmed depending sensor combinations at startup.
2015-01-22 14:40:27 +09:00
priseborough fb1962b111 AP_NavEKF: Let reported position whilst disarmed show inertial errors
Showing the positon states (which are nominally zero) in addition to the last known offset can provide useful log information.
2015-01-22 14:40:25 +09:00
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