Commit Graph

5975 Commits

Author SHA1 Message Date
Randy Mackay 1266a31631 Rally: reduce distance limit to 300m for copter
This reduces the chance that a forgotten rally point will cause the
vehicle to RTL to a distant location because instead it will RTL to
home.
2015-01-06 15:56:34 +09:00
Randy Mackay 44c5fdffdf Notify: add pre_arm_gps_check flag
RGB LED will remain flashing blue when vehicle is disarmed and this
check has failed (i.e. false).
2014-12-26 15:10:31 +09:00
Randy Mackay 59350821a3 AC_PosControl: fix to default force_descend param 2014-12-24 14:44:56 +09:00
Jonathan Challinger 77bbd2532b AC_PosControl: add force_descend option to set_alt_target_from_climb_rate 2014-12-24 14:44:54 +09:00
Andrew Tridgell 0c371f1b98 DataFlash: don't try and open logfile on failure more than once
this prevents a corrupted microSD card from causing a continuous
attempt to open a log file while in flight, which can cause large
scheduler delays

Pair-Programmed-With: Grant Morphett <grant@gmorph.com>
2014-12-23 16:03:02 +09:00
Andrew Tridgell 60ded486c2 DataFlash: don't write out parameters if log open fails 2014-12-23 16:02:59 +09:00
Andrew Tridgell d5108195da HAL_PX4: FRAM does not support fsync
the fsync just wastes time reopening /fs/mtd
2014-12-19 09:18:31 +09:00
Emile Castelnuovo 412de3cf76 AP_Compass: VRBRAIN add #if !defined() for VRBRAIN 4.5 boards. 2014-11-11 11:14:13 -08:00
LukeMike 1455d700d4 VRBRAIN: defined AirSpeed inputs for ArduPlane on VR Micro Brain 5 2014-11-11 11:13:54 -08:00
Emile Castelnuovo 2de18f844b AP_Compass: VRBRAIN. Deal with external mag connected on internal I2C on VRBRAIN 4.5
This enables user to set the external parameter to true even if only one compass is connected
2014-11-11 11:13:49 -08:00
priseborough fecad46336 AP_NavEKF : add INIT_GYRO_BIAS_UNCERTAINTY definition 2014-10-29 17:42:10 +09:00
priseborough a7caa91cef AP_NavEKF : Add public method to reset gyro bias states 2014-10-29 15:42:34 +09:00
priseborough d04a740bcb AP_AHRS : Add reset of EKF gyro bias states 2014-10-29 15:42:31 +09:00
Randy Mackay 1ab5d71927 GPS: init primary_instance to zero 2014-10-29 15:42:28 +09:00
Benoit PEREIRA DA SILVA a8a6368f05 GPS: use primary for Notification 2014-10-29 15:42:26 +09:00
Randy Mackay 95538d2992 AHRS: add reset_gyro_drift method 2014-10-29 15:42:20 +09:00
Andrew Tridgell fae45b29fa AP_InertialSensor: fixed timer bug in HIL sensors 2014-10-27 21:10:55 +09:00
Randy Mackay 8041613c06 RangeFinder: PulsedLight I2C addr to 0x62 2014-10-24 15:00:47 +09:00
Andrew Tridgell 7ad0b6177f AP_RangeFinder: auto-update PX4 ll40ls max/min distance
this allows the range of the Lidar to be set by the user using
RNGFND_MAX_CM and RNGFND_MIN_CM
2014-10-24 13:48:38 +09:00
Randy Mackay bafd9fd53f RangeFinder: reduce num instances to 1 2014-10-23 22:20:05 +09:00
Randy Mackay 47418b78d6 Relay: reduce num relays to 2 2014-10-23 22:20:01 +09:00
Randy Mackay a4da667e2b Mount: remove CMD_DO_MOUNT_CONFIGURE support 2014-10-23 22:19:52 +09:00
Randy Mackay 5cbcbf9b37 DataFlash: log baro climbrate 2014-10-22 17:40:55 +09:00
Randy Mackay ba5e368175 AC_WPNav: bug fix sanity check of set_speed_xy
This corrects a bug that allowed the waypoint speed to be set to zero
2014-10-21 22:11:26 +09:00
Randy Mackay 65472eaf62 AHRS_DCM: sanity check AHRS_RP_P and AHRS_YAW_P 2014-10-21 22:11:23 +09:00
Randy Mackay 3638bfb614 AC_PosControl: bug fix dt calculation
fixes issue in which now could be earlier than _last_update_xy_ms
leading to a large dt value and a sudden lean on takeoff
2014-10-21 11:41:55 +09:00
priseborough d37c788394 AP_NavEKF: Track baro alt when pre-armed
This will help prevent spurious alt disparity warning messages for copter
2014-10-20 17:13:37 +09:00
Randy Mackay d71b08af0c AP_Motors: reduce slow-start increment for fast CPUs 2014-10-18 20:54:59 +09:00
Randy Mackay cd35293a7b Parachute: set servo or relay to off position on every update
This resolves the issue of the parachute servo's position not being
initialised to the off position due to an ordering problem of the
auxiliary servos being initialised after the parachute object.
2014-10-18 17:27:12 +09:00
Andrew Tridgell 820b4e2bed AP_Compass: added set_offsets() interface
this will be used by Replay to prevent the need for saving parameters
2014-10-17 21:34:05 +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 4f427c6215 AC_PosControl: Protect from divide-by-zero in get_stopping_point_xy 2014-10-10 21:19:45 +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 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 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
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 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 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
priseborough 9c1b4e2332 AP_NavEKF : Explicitly initialise gpsNoiseScaler to default value 2014-09-24 14:29:12 +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