Commit Graph

1158 Commits

Author SHA1 Message Date
Jason Short af79eb273f Added D term to APM_PI - need to refactor this as a parent class and two child classes to save code space, remove dupes 2012-01-28 21:21:43 -08:00
Randy Mackay 9c26e2369e Arduino 1.0 - GPS_IMU - small fix to make it compile. Does anyone use this lib?! 2012-01-28 17:56:56 +09:00
Randy Mackay 8533aaf5d9 AP_PID, AP_RC_Channel, FastSerial - small changes to make example sketches compile again 2012-01-28 17:54:20 +09:00
Randy Mackay b7ce7bfe18 Arduino 1.0 - small fix to make AP_Baro_MS5611_test.pde compile under Arduino 1.0 2012-01-28 13:21:35 +09:00
Randy Mackay cf25bbfa74 AP_ADC library - tiny fix to make example sketch work after some changes to AP_PeriodicProcess library 2012-01-28 13:12:19 +09:00
Randy Mackay ed19c25a97 Arduino 1.0 - changed all #includes of "WProgram.h", "wiring.h" and "WConstants.h to "Arduino.h".
Modified FastSerial's write function to return size_t (number of bytes written).
2012-01-28 12:25:47 +09:00
Randy Mackay a8b3d2f063 OpticalFlow - fixed minor compiler warnings and moved chip select to A3 for APM2 2012-01-26 23:35:49 +09:00
Randy Mackay 8dee001657 Sonar - changed default pin to A0 2012-01-26 22:50:48 +09:00
Randy Mackay 99506accf4 Optical Flow - added overflow check 2012-01-25 21:45:52 +09:00
Pat Hickey 9195006541 APM_RC examples: add calls to enable_out after init 2012-01-24 09:09:08 -08:00
Andrew Tridgell 9c1e257826 fixed example in PID library 2012-01-23 08:47:46 +11:00
Pat Hickey 602d56304a APM_RC: PWM outputs are disabled by default on init 2012-01-22 12:03:11 -08:00
Pat Hickey 276913a950 APM_RC enable_out and disable_out added to APM1 and APM2
* Outputs still enabled by default
2012-01-22 12:03:11 -08:00
Jason Short 94e7ba8df2 Removed Gyro filter, In the end it doesn't help and I think it could actually hurt gyro integration. 2012-01-20 22:52:29 -08:00
Michael Oborne 6b949511ca change rc norm_output to scale evenly across the entire range 2012-01-20 16:24:55 +08:00
Andrew Tridgell 0dc0d9ddf0 added a simple DCM library example 2012-01-18 21:25:19 +11:00
Andrew Tridgell 1f43cf6579 fixed Oilpan test for new library structure 2012-01-18 20:31:58 +11:00
Doug Weibel e22a83eec0 Add a CLI setup action to reset the magnetometer offsets
Since the magnetometer offsets are not available through the MAVLink parameter interface (since they are an AP_Var vector) this little feature allows them to be reset from the CLI.  Useful if you somehow get bad offsets or if you change magnetometer.  If you have a bad set of large offset values I have seen issues with the nulling algorithm have trouble converging to the proper values.  I have never seen it have trouble converging from 0/0/0, so this could be a useful feature from time to time.
2012-01-15 16:15:08 -07:00
Mike Smith 9c5a776456 Teach the Makefile about the new Arduino sourcefile suffix 2012-01-15 11:51:38 -08:00
Jason Short 69ffc7e115 updated channel notes 2012-01-15 10:24:15 -08:00
Andrew Tridgell 897d9a1c0b baro: fixed an integer overflow issue at high altitudes
the averaging array was using 16 bit numbers, but we are storing
numbers with 19 significant bits. That caused overflow at high
altitude, and some very interesting altitude graphs!

Thanks to Michael Oborne for spotting this in a log
2012-01-14 19:51:35 +11:00
Randy Mackay bcd63a9807 OpticalFlow - bug fix - highest resolution was incorrectly set as 1200 instead of 1600 2012-01-14 12:34:29 +09:00
Andrew Tridgell 15d446bde2 DCM: prevent a segmentation fault when compass is not enabled
when compass is disabled _compass is NULL
2012-01-13 15:48:07 +11: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
Andrew Tridgell 49cf409c23 desktop: floating point precision changes from Justin Beech 2012-01-11 21:31:59 +11:00
Jason Short e2830ca147 fixed type error 2012-01-10 23:43:44 -08:00
Jason Short 354d9588bf sensorSign swicth 2012-01-10 23:43:44 -08:00
Jason Short b6fc8e519c AP Rangefinder had some bad characters in it. Converted and cleaned the text files. 2012-01-10 23:42:26 -08:00
Jason Short 351be7c305 Made timer unsigned 2012-01-10 23:42:26 -08:00
Pat Hickey a19afd926a APM_RC & ArduCopter: Change interface to SetFastOutputChannels to use _BV
* Every use of MSK_CH_n changed to _BV(CH_n)
* Easier to read, and will allow CH_n to be parameterized without needing
  a separate macro expansion for the MSK value.
2012-01-09 21:57:01 -08:00
Doug Weibel 756793611f Repair dataflash test 2012-01-08 21:29:19 -07:00
Jason Short d0af95f0e3 allows main code to manually set the integrator value 2012-01-04 09:28:36 -08:00
Andrew Tridgell ca39fc8b47 sitl: added build targets for different ACM frames 2012-01-04 21:45:46 +11:00
Andrew Tridgell 60185509f4 AP_Compass: when I2c fails, don't retry for 1s 2012-01-04 16:35:47 +11:00
Andrew Tridgell 9fb3b13af3 AP_Baro: when I2c fails, don't retry for 1s 2012-01-04 16:35:16 +11:00
Andrew Tridgell 880c7e6411 DataFlash: cope with older dataflash chips
some of the APM2 DataFlash cards use an older chip with only 4096
pages, and a density code of 6. Doug has one of these.
2012-01-04 16:16:35 +11:00
Michael Oborne 306e2e3f7d add gps character count.
this problem happens when the mtk ends up in nmea mode at 10hz. there is no 50ms window of no activity
2011-12-31 13:05:33 +08:00
Michael Oborne 3d85f99546 remove gps callback in wait loop 2011-12-31 09:35:40 +08:00
Randy Mackay a2edba69b1 GPS - removed GPS_MTK, GPT_NMEA and GPS_UBLOX. All functionality moved to AP_GPS many months ago. 2011-12-30 22:25:00 +09:00
Jason Short 7adc80c513 removed newlines to clean up code 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
Andrew Tridgell 074fd31506 Baro: fixed MS5611 example sketch 2011-12-28 21:49:29 +11:00
Andrew Tridgell 820153d7ae compass: show timing in compass test 2011-12-28 21:44:18 +11:00
Andrew Tridgell f871235480 Baro: show timing in baro test 2011-12-28 21:43:52 +11:00
Andrew Tridgell 8f74631882 DCM: don't use compass unless its healthy 2011-12-28 20:41:54 +11:00
Andrew Tridgell 7c098491b9 I2C: fixed some warnings 2011-12-28 20:41:53 +11:00
Andrew Tridgell 5f38663d44 desktop: exclude I2C library 2011-12-28 20:41:53 +11:00
Andrew Tridgell e1c9c063a5 MPU6k: don't init the Wire library
we don't use Wire any more
2011-12-28 20:41:53 +11:00
Andrew Tridgell 7ba744a11a I2C: convert barometer library to new I2C library
this also adds a healthy attribute and error checking
2011-12-28 20:41:53 +11:00
Andrew Tridgell acf4e9b61d I2C: convert compass code to new I2C library
this also adds a healthy attribute, and error checking on all I2C
calls
2011-12-28 20:41:53 +11:00