Commit Graph

303 Commits

Author SHA1 Message Date
Andrew Tridgell 4c43cd9775 AP_InertialSensor: fixes for HAL_GPIO_* 2014-06-02 10:42:35 +10:00
Andrew Tridgell 65fd25fb5a AP_InertialSensor: fixed example build 2014-05-18 08:08:19 +10:00
Andrew Tridgell 8533aecf18 AP_InertialSensor: fixed example build 2014-05-16 21:24:25 +10:00
Andrew Tridgell 086142580a AP_InertialSensor: added VibTest sketch
logs all accel data at high rate to SD card
2014-05-15 21:14:21 +10:00
Emile Castelnuovo 06744ea7d2 AP_InertialSensor: new files and definitions for VRBRAIN board 2014-04-08 16:19:19 +10:00
Andrew Tridgell 2763393908 AP_InertialSensor: fixed some compiler warnings 2014-03-24 12:52:16 +11:00
Andrew Tridgell 731f980327 AP_InertialSensor: fixed example build 2014-03-19 12:13:47 +09:00
Jonathan Challinger e81d2e9584 AP_InertialSensor: Correct out-of-bounds array access that was causing SITL to crash 2014-02-28 17:25:54 +11:00
Andrew Tridgell 2c85a7ba56 AP_InertialSensor: expose get_primary_accel() for use in AHRS 2014-02-27 16:27:46 +11:00
Andrew Tridgell 840f1b9a1e AP_InertialSensor: make HIL timing more accurate
needed for 400Hz replay
2014-02-27 08:10:42 +11:00
Andrew Tridgell 6732d6c79b AP_InertialSensor: enable get_accel_count() and get_gyro_count() APIs for HIL 2014-02-23 19:10:07 +11:00
Andrew Tridgell 0e18079c47 AP_InertialSensor: allow HIL sensors to support multiple instances
this allows log replay to test both sets of sensors on a Pixhawk log
2014-02-23 08:16:33 +11:00
Randy Mackay 33fe778cdd InertialSensor_PX4: resolve compiler warning 2014-02-21 13:53:34 +09:00
Andrew Tridgell fe0cb23733 AP_InertialSensor: fixed HIL for 400Hz INS 2014-02-19 10:29:00 +11:00
Mike McCauley 2c94a40310 AP_InertialSensor: AP_InertialSensor_Flymaple Remove unnecessary
comment
2014-02-17 05:56:37 +11:00
Mike McCauley dd6abb49a9 AP_InertialSensor: AP_InertialSensor_Flymaple::healthy() was required after
all.
2014-02-17 05:56:37 +11:00
Mike McCauley 0a43cf8c5c AP_InertialSensor: AP_InertialSensor_Flymaple removed redundant definition of
healthy().
2014-02-17 05:56:37 +11:00
Mike McCauley f7279aa13f AP_InertialSensor: AP_InertialSensor_Flymaple implement get_gyro_health
and get_accel_health.
2014-02-17 05:56:37 +11:00
Andrew Tridgell f9d0747750 AP_InertialSensor: fixed example build 2014-02-15 06:39:35 +11:00
Andrew Tridgell 3617c65af7 AP_InertialSensor: make HIL treat time like PX4 does 2014-02-15 05:48:20 +11:00
Andrew Tridgell b1c5f23bbd AP_InertialSensor: make get_delta_time() const
allows use from AP_NavEKF
2014-02-15 05:29:47 +11:00
Randy Mackay b7565affcd INS: add support for 400hz for PX4 2014-02-15 05:27:33 +11:00
Andrew Tridgell a95a3142e0 AP_InertialSensor: use fixed size arrays
apparently helps SITL build on MacOS
2014-02-08 19:32:26 +11:00
Andrew Tridgell 045efdb084 AP_InertialSensor: fixed example builds 2014-01-30 13:33:38 +11:00
Andrew Tridgell 58d3729d16 AP_InertialSensor: fixed default health functions
this fixes INS on APM1. Thanks to Mike McCauley for noticing this!
2014-01-22 22:08:28 +11:00
Don Gagne 68b3b31499 Param doc typo 2014-01-18 10:18:58 +09:00
Randy Mackay 965e5b2dfd INS: check for good calibration for 10seconds
Shortened gyro calibration commit also halved the total time we would
look for a good gyro calibration.  This restores the total time to 10
seconds.
2014-01-17 12:48:11 +09:00
Randy Mackay 1f76ada9dd INS: shortened gyro calibration
Removed delays before calibration, reduced number of samples taken,
widened convergence criteria
2014-01-16 13:40:49 +09:00
Randy Mackay a400ddeb88 INS: replace APM with vehicle in accel calibrate 2013-12-28 10:41:49 +09:00
Andrew Tridgell 8dd34f8bc4 AP_InertialSensor: fixed example build 2013-12-17 11:51:37 +11:00
Andrew Tridgell 6d39cf5e49 AP_InertialSensor: another attempt at fixing the spurious bad gyro health warnings
cope with _get_sample() not being called for a while
2013-12-14 15:47:49 +11:00
Andrew Tridgell 99e2dc87c9 AP_InertialSensor: prevent INS healthy errors while initialising
during gyro cal we shouldn't mark the gyro unhealthy
2013-12-13 20:47:24 +11:00
Andrew Tridgell 23a112c5d5 AP_InertialSensor: reduce the number of format string warnings 2013-12-11 17:29:27 +11:00
Andrew Tridgell 433ad19335 AP_InertialSensor: fixed loop limits
stops pointless operations
2013-12-11 14:57:13 +11:00
Andrew Tridgell e54fc6b8e3 AP_InertialSensor: make sure we wait for a sample before update() 2013-12-11 13:50:50 +11:00
Andrew Tridgell cba0cb963a AP_InertialSensor: auto-failover to working gyro and accel 2013-12-09 20:02:04 +11:00
Andrew Tridgell a0688a69d4 AP_InertialSensor: generalise the accel/gyro calibration for N sensors 2013-12-09 17:34:06 +11:00
Andrew Tridgell d9b6f7f0f7 AP_InertialSensor: implement up to two sensors on PX4 2013-12-09 17:34:05 +11:00
Andrew Tridgell 2753449e75 AP_InertialSensor: added support for multiple accel/gyro devices
this makes it possible to ask for the gyro and accel vectors from
secondary INS devices.
2013-12-09 17:34:05 +11:00
Randy Mackay fd9b115d01 INS: move Product ID to @User Advanced 2013-11-26 22:18:28 +09:00
Andrew Tridgell 71bb462ad0 AP_InertialSensor: use fabsf() 2013-11-15 10:43:10 +11:00
Andrew Tridgell aef9289476 AP_InertialSensor: added INS_PRODUCT_ID values 2013-11-15 10:43:10 +11:00
Andrew Tridgell f10a4b04ae AP_InertialSensor: make PX4 healthy call _get_sample()
this prevents a false positive during times like arming where we are
not reading the sensors
2013-11-10 17:03:16 +11:00
Andrew Tridgell 80def01fbe AP_InertialSensor: fixed semaphore error on startup for MPU6000 2013-11-09 11:26:50 +11:00
Andrew Tridgell f5299e2e11 AP_InertialSensor: added healthy check for PX4 and HIL
used to detect bad accels
2013-11-07 13:53:59 +11:00
Andrew Tridgell 9ecd889e9d AP_InertialSensor: detect bad MPU6000 SPI transactions and lower bus speed
this uses bad data or bad INT_STATUS values from the MPU6000 to detect
the sensor running too fast and lower bus speed
2013-11-07 12:48:17 +11:00
Andrew Tridgell b98bcbf715 AP_InertialSensor: automatically lower bus speed on mpu6k bad reads 2013-11-07 12:48:16 +11:00
Andrew Tridgell bdc40cc7df AP_InertialSensor: try to lower SPI bus speed on errors 2013-11-07 12:48:16 +11:00
Andrew Tridgell 1cd070a2e7 AP_InertialSensor: use const reference returns
saves some vector copies
2013-11-04 21:21:42 +11:00
Andrew Tridgell f4dde44b8d AP_InertialSensor: SITL doesn't use Oilpan code any more 2013-11-02 21:41:11 +11:00
Mike McCauley fe6cacf081 AP_InertialSensor: Minor correction to comments in AP_InertialSensor_Flymaple.cpp 2013-10-14 11:34:47 +10:00
Andrew Tridgell 7831113f84 AP_InertialSensor: yield the CPU for the right time in wait_for_sample()
this improves timing performance
2013-10-14 08:45:58 +11:00
Andrew Tridgell 8532e2bff8 AP_InertialSensor: fixed timing of PX4 sensor samples 2013-10-13 22:15:50 +11:00
Andrew Tridgell 9833900f91 AP_InertialSensor: run MPU6000 sensor register reads at 8MHz
run other register IO at 500kHz
2013-10-13 11:03:08 +09:00
Andrew Tridgell b3af59cc0c AP_InertialSensor: don't build L3G4200D example 2013-10-10 09:54:20 +11:00
Andrew Tridgell a04c056598 AP_InertialSensor: remove unused get_last_sample_time_micros() 2013-10-10 09:54:19 +11:00
Andrew Tridgell 5d685385eb AP_InertialSensor: use gyro sample count on L3G4200D
this gives more even timing in ArduCopter
2013-10-08 19:20:34 +11:00
Andrew Tridgell 6444b0bddd AP_InertialSensor_L3G4200D: a sample is only available if gyro had a sample 2013-10-08 19:20:34 +11:00
Andrew Tridgell e5e4cdee18 AP_InertialSensor: added wait_for_sample() API call
this waits for a new INS sample to arrive, using whatever method is
most efficient on each INS type
2013-10-08 17:31:15 +11:00
Andrew Tridgell c17a5e5ed1 AP_InertialSensor: added a small delay in accel calibration
allows threads to run on Linux
2013-10-08 11:50:54 +11:00
Andrew Tridgell 12af23bb7c AP_InertialSensor: added L3G4200D example 2013-10-08 11:50:53 +11:00
Andrew Tridgell 1aabd7155e AP_InertialSensor: added L3G4200D driver
this is for a cheap ebay 10DOF sensor
2013-10-08 11:50:53 +11:00
Mike McCauley c90c1b9998 AP_InertialSensor: Improvements to Flymaple sensors
Fix a bug that caused hang after 71 minutes. Use I2CDriver semaphore.
Remove test for in_accumulate: not needed.
2013-10-04 07:21:55 +10:00
Mike McCauley 9ea1108d4e AP_InertialSensor: Flymaple filter constructor arguments non non-zero 2013-10-04 07:21:55 +10:00
Andrew Tridgell dda68bddcb AP_InertialSensor: updates for AP_HAL::MemberProc 2013-09-30 21:06:42 +10:00
Andrew Tridgell 1191607036 AP_InertialSensor: enable Oilpan on Linux 2013-09-29 00:57:13 +10:00
Andrew Tridgell cf726c6642 AP_InertialSensor: rename Stub to HIL
more consistent with other drivers
2013-09-28 22:04:15 +10:00
Andrew Tridgell 03036c632d AP_InertialSensor: use new scheduler API 2013-09-28 21:24:03 +10:00
Andrew Tridgell 096660c4f9 AP_InertialSensor: mark flymaple as nobuild
won't build with build_examples.sh script
2013-09-27 16:57:13 +10:00
Mike McCauley e4eef61ec3 AP_InertialSensor: Flymaple sensors improvements
Flymaple sensors are now raw sampled at 800Hz, and LowPassFilter2p is used
to filter to the desired filter cutoff frequency.
Flymaple sensor polling is done in the main thread NOT in the timer
interrupts.
2013-09-27 15:45:59 +10:00
Mike McCauley 23429b6b9c AP_InertialSensor: Flymaple now polls sensors at 800Hz. More changes to
come...
2013-09-27 15:45:57 +10:00
Mike McCauley 29bced05bd AP_InertialSensor: Added examples/Flymaple for testing 2013-09-27 15:45:54 +10:00
Mike McCauley d11f952ef1 AP_InertialSensor: Formalise and document Flymaple Gyro scaling factor 2013-09-27 15:45:52 +10:00
Mike McCauley adfcdca074 AP_HAL_FLYMAPLE: Sensor reading improvements
I2C speed increased to 400kHz
Accelerometer 8g max, Normal power, 800Hz bandwidth
Gyros: 2000 degrees/sec, 256Hz LPF, 8kHz internal sample rate
2013-09-27 15:45:47 +10:00
Randy Mackay f7ba0438ef InertialSensor: remove DMP
this saves 3K of flash
2013-09-27 10:43:33 +09:00
Andrew Tridgell 14636e1cdf AP_InertialSensor: changed num_samples_available() to sample_available()
this makes the interface clearer. It also fixes a 3D accel cal bug.
2013-09-27 10:49:00 +10:00
Andrew Tridgell 1ec5cbed81 AP_InertialSensor: removed SMACCM support 2013-09-26 22:38:31 +10:00
Mike McCauley e4b5d0a3d6 AP_InertialSensor: Final Flymaple orientation fixes 2013-09-25 15:46:07 +10:00
Mike McCauley 276068356e AP_InertialSensor: Further Flymaple orientation fixes 2013-09-25 15:46:07 +10:00
Mike McCauley b02dbca9d4 AP_InertialSensor: fix orientation of Flymaple sensors 2013-09-25 15:46:07 +10:00
Mike McCauley 4d10a96077 AP_InertialSensor: Add flymaple support 2013-09-24 13:51:27 +10:00
Andrew Tridgell 770b7b5901 AP_InertialSensor: prevent a lockup in MPU6000 driver
thanks to the VRBrain port for noticing this bug.

Failing to get the semaphore is an expected error with the MPU6000, as
we read data both from timer context and mainline code. That means
semaphore conflicts are inevitable. We shouldn't consider them an
error, and shouldn't panic when some arbitrary number of them have
happened since boot.

Instead the wait_for_sample() code checks that we receive new data at
least every 50ms. That is a much safer test.
2013-09-23 22:48:36 +10:00
Andrew Tridgell 4d2bfe1078 AP_InertialSensor: fixed another example build 2013-09-19 21:09:34 +10:00
Andrew Tridgell e1aa6e3ff1 libraries: fixed examples for no flash_leds() callback 2013-09-19 18:38:28 +10:00
Andrew Tridgell f8e9d48a76 AP_InertialSensor: removed the flash_leds() callback
AP_Notify now handles this
2013-09-19 18:32:19 +10:00
Andrew Tridgell 7b3a674d66 AP_InertialSensor: added set_default_filter() method 2013-09-09 19:18:52 +10:00
Andrew Tridgell 396c4f30d2 AP_InertialSensor_PX4: don't set QUEUEDEPTH
the default of 2 samples is fine
2013-09-09 18:04:40 +10:00
Andrew Tridgell 8b80beadc4 PX4: make FMUv2 identify itself differently
so we can tell which is which in logs
2013-09-09 18:04:40 +10:00
Andrew Tridgell ff0f6bcd42 AP_InertialSensor: fixed example build 2013-09-07 21:03:59 +10:00
Andrew Tridgell 5caf2e0ea4 AP_InertialSensor: fixed example build 2013-08-30 13:01:39 +10:00
Andrew Tridgell 65a490c209 AP_InertialSensor: update for new notify API 2013-08-30 13:01:35 +10:00
Randy Mackay 5651bdbe3a INS: integrate AP_Notify 2013-08-30 13:01:35 +10:00
Andrew Tridgell e5ad9dbd15 AP_InertialSensor: switch PX4 driver to fixed time per sample model
this makes the driver much simpler, and does away with the need for an
accumulate function
2013-08-30 13:01:33 +10:00
Andrew Tridgell 38fe89d661 AP_InertialSensor: switch to non-averaging system for PX4 IMUs
always use the latest value, based on a lowpass filter in the driver
2013-08-30 13:01:33 +10:00
Andrew Tridgell 46c5d18585 AP_InertialSensor: disable averaging on FMUv2
the new filter from Leonard means we shouldn't average values, and
instead just use the last value
2013-08-30 13:01:33 +10:00
Julian Oes c3b27629ec AP_InertialSensor: run PX4 FMUv2 at 800Hz
this gives much better noise suppression
2013-08-30 13:01:33 +10:00
Randy Mackay effc829790 INS: relax accel offset check to 3.5 m/s/s
One user, Dusty, has found that even with offsets of 3.1 m/s/s
successful alt hold and loiter are possible
2013-07-13 10:43:07 +09:00
Randy Mackay 20ed00dcc9 AP_InertialSensor: relax accel offset sanity check 2013-06-25 14:19:42 +09:00
Andrew Tridgell c92069644d AP_InertialSensor: fixed indent-tabs-mode 2013-05-30 09:52:12 +10:00
Andrew Tridgell 807dbf9786 AP_InertialSensor: fixed a build warning 2013-05-24 11:21:42 +10:00