ardupilot/libraries
Doug Weibel 622217357c Bug fix for compass.
This is a fix for an interesting bug when a DCM matrix reset was added to the ground start.  This bug only showed up if (A) a ground start were performed after an air start or due to use of the "Calibrate Gryo" action, (B) if the current orientation were sufficiently different from 0/0/0, and (C.) if the particular magnetometer had sufficiently large offsets.  Why did resetting the DCM matrix to 0/0/0 pitch/roll/yaw at ground start cause a bug?  The magnetometer offset nulling determines the proper offsets for the magnetometer by comparing the observed change in the magnetic field vector with the expected change due to rotation as calculated from the rotation in the DCM matrix.  This comparison is made at 10Hz, and then filtered with a weight based on the amount of rotation to estimate the offsets. Normally it would take considerable time at normal in-flight rotation rates for the offset estimate to converge. 

If a DCM matrix reset occurs when the offset nulling algorithm is up and running, the algorithm sees the DCM reset as a instantaneous rotation, however the magnetic field vector did not change at all.  Under certain conditions the algorithm would interpret this as indicating that the offset(s) should be very large.  Since the "rotation" could also have been large the filter weighting would be large and it was possible for a large erroneous estimate of the offset(s) to be made based on this single (bad) data point.

To fix this bug methods were added to the compass object to start and stop the offset nulling algorithm.  Further, when the algorithm is started, it is set up to get fresh samples.  The DCM matrix reset method now calls these new methods to stop the offset nulling before resetting the matrix, and resume after the matrix has been reset.
2012-01-12 14:44:24 -07:00
..
APM_PI allows main code to manually set the integrator value 2012-01-04 09:28:36 -08:00
APM_PerfMon Optional recursion added. 2011-09-30 17:17:51 -04:00
APM_RC APM_RC & ArduCopter: Change interface to SetFastOutputChannels to use _BV 2012-01-09 21:57:01 -08:00
APO Fixed along track bug. 2011-12-07 20:55:06 -05:00
AP_ADC sensorSign swicth 2012-01-10 23:43:44 -08:00
AP_AnalogSource AnalogSource: return a float from read() method 2011-12-17 07:29:09 +11:00
AP_Baro AP_Baro: when I2c fails, don't retry for 1s 2012-01-04 16:35:16 +11:00
AP_Common fixed type error 2012-01-10 23:43:44 -08:00
AP_Compass Bug fix for compass. 2012-01-12 14:44:24 -07:00
AP_DCM Bug fix for compass. 2012-01-12 14:44:24 -07:00
AP_EEPROMB eeprom: fixed types to be consistent with declarations 2011-10-09 22:08:59 +11:00
AP_GPS add gps character count. 2011-12-31 13:05:33 +08:00
AP_IMU removed dead test program 2011-12-24 18:11:04 +11:00
AP_InertialSensor MPU6k: don't init the Wire library 2011-12-28 20:41:53 +11:00
AP_Math added comment in polygon code 2011-12-21 23:31:38 +11:00
AP_Mount Added camera and/or antenna mount support. 2011-10-31 22:55:58 +01:00
AP_Navigation Optional recursion added. 2011-09-30 17:17:51 -04:00
AP_OpticalFlow OptFlow - initial support for APM2 (there are still problems) including adding ability to set Chip Select pin. 2011-12-30 12:06:31 +09:00
AP_PID Optional recursion added. 2011-09-30 17:17:51 -04:00
AP_PeriodicProcess TimerProcess: prevent a race in setting up the timer callbacks 2011-12-28 16:00:49 +11:00
AP_RC Optional recursion added. 2011-09-30 17:17:51 -04:00
AP_RC_Channel Optional recursion added. 2011-09-30 17:17:51 -04:00
AP_RangeFinder AP Rangefinder had some bad characters in it. Converted and cleaned the text files. 2012-01-10 23:42:26 -08:00
AP_Relay Implement relay get() 2011-10-02 02:28:40 +02:00
Arduino_Mega_ISR_Registry purple: added ISR_Registry() library 2011-11-25 20:00:16 -08:00
DataFlash Repair dataflash test 2012-01-08 21:29:19 -07:00
Desktop desktop: floating point precision changes from Justin Beech 2012-01-11 21:31:59 +11:00
FastSerial Fix issue #423 - FastSerial flush bug. 2011-12-26 15:52:21 -08:00
GCS_MAVLink added missing mavlink headers 2011-12-16 20:53:26 +11:00
GCS_SIMPLE Optional recursion added. 2011-09-30 17:17:51 -04:00
GPS_IMU Optional recursion added. 2011-09-30 17:17:51 -04:00
I2C I2C: fixed some warnings 2011-12-28 20:41:53 +11:00
ModeFilter modefilter: fixed type to be consistent with declaration 2011-10-09 22:08:59 +11:00
PID Optional recursion added. 2011-09-30 17:17:51 -04:00
RC_Channel purple: rework the RC_Channel library for the APM_RC changes 2011-11-25 20:00:16 -08:00
Trig_LUT Optional recursion added. 2011-09-30 17:17:51 -04:00
Waypoints Optional recursion added. 2011-09-30 17:17:51 -04:00
doc Checking these in makes the libraries too bulky. We need to host them somewhere. 2011-01-04 06:22:02 +00:00
memcheck memcheck: allow memcheck to build on desktop systems 2011-10-09 22:16:12 +11:00