Commit Graph

28 Commits

Author SHA1 Message Date
Andrew Tridgell 33440567e6 ACM: ArduCopter updates for new compass interface 2012-06-27 16:01:50 +10:00
Andrew Tridgell dae1a57dc5 ACM: adapt the ArduCopter code for new barometer interface 2012-06-27 16:01:50 +10:00
Robert Lefebvre 4e4ff84cf1 Updates to CopterLEDS
Creation of Nav Blink Function.
2012-05-22 09:58:37 -04:00
Robert Lefebvre c5f7b2fff2 Fixed Syntax error. 2012-05-15 12:35:35 -04:00
Robert Lefebvre c8fb9a6635 More CopterLEDS changes.
Merged CopterLEDS and Piezo functions to eliminate pin conflict on APM2.  Created new Parameter bit to turn piezo function on and off from MP. Moved GPS and Aux pin assignments to allow commonality between APM1 and 2.  Set LED_Mode parameter default to 9 in order to make CopterLEDS completely backwards compatible with old Motor LEDS and Piezo code.  Legacy users should see no difference.
2012-05-15 12:00:21 -04:00
Andrew Tridgell 547b4ed55b AHRS: adapt ArduCopter for new AHRS framework 2012-03-19 17:29:02 +11:00
Andrew Tridgell d6cfc51ae4 ACM: no need to fetch offsets at startup
AP_Param handles this
2012-03-10 10:34:31 +11:00
Jason Short 486c56ce41 Consolidated Barometer pressure sensing to a single filter based on Randy's new filter class. 2012-03-08 23:13:04 -08:00
Andrew Tridgell 0248b48d30 allow MAG_ENABLE to be changed in flight
this disables the compass in DCM if MAG_ENABLE is changed in
flight. Without this we would use a fixed yaw once the compass is
disabled

This also makes sure we don't pass the compass to DCM till we have
done a read. This ensures we have a good compass fix for the initial
DCM heading
2012-02-25 14:51:09 +11:00
Andrew Tridgell 864ed1a87f ACM: check the return of compass.init()
if the compass fails to initialise then don't pass it to DCM, or we
will get no yaw control. Report the init failure to the user.
2012-02-25 14:51:08 +11:00
Jason Short 295631139a formatting 2012-01-28 21:19:46 -08:00
Randy Mackay 4434ddf389 Optical flow - updated standard frame rate to 2000hz and increased resolution to 1600cpi 2012-01-25 21:53:20 +09:00
Michael Oborne 95f58b0432 fix scale error 2012-01-21 06:33:18 +08:00
Michael Oborne 1bebb9452b AC sync battery code with arduplane 2012-01-21 06:29:09 +08:00
Doug Weibel ed9f7cb1b6 Update battery monitoring code for ArduCopter
Fixes compatibility for APM2.  Also a significant update to the battery monitoring code:  We previously had monitoring modes for individual cell voltages for 3 and 4 cell lipos.  These have been removed as they were never really supported (the cell voltages were computed but were not reported or recorded anywhere).  Also, some clean-up/prep work was done for supporting monitoring 2 separate battery packs.  The CLI battery and current monitoring tests were consolidated into 1 test.
changed
2012-01-15 17:10:02 -07:00
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
Jason Short 92eece79a4 cleanup - removed unused functions, made pressure reading Float to avoid extra cast 2012-01-04 09:28:36 -08:00
Randy Mackay 3cb74cb459 ArduCopter - init_compass - fixed HIL build issue 2011-12-31 12:29:54 +09:00
Jason Short fbb35928fe removed unused function
Simplified the baro init filter
2011-12-29 23:02:01 -08:00
Randy Mackay bbe6dea980 OptFlow - initial support for APM2 (there are still problems) including adding ability to set Chip Select pin.
Other unrelated changes are:
a) fixed typo in 'esitmate_velocity' to 'estimate_velocity'.
b) moved init_compass from system.pde to sensors.pde which seemed consistent with other sensors.
2011-12-30 12:06:31 +09:00
Pat Hickey 6dbd6b4181 ArduCopter: Get barometer data in terms of AP_Baro interface
* Major change: Log.pde Log_Write_Control_Tuning has changed significantly
* MS5611 has no concept of RawPres and _offset_press
* Log the get_pressure() instead. (If we don't trust the barometer, what's the point?)
2011-12-11 15:21:10 -08:00
Randy Mackay 67855b207d Arducopter, RangeFinder - added SONAR_TYPE parameter and properly support the XL (default), LV and long distance XL (aka XLL) sonar types 2011-12-11 16:40:59 +09:00
Andrew Tridgell 28634f51b7 ArduCopter: use specific sized data types in a lot of places
this will make the Desktop build more consistent with the real AVR
build, and also with a future ARM build
2011-11-08 11:05:36 +11:00
Andrew Tridgell d89ae696ef merged the GCS updates from ArduPlane to ArduCopter
this removes all the non-MAVLink GCS options, and simplifies the HIL
and GCS code a lot. It also adds async sending of low priority GCS
text messages.
2011-10-11 20:53:43 +11:00
Jason Short bf94ba551e changed PI Library to take Float for DeltaTime
Changed timing to be more accurate in main loop. Still need to switch to micros(). Left that for Tridge. This gets rid of six floating point calcs *250. Nice!
2011-09-19 14:02:42 -07:00
Jason Short 73fd0084be Added Piezo Support, code from Oliver. 2011-09-18 17:12:28 -07:00
Jason Short 9c5cba56eb Added low voltage code flashing code. 2011-09-16 18:56:51 -07:00
Andrew Tridgell 1456a2a912 renamed top level directories
ArduCopterMega -> ArduCopter
added archives directory for old code
2011-09-09 11:27:41 +10:00