Commit Graph

13327 Commits

Author SHA1 Message Date
Randy Mackay d58f7ada62 Copter: remove extra in_mavlink_delay from should_log function
Also return false when logging disabled
2014-10-17 21:33:58 +09:00
Andrew Tridgell c093160ea9 Copter: support logging while disarmed 2014-10-17 21:33:52 +09:00
Randy Mackay 7e1c975c54 Copter: add DCM check of yaw error
Triggers an "ekf" failsafe if the DCM yaw error is > 60deg
2014-10-16 17:28:42 +09:00
Randy Mackay 470fcc2077 Copter: add DCM_CHECK_THRESH parameter 2014-10-16 17:27:15 +09:00
Andrew Tridgell ed30c0938e AP_AHRS: use a common function for updating the CD values
this ensures the wrapping of yaw is consistent between the 3 use cases
2014-10-15 11:28:30 +09:00
Andrew Tridgell f61ae9e9e5 AP_AHRS: restore DCM attitude before update()
The DCM drift correction code uses the current attitude to calculate
error values to update its gyro drift correction. If we were using EKF
then without this patch the DCM code running as an alternative AHRS
source would be using the EKF attitude for calculating the error
value, leading to very bad gyro drift estimation
2014-10-15 11:28:25 +09:00
Andrew Tridgell 0dcf501766 AP_AHRS: fixed calls to DCM in parent class
use_compass() and reset() are common to AP_AHRS_DCM and
AP_AHRS_NavEKF. As AP_AHRS_NavEKF is a child of AP_AHRS_DCM, when we
call use_compass() from within AP_AHRS_DCM we actually end up calling
AP_AHRS_NavEKF::use_compass().

This has the effect of disabling the compass in DCM when EKF is active
and EKF has decided not to use the compass. That means that the DCM
yaw (and in fact the whole attitude) can get badly off while EKF is
enabled, making DCM an ineffective fallback if EKF fails.

The fix is to call the specific class versions of use_compass() and
reset()
2014-10-15 11:28:23 +09:00
Jonathan Challinger 71722d2e49 Copter: remove DRIFT and SPORT from manual_flight_mode function 2014-10-11 15:28:28 +09:00
Jonathan Challinger 4f427c6215 AC_PosControl: Protect from divide-by-zero in get_stopping_point_xy 2014-10-10 21:19:45 +09:00
Randy Mackay 6537432b50 Copter: auto-trim start delays auto-disarm by 15sec
Fixes issue in which user only had 5 seconds after starting auto-trim to
raise the throttle before the auto-disarm would kick-in.
2014-10-09 22:42:47 +09:00
Randy Mackay 74e86a3cd7 Copter: version to AC3.2-rc12 2014-10-09 20:18:06 +09:00
Randy Mackay 01a4ad24af Copter: AC3.2-rc12 release notes 2014-10-09 20:17:55 +09:00
Randy Mackay 31c256bdd8 AP_InertialNav: fixed use of ahrs.get_velocity with EKF disabled 2014-10-09 20:13:40 +09:00
Andrew Tridgell 811e8571f1 AP_InertialNav: fixed use of _ahrs.get_relative_position_NED() with EKF disabled
this prevents a floating point error caused by using an uninitialised
vector3 when switching between DCM and EKF control in AP_InertialNav

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2014-10-09 20:13:37 +09:00
Randy Mackay 7f8a68d44a Copter: support pre-flight calibration of gyro 2014-10-09 10:26:05 +09:00
Randy Mackay 661755e05a Copter: report gyro unhealthy if failed calibration 2014-10-09 10:25:52 +09:00
Randy Mackay eb594775b7 Copter: pre-arm check that gyro cal succeeded 2014-10-09 10:25:47 +09:00
Randy Mackay d309ecb587 INS: add gyro_calibrated_ok_all method
This returns true if the gyros have been calibrated successfully
2014-10-09 10:25:42 +09:00
Randy Mackay a95b8f1b0e Copter: Rate Pitch IMAX default to 1000
Spotted by Jonathan Challinger, thanks!
2014-10-07 21:07:40 +09:00
Randy Mackay 5891cd3078 Copter: disable sonar on APM1 and TradHeli on APM2 2014-10-07 14:13:35 +09:00
Randy Mackay a1e707b7f9 Copter: cleanup enabling of cli and frsky telem for APM 2014-10-07 12:57:09 +09:00
Randy Mackay 26b5321130 Copter: version to AC3.2-rc11 2014-10-06 11:48:13 +09:00
Randy Mackay 95b2b45a7b Copter: ReleaseNotes for AC3.2-rc11 2014-10-06 11:48:00 +09:00
Randy Mackay 51de79c2f8 MotorsMatrix: _min_throttle interpreted as 0 ~ 1000 range for throttle_lower flag
Also trigger throttle_upper flag when throttle in reaches 1000
2014-10-04 23:51:04 +09:00
Randy Mackay 55173cc340 Tri: _min_throttle interpreted as 0~1000 range for throttle_lower flag
limit.throttle_lower flag becomes true when the throttle passed into the
motors lib (which is in the 0 ~ 1000 range) is below _min throttle.
This makes the interpretation of the THR_MIN parameter consistent
between the main code (which uses 0 ~ 1000 range) and the motors lib
(which previously used the RC3_MIN ~ RC3_MAX range).
The remaining problem however is that the output of the motors continues
to use THR_MIN as if it were a pwm.  I don't believe this is a dangerous
problem however.
2014-10-04 23:51:01 +09:00
lthall e836832595 Copter: increase autotune limits
Rate D max to 0.020 (was 0.015)
Rate P max to 0.35 (was 0.25)
Stab P max to 20 (was 15)
2014-10-03 12:37:40 +09:00
priseborough 6cbb9d635a AP_NavEKF : Fix bug in reset of GPS glitch offset
The GPS glitch offset was being zeroed during position resets. This caused the filter to reject subsequent GPS measurements if the GPS error persisted long enough to invoke a timeout and a position reset.
2014-10-03 09:20:05 +09:00
Randy Mackay 400dd94ec5 TradHeli: remove overall throttle level from landing check 2014-10-02 16:14:08 +09:00
Randy Mackay 3b0a308ed2 Copter: only report ahrs unhealthy after initialisation 2014-10-02 15:02:55 +09:00
Randy Mackay 29c704fecc 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 15:02:52 +09:00
priseborough b51d01f979 AP_AHRS : add method to report if EKF is waiting to start 2014-10-02 15:02:50 +09:00
Andrew Tridgell 89755c2bb5 AP_NavEKF: make it clear that all sat counts are covered 2014-10-01 13:12:48 +09:00
Andrew Tridgell 468ebd811c AP_NavEKF: simplify variable handling in EKF
use named state variables instead of states[] array where possible.
2014-10-01 13:12:46 +09:00
Randy Mackay c338b1675f GPS: fix SIRF set-binary message
This fixes an issue in which the the update rate for the mediatek, which
uses a similar protocol, was not being set correctly
2014-10-01 11:43:24 +09:00
Randy Mackay da2a463f18 Copter: shift pos targets to current location before takeoff 2014-09-29 15:28:16 +09:00
Randy Mackay 2d7f819e1d AC_WPNav: add shift_wp_origin_to_current_pos for takeoff
This shifts the origin to the vehicle's current position and should be
called just before take-off to ensure there are no sudden roll or pitch
moves on takeoff.
2014-09-29 15:28:14 +09:00
priseborough a6cd04ca4c AP_NavEKF : Fix bug in GPS innovation variance growth calculation
The uncertainty in acceleration is currently only scaled using horizontal accelerations, however during vertical plane aerobatics and high g pullups, misalignment in angles can cause significant horizontal acceleration error.
The scaling now uses the 3D acceleration vector length to better work during vertical plane high g maneouvres.
This error was found during flight testing with 8g pullups
2014-09-27 10:34:54 +09:00
priseborough 1f1670279b AP_NavEKF : Fix bug in reset of position, height and velocity states
If the inertial solution velocity or position needs to be reset to the GPS or baro, the stored state history for the corresponding states should also be reset.
Otherwise the next GPS or baro measurement will be compared to an invalid previous state and will be rejected. This is particularly a problem if IMU saturation or timeout has occurred because the previous states could be out by a large amount
The position state should be reset to a GPS position corrected for velocity and measurement latency. This will make a noticeable difference for high speed flight vehicles, eg 11m at 50m/s.
2014-09-27 10:34:51 +09:00
Randy Mackay 20d35b4bd1 Copter: bugfix to condition-yaw for relative angles
Thanks to roque-canales for raising the issue and paradisephil for finding
the specific piece of code that went wrong and suggesting the fix.
2014-09-26 12:26:05 +09:00
Randy Mackay eb89b53714 Copter: version to AC3.2-rc10 2014-09-24 14:29:15 +09:00
Randy Mackay 56242176da Copter: update AC3.2-rc10 release notes 2014-09-24 14:29:14 +09:00
priseborough 9c1b4e2332 AP_NavEKF : Explicitly initialise gpsNoiseScaler to default value 2014-09-24 14:29:12 +09:00
Randy Mackay a0cb4301a1 Copter: allow passthru for ch 9 ~ 14
Based on work by Emile Castelnuovo
2014-09-24 10:28:41 +09:00
priseborough 3233416e43 AP_NavEKF : Reduce weighting on GPS when not enough satellites
GPS measurement variance is doubled if only 5 satellites, and quadrupled if 4 or less.
The GPS glitch rejection thresholds remain the same
This will reduce the impact of GPS glitches on attitude.
2014-09-23 20:39:50 +09:00
priseborough 62339c217c AP_AHRS : Prevent EKF starting if GPS sats less than AHRS_GPS_MINSATS 2014-09-23 20:39:48 +09:00
Randy Mackay 9c3379ff48 Compass: always default devid to zero 2014-09-23 20:36:54 +09:00
Randy Mackay d66ffd5b07 Copter: use disparity threshold define for pre-arm checks
There are two duplicate checks, one in the pre-arm checks (i.e. checks
run every 15 seconds or so before the vehicle is armed) and one in the
arming checks (run immediately before arming).  The definition in the
pre-arm checks was still using the old hardcoded value.
2014-09-23 19:33:53 +09:00
Randy Mackay 5e197407b9 AC_PosControl: 4hz filter on z-axis velocity error 2014-09-22 13:41:02 +09:00
Randy Mackay e047093013 AC_PosControl: 2hz filter on accel error
Replaced hard-coded filter with LowPassFilter class allowing the
filter's to be 2hz on both APM and Pixhawk
2014-09-22 13:40:59 +09:00
Randy Mackay 9693ee0417 LowPassFilter: add div by zero check 2014-09-22 13:40:57 +09:00