Commit Graph

41 Commits

Author SHA1 Message Date
Andrew Tridgell ae1702c20b Baro: added suspend/resume on init 2012-05-01 12:06:54 +10:00
rmackay9 dc58c8a905 AP_Baro - change data type size of temperature's average filter to int32_t (was int16_t) 2012-03-24 23:21:11 +09:00
rmackay9 f3eb15167c AP_Baro - removed unnecessary 2 element average filtering of pressure (there is a 4 or 5 element average filter in arducopter code itself, two places is messy)
- also removed unused _offset_press variable
2012-03-18 15:18:05 +09:00
rmackay9 ed0d1da4f5 AP_Baro - added average filter for temperature to replace broken filter
- added average filter (for last two values) for raw pressure
        - changed some "long" to int32_t and "unsigned long" to uint32_t
2012-03-18 01:06:02 +09:00
Jason Short 13e9608fb8 Consolidated Barometer pressure sensing to a single filter based on Randy's new filter class. 2012-03-08 23:13:04 -08:00
Jason Short 34cf1e8fb3 Updated on Barometer - increased the Temp filtering and decreased the pressure filtering to and get less temp noise, faster response from pressure. I'm filtering the Climb rate differently now, so this higher pressure noise should not hurt the derivative calcs at all now. 2012-03-06 20:55:35 -08:00
rmackay9 0311b70004 AP_Baro - fixed small compiler warning to do with order of parameters in constructor 2012-02-29 22:46:29 +09:00
justinbeech 5255512bf9 Found free extra 256 bytes of RAM eliminate _clz use from libgcc
Believe it or not, changing / 2^31 to >>31 saved 256 bytes in the "d" segment.

The reason is that GCC version prior to 4.3.5 does not have a count_leading_zeros (clz) assembler macro, so it uses a 256 byte lookup table called _clz
The _clz table gets pulled in if you do 64 bit division.
This tiny change is the only place that we do long long division.
Changing to a shift saves 256 bytes of ram.
2012-02-17 09:46:05 +00:00
Jason Short 8e88d9e19e change constant to float 44330.0 2012-02-15 09:10:14 -08:00
Andrew Tridgell e70e1814ac AP_Baro: fixed some signed/unsigned warnings
and a potential bug on timer wrap
2012-02-13 21:39:18 +11:00
justinbeech 4b0c71d6ac Uncommented cold temp compensation after testing. Fixed read throttle so read rate ends up nailing 100hz, not 90hz. minor commenting improvements. 2012-02-13 00:00:06 +00:00
Randy Mackay 2e1e34fb9c 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 98f3386ea0 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
Andrew Tridgell 817e7442bd 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
Andrew Tridgell a7a00a35ab AP_Baro: when I2c fails, don't retry for 1s 2012-01-04 16:35:16 +11:00
Andrew Tridgell 671d0b82ad Baro: fixed MS5611 example sketch 2011-12-28 21:49:29 +11:00
Andrew Tridgell c448e85ed1 Baro: show timing in baro test 2011-12-28 21:43:52 +11:00
Andrew Tridgell 2960abf41f 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 5b75458502 AP_Baro: update MS5611 driver for new ap_proceduce prototype
this saves calling millis() quite so often
2011-12-21 23:31:38 +11:00
Andrew Tridgell 0c8c707980 AP_Baro: fixed temperature on MS5611
this caused a 2x scaling of altitude
2011-12-17 14:58:58 +11:00
Andrew Tridgell de5c1c5147 barometer: fixed HIL barometer build 2011-12-12 15:14:55 +11:00
Pat Hickey 5819f99986 AP_Baro_MS5611: Asynchronous operation, plus c++ style changes.
Yeah, I know this was a big change to make all at once.
2011-12-11 15:21:10 -08:00
Pat Hickey 3d882c4d49 AP_Baro : Add init( AP_PeriodicProcess * ) method to interface & implementations
AP_Baro_MS5611 and AP_Baro_BMP085 implement the interface, with stubs only
2011-12-11 15:21:10 -08:00
Pat Hickey d5386b8bb8 AP_Baro_BMP085: move apm2_hardware flag from init to constructor. 2011-12-11 15:21:10 -08:00
Pat Hickey 6710cf5c5a Wire and SPI Init: move to sketch system.pde from libraries
* Wire.begin removed from AP_Baro_BMP085::init()
* SPI.begin  removed from AP_Baro_MS5611::init()
* SPI.begin  removed from AP_InertialSensor_MPU6000::hardware_init()

* Both Wire.begin and SPI.begin added very early in init_ardupilot in
  ArduCopter/system.pde and ArduPlane/system.pde
2011-12-11 15:21:10 -08:00
Pat Hickey 12222550cf AP_Baro_BMP085: Delete commented out code
* If its important to get old code back, thats why version control exists
2011-12-11 15:21:09 -08:00
Pat Hickey 9a9b63259a AP_Baro_BMP085: implement AP_Baro interface 2011-12-11 15:21:09 -08:00
Pat Hickey 45cbb24ba5 AP_Baro_MS5611: init must also perform SPI.begin 2011-12-11 15:21:09 -08:00
Pat Hickey a75257f102 AP_Baro_MS5611: CS pin is arduino pin 40 2011-12-11 15:21:09 -08:00
Pat Hickey 7b708f8054 AP_Baro_MS5611: Implement AP_Baro interface 2011-12-11 15:21:09 -08:00
Pat Hickey 41ecb0fef4 AP_Baro_BMP085: Conform to AP_Baro interface. Make the rest private. 2011-12-11 15:21:09 -08:00
Pat Hickey 264cb1a26e AP_Baro_MS5611: conform to AP_Baro interface 2011-12-11 15:21:09 -08:00
Pat Hickey c3aab6af83 AP_Baro: Create virtual interface 2011-12-11 15:21:09 -08:00
Pat Hickey 84cb023b12 AP_Baro_MS5611: renamed class implementation from APM_MS5611 2011-12-11 15:21:09 -08:00
Pat Hickey 3d93eb9534 AP_Baro_MS5611.h: reorganized
* moved ms5611 macros to c file
* reorganized class declaration & retabbed
* made Temp, Pres, and Alt private variables.
2011-12-11 15:21:09 -08:00
Pat Hickey 8f16b736a4 AP_Baro_MS5611: Overwrote with Jose Julio's latest files. 2011-12-11 15:21:09 -08:00
Pat Hickey f5720be81f AP_Baro: Export AP_Baro_BMP085 and AP_Baro_BMP085_HIL headers. 2011-12-11 15:21:09 -08:00
Pat Hickey e8e4881da8 AP_Baro_BMP085(+_HIL): Rename classes from APM_BMP085 to AP_Baro_BMP085. 2011-12-11 15:21:09 -08:00
Pat Hickey 917418994d BMP085 fix line endings 2011-12-11 15:21:09 -08:00
Pat Hickey 7b51a2c42a AP_Baro: move all APM_BMP085 files inside AP_Baro 2011-12-11 15:21:09 -08:00
Pat Hickey cca6b2f98c Added AP_Baro and AP_Baro_MS5611 classes.
Incomplete and does not work.
2011-12-11 15:21:08 -08:00