Commit Graph

112 Commits

Author SHA1 Message Date
Andrew Tridgell b3e6129fd4 AP_AHRS: added EKF type 10 for SITL
this bypasses all attitude and position estimators and uses the SITL
state directly. It can be used for when the SITL backend cannot
provide perfect sensor data
2015-11-22 17:30:28 +11:00
Randy Mackay 4e959ef6f9 AP_AHRS: constify getLastPosNorthEastReset
Also constify getLastVelNortEastReset
2015-10-30 12:24:13 +09:00
Randy Mackay 7c20577ee0 AP_AHRS: constify getLastYawResetAngle 2015-10-30 12:24:10 +09:00
Paul Riseborough f67f6b01f4 AP_AHRS: Publish the EKF position and velocity reset deltas 2015-10-30 12:24:05 +09:00
Caio Marcelo de Oliveira Filho f7c73fbb13 AP_AHRS: remove AHRS_EKF_USE_ALWAYS define
This option now is passed when instantiating the code in ArduCopter, so
selecting the default value at compile time is not necessary anymore.

The motivation is to move vehicle specifc code out of the general
libraries. This patch shouldn't change behavior.
2015-10-21 11:01:11 +11:00
Caio Marcelo de Oliveira Filho 9d2e3157fe AP_AHRS: add a runtime flag for always using EKF
The AHRS_EKF_USE_ALWAYS define is used to force EKF to be always
used. It is defined only for building ArduCopter. Change it to be a
runtime flag. Keep its default value still based on the original define,
once the Copter uses it the define will be removed.

The motivation is to move vehicle specifc code out of the general
libraries. This patch shouldn't change behavior.
2015-10-21 11:01:10 +11:00
Paul Riseborough 0722ebe8a0 AP_AHRS: Add EKF variance checks 2015-10-20 15:21:38 +11:00
Paul Riseborough 58d57994f4 AP_AHRS: Rectify coding errors found during peer review
Fixes code that didn't take into account fall-through behaviour of C++ switch statements
Makes get_rigin furnction more generic allowing the consumer to decide what to do with an invalid origin
2015-10-20 15:21:36 +11:00
Paul Riseborough e65ae51564 AP_AHRS: Enable AP_InertialNav to access all EKF functions via AP_AHRS
This patch adds additional methods to the the AHRS library so that the AP_InertialNav library dow nto have to access the EKF directly. This enables Copter to fly using the EKF nominated by AHRS_EKF_TYPE.
It will also pave the way to elimination of the AP_InertialNav library.
2015-10-20 15:21:36 +11:00
Andrew Tridgell 232fc8a64d AP_AHRS: added send_ekf_status_report() 2015-09-29 10:58:54 +10:00
Randy Mackay 9f59b6f7b5 AP_AHRS: getLastYawResetAngle returns reset time 2015-09-24 16:57:41 +09:00
Andrew Tridgell dde8330077 AP_AHRS: rename using_EKF to active_EKF_type()
thanks to Randy for the suggestion
2015-09-23 17:53:44 +10:00
Andrew Tridgell f9348887c5 AP_AHRS: added getLastYawResetAngle() and resetHeightDatum() 2015-09-23 17:46:51 +10:00
Andrew Tridgell 0677c2c80c AP_AHRS: run astyle for formatting 2015-09-23 17:31:00 +10:00
Andrew Tridgell 13f72e5ba9 AP_AHRS: expose EKF2 for logging 2015-09-23 12:09:36 +10:00
Andrew Tridgell 7ba45444a2 AP_AHRS: added selection of EKF type using AHRS_EKF_TYPE 2015-09-23 11:57:18 +10:00
Andrew Tridgell ed25c85d21 AP_AHRS: added NavEKF2 to constructor 2015-09-23 11:56:42 +10:00
Andrew Tridgell c18c6d894e AP_AHRS: added prearm_failure_reason() 2015-09-08 15:50:22 +10:00
Gustavo Jose de Sousa 54d5277842 AP_AHRS: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:42 +10:00
Andrew Tridgell 04ba5fa0bd AP_AHRS: pass EKF into constructor
this makes it possible for var_info in vehicle code to be in text
segment
2015-06-01 16:16:24 +10:00
Paul Riseborough 7f1749dc1c AP_AHRS: Allow EKF to pull data from range finder object 2015-04-24 10:56:58 +09:00
Paul Riseborough 405862bd8f AP_AHRS: Reduce time delay for EKF initialisation 2015-04-23 20:35:52 +09:00
Randy Mackay c6f71ea2e0 AHRS: make get_error_rp and get_error_yaw const 2015-04-21 22:42:17 +09:00
Paul Riseborough d44cf14178 AP_AHRS : Publish EKF learned compass offsets 2015-04-03 15:24:47 -07:00
Andrew Tridgell 8ba043e593 AP_AHRS: fixed EKF startup bug
This fixes the EKF for when GPS lock takes more than 10 seconds

fixes issue #2010
2015-03-28 10:52:22 -07:00
Randy Mackay 98efcd5f03 AHRS: always use EKF for copter 2015-03-19 15:15:51 +09:00
Andrew Tridgell ee9c778834 AP_AHRS: added a get_NavEKF_const() function
needed for AP_Mount_MAVLink

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2015-02-03 09:49:16 +11:00
Andrew Tridgell 68f64fa11c AP_AHRS: make the healthy() method const 2015-02-01 14:13:52 +11:00
priseborough 5b8265ad6f AP_AHRS: Expand EKF speed limit public method to handle control limits 2014-12-06 18:16:50 +11:00
priseborough 83775554ea AP_AHRS: Publish EKF ground speed limit 2014-12-06 18:16:50 +11:00
priseborough 5532750a99 AP_AHRS: Add public method to inhibit GPS useage when using EKF
This provides the calling vehicle software the abiity to request the EKF to not use GPS.
An integer is returned that indicates the type of operation available:
0 = request rejected (request will only be accepted if the EKF is in static mode, eg pre-armed)
1 = request accepted, attitude, vertical velocity and position estimates available
2 = request accepted, attitude, height rate, height, horizontal velocity and relative position estimates available
2014-12-06 18:16:49 +11:00
priseborough a4984a1e76 AP_AHRS : Add range finder health status to EKF optical flow data 2014-12-06 18:16:44 +11:00
priseborough 12b012a00e AP_AHRS : temporary mods to test use of flow sensor internal gyro data 2014-12-06 18:16:44 +11:00
priseborough 7b76fc29fb AP_AHRS : EKF optical flow fusion support preliminary changes 2014-12-06 18:16:44 +11:00
Jonathan Challinger 9261dfdefb AP_AHRS_NavEKF: overload get_accel_ef and get_accel_ef_blended functions 2014-12-05 19:40:08 +09:00
Randy Mackay dffcfb42bc AHRS: add reset_gyro_drift method 2014-10-28 20:25:33 +09:00
Andrew Tridgell 270bac4472 AP_AHRS: make get_position() const
This allows use from within AP_Mission
2014-10-20 08:36:20 +11:00
Randy Mackay 85eee31510 AHRS: rename ekfNotStarted method to initialised
Also created default implementation in AP_AHRS class so AP_AHRS_DCM does
not need to implement it.
2014-10-02 14:40:54 +09:00
priseborough 7cea7c6a18 AP_AHRS : add method to report if EKF is waiting to start 2014-10-02 14:38:29 +09:00
Andrew Tridgell 28fedba4d8 AP_AHRS: fixed gyro_bias sign, and pre-calculate gyro_estimate for EKF
this allows us to return a constant vector for the corrected gyro
estimate. Based on discussions with Jon Challinger
2014-07-13 21:56:39 +10:00
Andrew Tridgell 1a05c27bbb AP_AHRS: added healthy() function
this will be used to report when the AHRS subsystem becomes unhealthy
2014-05-15 21:14:21 +10:00
Andrew Tridgell c8c6e05a4a AP_AHRS: added vehicle class to AHRS
used by EKF to control use of get_fly_forward()
2014-04-21 18:13:12 +10:00
Andrew Tridgell f07e4dee52 AP_AHRS: convert to new GPS API 2014-04-01 06:38:24 +11:00
Andrew Tridgell 6fc5c12f1d AP_AHRS: remove unused variable 2014-02-26 10:28:12 +11:00
Jonathan Challinger f321a5f241 AP_AHRS: Change airspeed_estimate to const in children of AP_AHRS
Allows roll/pitch controllers to use DCM's airspeed estimate. Thanks to Kevin Hester for assistance in finding this.
2014-02-25 18:49:16 +11:00
Paul Riseborough 9f3c19c03a AP_AHRS : change initialisation requirements for EKF and use dynamic method 2014-02-23 19:50:34 +11:00
Andrew Tridgell fad0b2b233 AP_AHRS: added get_correct_centrifugal()
used by NavEKF to force static mode
2014-02-19 10:28:14 +11:00
Andrew Tridgell ee37bc3d27 AP_AHRS: ensure we have HAL_CPU_CLASS available 2014-02-16 17:57:09 +11:00
Andrew Tridgell be33a9634e AP_AHRS: move using_EKF to .cpp to make it easier in gdb 2014-02-15 09:25:40 +11:00
Andrew Tridgell 25ef0d5a7b AP_AHRS: don't allow get_velocity_NED() and get_relative_position_NED() without EKF
this avoids some linking issues, plus the functions are inaccurate
without EKF
2014-02-15 05:48:24 +11:00
Andrew Tridgell f09ae0c2d0 AP_AHRS: expose get_NavEKF as non-const
better than having two methods
2014-02-15 05:48:22 +11:00
Randy Mackay f068d0ff7e AP_AHRS_NavEKF: expose non-const EKF for tuning 2014-02-15 05:48:20 +11:00
Randy Mackay 9f130b40a0 AP_AHRS_NavEKF: override set_correct_centrifugal 2014-02-15 05:48:20 +11:00
Andrew Tridgell a74fcc5a93 AP_AHRS: added set_ekf_use() 2014-02-15 05:48:17 +11:00
Andrew Tridgell 5d43a1d704 AP_AHRS: added inertial nav interfaces to AHRS 2014-02-15 05:48:16 +11:00
Andrew Tridgell 392995ef84 AP_AHRS: make AHRS handle altitude
AHRS now holds the home position
2014-02-15 05:29:47 +11:00
Andrew Tridgell 1e476e511a AP_AHRS: pass baro into AP_AHRS
first step in making AHRS handle altitude
2014-02-15 05:29:47 +11:00
Andrew Tridgell 84c7b0d7fd AP_AHRS: check for NavEKF health 2014-02-15 05:29:46 +11:00
Andrew Tridgell b39a5062e9 AP_AHRS: use NavEKF for ground vector when available 2014-02-15 05:29:45 +11:00
Andrew Tridgell b6bc50051f AP_AHRS: allow reporting of secondary AHRS solution 2014-02-15 05:29:45 +11:00
Andrew Tridgell 8c5cde4efd AP_AHRS: allow NavEKF to be enabled at runtime with AHRS_EKF_USE=1 2014-02-15 05:28:10 +11:00
Andrew Tridgell 7ac78ff991 AP_AHRS: create AP_AHRS_NavEKF class
subclass of AP_AHRS_DCM, just a wrapper for now, will add EKF calls
next
2014-02-15 05:28:09 +11:00