ardupilot/ArduPlane
Doug Weibel 9846822748 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_Config.h Put in commented-out APM2 # defines, to save people the trouble of having to type them in themselves. 2012-01-09 02:00:46 +00:00
APM_Config.h.reference Minimum ground speed patch from Claudio Natoli. Thanks Claudio! 2011-12-09 16:43:25 -07:00
APM_Config_mavlink_hil.h removed some more unused defines 2011-09-19 11:04:02 +10:00
ArduPlane.pde Adding comments for global variables 2012-01-11 12:37:43 -07:00
Attitude.pde Remove old debug print 2011-12-24 14:26:35 -07:00
GCS.h USB-MUX: auto-switch telemetry port based on UXB mux for ArduPlane 2011-11-25 20:00:19 -08:00
GCS_Mavlink.pde add circle to output modes 2011-12-29 18:21:32 +08:00
Log.pde APM: Update for DataFlash changes 2011-12-28 16:00:49 +11:00
Makefile added sitl build target 2011-12-12 15:14:55 +11:00
Parameters.h Tweak to FBW min altitude 2011-12-31 15:44:40 -07:00
climb_rate.pde remove unused climb_rate code 2011-09-19 11:04:02 +10:00
command description.txt This is the real HEAD of the APM_Camera branch. Seams that lots of changes got lost in the SVN to GIT port 2011-09-09 16:18:38 +02:00
commands.pde fixed a valgrind warning 2011-11-08 17:26:53 +11:00
commands_logic.pde Bug fix for issue 438. 2012-01-08 18:24:55 -07:00
commands_process.pde Mission Scripting updates 2011-11-16 00:22:23 -08:00
config.h fix relay on apm 1 AP 2012-01-05 07:51:01 +08:00
control_modes.pde Correct a bug in throttle failsafe feature 2011-12-24 15:34:31 -07:00
createTags imported ArduPlane from ArduPilotMega svn 2011-09-09 11:29:39 +10:00
defines.h geofence: store fence points as int32_t 2011-12-16 20:11:51 +11:00
events.pde Correct a bug in throttle failsafe feature 2011-12-24 15:34:31 -07:00
failsafe.pde failsafe: make sure we clear any RC override in manual failsafe 2011-12-22 10:55:43 +11:00
geofence.pde geofence: re-breach if user changes mode outside the fence 2011-12-28 17:28:35 +11:00
navigation.pde added comment on using GPS ground course 2011-12-23 11:13:01 +11:00
planner.pde USB-MUX: auto-switch telemetry port based on UXB mux for ArduPlane 2011-11-25 20:00:19 -08:00
radio.pde purple: fixed APM_RC.Init() to add isr_registry parameter 2011-11-25 20:00:17 -08:00
sensors.pde APM: added error checking on barometer read 2011-12-28 20:41:53 +11:00
setup.pde This is the real HEAD of the APM_Camera branch. Seams that lots of changes got lost in the SVN to GIT port 2011-09-09 16:18:38 +02:00
system.pde Bug fix for compass. 2012-01-12 14:44:24 -07:00
test.pde Bug fix for compass. 2012-01-12 14:44:24 -07:00