Commit Graph

3081 Commits

Author SHA1 Message Date
Andrew Tridgell fc8065b50f HAL_PX4: added UART performance counters 2013-01-24 15:04:57 +11:00
Andrew Tridgell 6cf1d5e1ff HAL_PX4: handle IO errors on microsd
this should handle EINTR gracefully
2013-01-24 15:04:57 +11:00
Randy Mackay 542e2e1358 AP_PerfMon: fixes to make it work under AP_HAL (almost) 2013-01-23 21:22:17 +09:00
Andrew Tridgell 966b9b9b9c HAL_PX4: format panic messages with a newline 2013-01-23 16:54:44 +11:00
Andrew Tridgell c9799fb2b7 HAL_PX4: writing more than 512 bytes at a time can cause IO errors
the vfat fs in NuttX is really very picky!
2013-01-23 16:54:44 +11:00
Andrew Tridgell 952df2fced HAL_PX4: new buffered storeage driver for microsd cards
this does all IO in the timer thread, avoids writes that don't change
data, and does all writes in multiples of 128 byte chunks. This should
be about as friendly to SD cards as we can get.
2013-01-23 16:37:40 +11:00
Andrew Tridgell f72b532405 HAL_PX4: ensure all writes go via buffers
this prevents output corruption by direct fd writes
2013-01-23 09:22:51 +11:00
Andrew Tridgell 2a10727902 HAL_PX4: run timer thread as SCHED_FIFO
this ensures it never yields to the main thread, which would break our
locking assumptions
2013-01-23 09:21:50 +11:00
Andrew Tridgell 930e79a9e1 HAL_PX4: fixed rcin->valid() for RC override input 2013-01-23 07:57:59 +11:00
Andrew Tridgell 06e63d3167 HAL_PX4: use pthread_yield() in main loop
this lowers the latency of the main loop somewhat
2013-01-23 07:36:13 +11:00
Andrew Tridgell 6e8501603c HAL_PX4: avoid RCOutput ioctl unless values change
this lowers latency somewhat
2013-01-23 07:29:59 +11:00
Andrew Tridgell 89cb3fbd61 HAL_PX4: fixed blocking IO in UART driver 2013-01-22 21:52:21 +11:00
Andrew Tridgell 6ffa18fa61 HAL_PX4: rewrite UART driver to be much more efficient
this does the IO in the timer thread, and uses buffers in the main
task to avoid system call costs in the flight code.

The cost of PX4 read and write system calls is quite high - about 10
to 15 usec. We can't afford to pay that per byte
2013-01-22 21:22:01 +11:00
Andrew Tridgell 37be83994f SITL: allow motor multiplier to work on quad simulation 2013-01-22 21:22:01 +11:00
Andrew Tridgell f0469a21f2 AP_Baro: fixed timestamp on baro for PX4
milliseconds not microseconds
2013-01-22 21:22:01 +11:00
Andrew Tridgell 80eaa52ed8 AP_Compass: use report timestamp on PX4 for accurate timing 2013-01-22 21:22:01 +11:00
rmackay9 6f1035debc InertialNav: added 300ms timeout after which error from gps heading will be set to zero 2013-01-22 18:37:54 +09:00
Jonathan Challinger 6565d83e73 InertialNav: Fixed signs, remove body-frame rotation, apply correction at 100hz. 2013-01-22 18:37:45 +09:00
Andrew Tridgell 546ed19ffc HAL_PX4: improved efficiency of serial writes
use buffer at a time writes when possible, and use O_NONBLOCKING to
avoid txspace()
2013-01-22 10:50:26 +11:00
Andrew Tridgell 18cfd29f2f HAL_PX4: added a read buffer to the UART driver
this lowers the average cost of reading bytes by a large amount, and
prevents the GPS driver from chewing lots of time.
2013-01-22 10:34:04 +11:00
Andrew Tridgell db0bd86317 HAL_PX4: name the eeprom file after the sketch
this makes it easier to switch between ArduPlane and ArduCopter
2013-01-21 22:04:17 +11:00
Andrew Tridgell f60d657f72 AP_InertialSensor: added timer for accumulating samples for PX4
this makes the driver much more tolerant of sketch timing errors
2013-01-21 21:51:32 +11:00
Andrew Tridgell 3d0cb755d2 AP_InertialSensor: user a timer to drive data collection on PX4
this reduces the chance of missing a sample if the main sketch is a
bit slow
2013-01-21 19:44:01 +11:00
Andrew Tridgell b9b3ef91a1 AP_Baro: added timer to PX4 driver
this gives us more samples when main sketch is reading slowly
2013-01-21 18:20:05 +11:00
Andrew Tridgell 1188c9e335 HAL_PX4: added Util instance
this fixes hal.util->vsnprintf_P()
2013-01-21 17:10:42 +11:00
Andrew Tridgell 52f560a4c2 HAL_PX4: enabled AnalogIn driver 2013-01-21 13:56:57 +11:00
Andrew Tridgell ed94292c25 HAL_PX4: start adc driver in rc.APM 2013-01-21 13:55:58 +11:00
Andrew Tridgell e42cf918fd HAL_PX4: added AnalogIn driver
this allows airspeed to work on a PX4
2013-01-21 13:55:06 +11:00
Andrew Tridgell 39e28d48c2 HAL_PX4: switched scheduler to use a pthread
this allows the timer tasks to access file descriptors in the main APM
task, which makes writing PX4 device drivers much easier
2013-01-21 13:54:09 +11:00
Andrew Tridgell ffb2924dd4 HAL_PX4: added APM startup script 2013-01-21 08:27:02 +11:00
Andrew Tridgell 6a5421a361 AP_Baro: ask for maximum poll rate for PX4 2013-01-21 08:27:02 +11:00
Andrew Tridgell 74f7b0f218 AP_Baro: added accumulate method to PX4 driver, and fixed scaling 2013-01-20 22:13:21 +11:00
Andrew Tridgell 0655b1a925 HAL_PX4: fixed thread_running on failed startup 2013-01-20 22:13:20 +11:00
Andrew Tridgell 16d72ca160 AP_InertialSensor: update PX4 driver to use read() method 2013-01-20 22:13:20 +11:00
Andrew Tridgell 6119201307 AP_AHRS: ensure compass is non-NULL for set_board_orientation() 2013-01-17 17:23:34 +11:00
Andrew Tridgell 7294d9ef35 AP_Menu: fixed build with older compilers
avoids relocation truncated to fit error
2013-01-17 07:26:26 +11:00
Andrew Tridgell 76092eb590 AP_HAL: remove unused peek() interface from UART drivers
this is a bit tricky to implement on some platforms, and is unused
anyway
2013-01-16 14:43:18 +11:00
Andrew Tridgell e852d6300f AP_HAL_AVR: fixed multi-channel RC output 2013-01-16 14:21:55 +11:00
James Bielman 4fa7bb1486 Add AVR compatibility header for missing math.h definitions.
- Define float versions of math functions to the double versions
  on AVR (eg. #define sinf sin).
- These macros appear to be missing in older versions of avr-libs.
- Include AP_Math.h rather than math.h to get these definitions.
2013-01-16 13:52:17 +11:00
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Andrew Tridgell d00b06d449 Filter: added a butter filter to example 2013-01-16 09:15:35 +11:00
Andrew Tridgell befc6b7b9b Filter: fixed butter filter build on px4 2013-01-16 09:15:22 +11:00
Andrew Tridgell 2ce18f588b AP_HAL: added AP_HAL_Macros.h
this adds a define for constexpr, allowing code to build either with
or without -std=gnu++0x
2013-01-16 09:12:55 +11:00
Pat Hickey 53ea7c564e Butter filter: needs header guards 2013-01-15 12:47:43 -08:00
Jonathan Challinger c66571b87d Filter: added 2nd-order butterworth filters. 2013-01-14 19:18:47 -08:00
Andrew Tridgell c6b006cf5f DataFlash: move log reading logic into common library 2013-01-15 14:03:51 +11:00
Andrew Tridgell bd9c61562f HAL_PX4: added -d command line option to app
allows control of serial device
2013-01-14 16:21:27 +11:00
Andrew Tridgell 64a8a8e4c9 HAL_PX4: fixed using mavlink on the console
this disables the ONLCR termios flag, which was injecting extra
carriage returns in the output
2013-01-14 16:21:27 +11:00
Andrew Tridgell 4c4b6afaff HAL_AVR_SITL: fixed log dump
the sockets need to default blocking, and only be non-blocking per
call

fixes issue #9
2013-01-14 08:26:29 +11:00
Andrew Tridgell 4609114a81 HAL_Empty: fixed example build 2013-01-14 07:03:34 +11:00
Andrew Tridgell a3556c8cf8 HAL_AVR: fixed example build 2013-01-14 07:03:25 +11:00
Andrew Tridgell d844a1ba3c AP_InertialSensor: fixed PX4 example build 2013-01-13 21:10:53 +11:00
Andrew Tridgell 98a55bf2a1 AP_Limits: removed old declaration 2013-01-13 20:46:44 +11:00
Randy Mackay 109b1069d8 AP_InertialNav: added constraint to how large local accelerometer offset corrections can become 2013-01-13 19:55:09 +11:00
Andrew Tridgell f683cff9e2 DataFlash: speed up SPI transfers in DataFlash_APM1 2013-01-13 19:26:43 +11:00
Andrew Tridgell 6bd361b9cd OpticalFlow: make surface_quality uint8_t 2013-01-13 17:53:54 +11:00
Andrew Tridgell f644a356c9 AP_AHRS: document more rotation combinations 2013-01-13 17:32:48 +11:00
Andrew Tridgell 38062bbb6d AP_Math: support some more rotation combinations 2013-01-13 17:32:48 +11:00
Andrew Tridgell 848fc3e32d AP_AHRS: added AHRS_ORIENTATION parameter 2013-01-13 17:32:48 +11:00
Andrew Tridgell d7996acdf7 AP_InertialSensor: added set_board_orientation() method 2013-01-13 17:32:48 +11:00
Andrew Tridgell 60a4447a86 AP_Compass: added set_board_orientation() method 2013-01-13 17:32:48 +11:00
Andrew Tridgell 8015f0f626 DataFlash: update SITL implementaion for new API 2013-01-13 17:31:43 +11:00
Andrew Tridgell 9ef1f8509b DataFlash: update test code for new macros 2013-01-13 17:31:42 +11:00
Andrew Tridgell 83b074dd87 DataFlash: moved macros into common header 2013-01-13 17:31:42 +11:00
Andrew Tridgell f3005c4267 DataFlash: use bulk SPI transfer() method
this reduces the per-byte overhead of flash logging to about 3.9 usec
2013-01-13 17:31:42 +11:00
Andrew Tridgell a06202e750 HAL_SMACCM: added bulk SPI transfer() method 2013-01-13 17:31:42 +11:00
Andrew Tridgell 3dc0a990a1 HAL_Empty: added bulk SPI transfer() method 2013-01-13 17:31:42 +11:00
Andrew Tridgell b5b7fd2f9a HAL_AVR: added bulk transfer() method
this is quite a lot faster than the byte at a time method
2013-01-13 17:31:42 +11:00
Andrew Tridgell 6415f00ce3 AP_HAL: added a bulk transfer() method
very useful for dataflash
2013-01-13 17:31:42 +11:00
Pat Hickey af8f576c67 AP_HAL_SMACCM: add LICENSE file 2013-01-12 11:54:19 -08:00
Pat Hickey 3d0a4394b6 DataFlash Empty: conform to blockread/write virtual if 2013-01-12 10:44:05 -08:00
Andrew Tridgell 7274d847f8 DataFlash: update for new block API 2013-01-12 17:21:21 +11:00
Andrew Tridgell 28a0ba6c4a DataFlash: added block based dataflash writes
these are about 10x faster than the old writes
2013-01-12 17:21:04 +11:00
Andrew Tridgell 252d11ccfa AP_GPS: initialise _step to zero in all drivers
new() does not zero-fill memory
2013-01-12 16:04:23 +11:00
Andrew Tridgell 64734dc51c AP_Scheduler: show scheduler task slips
this is when a task doesn't run at the desired rate
2013-01-12 13:04:52 +11:00
Andrew Tridgell 1cb64dacf9 AP_Scheduler: expose debug variable 2013-01-12 12:06:55 +11:00
Andrew Tridgell 7ddadcf34e AP_Scheduler: added new scheduler library
this will be used for main loop control
2013-01-12 12:02:57 +11:00
Andrew Tridgell 30b50a858d Filter: fixed a warning on PX4 2013-01-11 21:17:34 +11:00
Andrew Tridgell 6142eac4b4 AP_InertialSensor: simplify get_delta_time() API
use a single float return rather than two APIs.

This also changes the MPU6k driver to match the new 2.9 behaviour of
using the MPU6k sample timing instead of micros()
2013-01-11 21:17:21 +11:00
Andrew Tridgell 7c7a215934 HAL_PX4: fixes for new Scheduler API 2013-01-11 12:25:26 +11:00
Andrew Tridgell 2fe4656a50 Merge pull request #4 from GaloisInc/master
Thanks Pat!
2013-01-10 17:24:59 -08:00
Andrew Tridgell 6aecdb3d7d HAL_AVR: tweak the default serial buffer sizes
this reduces memory fragmentation a lot, saving memory
2013-01-11 11:16:09 +11:00
Andrew Tridgell 0cb8192861 HAL_AVR: ensure we can handle a 256 size buffer 2013-01-11 10:32:52 +11:00
Andrew Tridgell cf04935438 HAL_AVR: make Console a direct wrapper of uartA
this saves a bunch of memory, and we don't really need separate
console support on AVR
2013-01-11 10:23:51 +11:00
Pat Hickey 7b5153c79b AP_HAL_AVR_SITL: main calls system_initialized 2013-01-10 14:37:22 -08:00
Pat Hickey 4d5d08ad10 AP_HAL_Empty: main calls system_initialized 2013-01-10 14:37:07 -08:00
Pat Hickey 2b621dc579 AP_HAL_AVR: main calls system_initialized 2013-01-10 14:36:53 -08:00
James Bielman 25d078e2bd AP_Baro_MS5611: Don't panic if taking semaphore fails during init.
- The MPU6000 holds on to the I2C semaphore for quite some time during
  init, which caused a panic when the MS5611 is also on I2C.
2013-01-10 14:22:41 -08:00
James Bielman edfddbab57 AP_HAL_SMACCM: Implement new scheduler methods.
- Set the system initialized after call to "setup" in main.
2013-01-10 14:22:15 -08:00
Pat Hickey 910e09fc96 AP_InertialSensor_MPU6000: fix sync/async semaphore usage with new scheduler 2013-01-10 14:12:19 -08:00
Pat Hickey 83adb72f16 AP_HAL_Empty: Stub out new Scheduler methods 2013-01-10 14:07:44 -08:00
Pat Hickey a228519b18 AP_HAL_AVR_SITL: Implement new Scheduler methods 2013-01-10 14:07:43 -08:00
Pat Hickey 930a789b25 AP_HAL_AVR: Implement new scheduler methods 2013-01-10 14:07:43 -08:00
Pat Hickey 7a0f95c11c AP_HAL: add Scheduler methods in_timerprocess, system_initialize 2013-01-10 14:07:43 -08:00
Pat Hickey 6d64bf2921 AP_HAL_SMACCM: Semaphores fixup 2013-01-10 13:52:30 -08:00
James Bielman 9abf3d2c0f AP_HAL_SMACCM: Panic if taking a semaphore held by current thread.
- Catches bugs with attempted recursive semaphore taking.
2013-01-10 13:16:43 -08:00
Andrew Tridgell ea3b405959 MAVLink: moved CRC table into program
this saves 256 bytes of memory
2013-01-10 21:28:07 +11:00
Andrew Tridgell f3783b0306 AP_GPS: put SIRF init_messages in progmem
this saves 32 bytes of memory
2013-01-10 21:27:41 +11:00
Andrew Tridgell dbad61816b AP_InertialSensor: only build Oilpan driver on APM1 2013-01-10 21:01:55 +11:00
Andrew Tridgell 2c603a0960 AP_Baro: only build BMP085 driver on APM1 2013-01-10 21:01:07 +11:00
Andrew Tridgell 63634c4e8a HAL_SMACCM: fixed build warning 2013-01-10 16:29:46 +11:00
Andrew Tridgell 130aaae168 HAL_AVR: switched to 8 bit mask
max buffer size is now 256. This makes serial faster
2013-01-10 16:29:34 +11:00
Andrew Tridgell 03b26c7d6d AP_Motors: fixed setup of ESC update speeds 2013-01-10 15:52:46 +11:00
Pat Hickey ea6147162a AP_HAL_SMACCM: fix to goofed PPM_MAX_CHANNELS macro 2013-01-09 17:24:23 -08:00
Pat Hickey 8f5da03f93 AP_HAL_SMACCM: guard compilation on CONFIG_HAL_BOARD 2013-01-09 13:32:34 -08:00
Pat Hickey 59365f1b90 AP_HAL_AVR: UARTDriver guard needs AP_HAL_Boards.h 2013-01-09 13:32:13 -08:00
Pat Hickey ab5522a20a AP_HAL_SMACCM: remove meaningless example dir 2013-01-09 13:15:10 -08:00
James Bielman 0160a10ba7 AP_HAL_SMACCM: Increase scheduler stack sizes. 2013-01-09 11:19:51 -08:00
James Bielman 46b0742710 AP_HAL_SMACCM: Fix pin conflict between uartC and I2C.
- uartC is currently disconnected.
- Set uartB to USART6 for GPS communication.
2013-01-09 11:19:51 -08:00
James Bielman 7827a4a54a ArduCopter: Add AP_HAL_SMACCM support.
- Added default configuration to "config.h".
- Added main function to run under FreeRTOS with HWF4.
2013-01-09 11:19:51 -08:00
James Bielman 4e0806186f AP_HAL_SMACCM: Implement RCInput driver. 2013-01-09 11:19:51 -08:00
James Bielman 8e38ef6567 MPU6000: Flip Y and Z axes for SMACCM_HAL.
- The accelerometer is upside-down on the PX4FMU vs the APM2.
2013-01-09 11:19:51 -08:00
James Bielman 1309b7332a MPU6000: Use signed addition when accumulating readings.
- Fixes very erratic accel readings on the PX4 board.
2013-01-09 11:19:51 -08:00
Andrew Tridgell 8cb0ed364a AP_Baro: read 4 pressure values for every temperature value on BMP085 2013-01-09 23:44:26 +11:00
Andrew Tridgell 1ce1fa3864 AP_Baro: update example to use accumulate() 2013-01-09 23:06:24 +11:00
Andrew Tridgell 8ceabc97f1 AP_Baro: added accumulate() function
this allows us to read the BMP085 much faster
2013-01-09 23:05:17 +11:00
Andrew Tridgell 8f424cdf21 AP_Compass: ensure we check we got the semaphore 2013-01-09 20:42:20 +11:00
Andrew Tridgell e76c77e86a AP_HAL: mark semaphore take operations as WARN_IF_UNUSED
this prevents common bugs
2013-01-09 20:42:02 +11:00
Andrew Tridgell 90523ae975 AP_HAL: added WARN_IF_UNUSED macro
useful for key functions
2013-01-09 20:41:37 +11:00
Andrew Tridgell 8e1bee3a5e HAL_AVR: make _taken volatile 2013-01-09 20:33:37 +11:00
Andrew Tridgell f48790a56e AP_InertialSensor: poll for new data in num_samples_available()
this lowers the latency for new data
2013-01-09 20:31:09 +11:00
Andrew Tridgell 4ab1cddd15 AP_InertialSensor: ensure we always have the SPI semaphore for MPU6k 2013-01-09 20:30:20 +11:00
Andrew Tridgell 9b972af307 AP_Baro: skip timer if we don't get the SPI semaphore 2013-01-09 20:27:48 +11:00
Andrew Tridgell dc66708856 MAVLink: cope with available() returning -1 2013-01-09 13:31:00 +11:00
Andrew Tridgell 7be1335b3a AP_Param: removed copy_name() and add token to find_by_index()
this allows callers to avoid another var_info traverse
2013-01-09 13:30:51 +11:00
Andrew Tridgell c9fe7fe932 MAVLink: use buffer send and fast CRC if possible 2013-01-08 14:37:40 -08:00
Andrew Tridgell df91734883 MAVLink: import latest upstream messages and headers 2013-01-08 14:37:40 -08:00
Andrew Tridgell feeebae03f GCS_MAVLink: added comm_send_buffer()
this reduces the overhead of sending messages
2013-01-08 14:37:39 -08:00
Andrew Tridgell 7f20f720e8 HAL_AVR: started I2C in high speed mode
this speeds up the compass a lot
2013-01-08 14:37:39 -08:00
Andrew Tridgell c8ae665ac3 AP_Param: added copy_name_token()
this avoids an expensive var_info traversal on every copy_name call
2013-01-08 14:37:39 -08:00
Andrew Tridgell 44285cfbad DataFlash: fixed a semaphore bug in APM1 dataflash code 2013-01-08 14:37:39 -08:00
Andrew Tridgell b39166b71a MPU6000: fixed minor timing bug
if we miss a sample due to SPI contention we shouldn't update last
sample time
2013-01-07 11:07:29 +11:00
Andrew Tridgell f93a7d50eb AP_GPS: fixed debug code 2013-01-07 11:06:53 +11:00
Andrew Tridgell 5ac23d358f HAL_PX4: update for new i2cdriver interface 2013-01-07 11:05:30 +11:00
Andrew Tridgell 319e1a4e84 HAL_PX4: support setting servo rate 2013-01-07 11:05:30 +11:00
Pat Hickey 0660873fa7 AP_HAL_AVR: pull-up UART RX lines to fix GPS spoofing (Tridge)
Tridge discovered this bugfix:
https://groups.google.com/d/topic/drones-discuss/aek6LJeYQo8/discussion
2013-01-05 21:03:02 -08:00
Pat Hickey 1b7b096b05 AP_Relay: fix pin used on APM2/SITL per Sando on drones-discuss
* My bad, thanks for the fix Sandro
2013-01-05 13:51:59 -08:00
Andrew Tridgell f7e5f88199 AP_GPS: make UBLOX driver a bit more robust 2013-01-05 20:39:31 +11:00
Andrew Tridgell 3b0398dc14 AP_GPS: fixed UBLOX example for PX4 2013-01-05 20:39:30 +11:00
Pat Hickey dd27984eac SITL: instansiate EmptyI2CDriver with EmptySemaphore 2013-01-04 16:20:22 -08:00
Pat Hickey 0db60464f7 AP_HAL_Empty: add semaphore to I2CDriver 2013-01-04 16:19:51 -08:00
Pat Hickey 4c31cc0c2b AP_HAL_AVR: add semaphore to I2CDriver 2013-01-04 16:19:38 -08:00
Pat Hickey 3da864499d AP_HAL Semaphore: don't use limits, they don't work on c++ 2013-01-04 16:19:15 -08:00
James Bielman bb4474fa6d AP_HAL_SMAACM: Add timeout for SPI transfers.
- Detects lockup in the lower level SPI driver.
- Add scheduler task tags for FreeRTOS debugging.
2013-01-04 15:44:21 -08:00
James Bielman eca1417858 AP_HAL: Add semaphores to I2C driver.
- Guard I2C transactions with this semaphore in the MS5611 and
  HMC5843 drivers.
2013-01-04 15:43:43 -08:00
Andrew Tridgell 30447018d5 HAL_PX4: handle %S in format strings 2013-01-05 08:10:07 +11:00
Andrew Tridgell c16db01395 HAL_SITL: add pragma pack
may be needed on some systems
2013-01-05 08:01:30 +11:00
Andrew Tridgell 08d518e07f HAL_PX4: switch to libc vdprintf()
vdprintf has now been added to NuttX
2013-01-05 08:01:10 +11:00
Andrew Tridgell c15bf95e19 AP_Baro: fixed example build on AVR 2013-01-04 22:45:02 +11:00
Andrew Tridgell 84bd10d279 HAL_PX4: minor cleanups 2013-01-04 22:27:04 +11:00