Andrew Tridgell
dcef9bb3b8
AP_InertialSensor: converted the MPU9250 driver to new API
10 years ago
Andrew Tridgell
dcdb53584b
AP_InertialSensor: use lockless structures in MPU9250 driver
...
this avoids suspending timers when transferring data between main
thread and SPI read thread
11 years ago
Andrew Tridgell
a14f8dbd0a
AP_InertialSensor_MPU9250: use micros64() and millis64()
11 years ago
Andrew Tridgell
3c2ab31415
AP_InertialSensor: get rid of data_ready for MPU9250
...
when running off a 1kHz timer and reading at 1kHz it is better to
double sample than it is to skip a sample, as skipping samples will
throw the filter off, whereas a double sample will have minimal effect
11 years ago
Andrew Tridgell
9e01c657e5
AP_InertialSensor: update MPU9250 driver for 1kHz operation
...
use a time base sample wait, with 1kHz sampling
11 years ago
Andrew Tridgell
50068a7c6a
AP_InertialSensor: fixed default orientation for PXF board MPU9250
11 years ago
Víctor Mayoral Vilches
5e5319e23b
AP_InertialSensor: MPU9250 cleaning
11 years ago
Mikhail Avkhimenia
34da221c3d
AP_InertialSensor: Use MPU9250 DRDY pin only on boards that support it
11 years ago
Andrew Tridgell
d1ba78002d
AP_InertialSensor: added paranoid check for DRDY pin
11 years ago
Andrew Tridgell
6f9965cc22
AP_InertialSensor: fixed setup of DRDY pin on MPU9250
11 years ago
Andrew Tridgell
6a6dbe5790
AP_InertialSensor: added check for WHOAMI on MPU9250
11 years ago
Andrew Tridgell
abb53eb9a2
AP_InertialSensor: simplify using HAL board subtypes
11 years ago
Andrew Tridgell
848b563fc3
AP_InertialSensor: rotate acccel/gyro for PXF
11 years ago
Víctor Mayoral Vilches
aa60a89cda
AP_InertialSensor_MPU9250: Fix SPI CS.
11 years ago
Víctor Mayoral Vilches
5e7e28a83e
AP_InertialSensor_MPU9250.cpp: Update the DRDY pin.
11 years ago
Víctor Mayoral Vilches
fac3d1c271
AP_InertialSensor_MPU9250: SPI userspace sensor driver.
...
InvenSense MPU9250 sensor driver and test code (available under
libraries/examples/).
11 years ago
Andrew Tridgell
ece01da10e
AP_InertialSensor: fixed _dump_registers() for MPU6000
...
need to take the semaphore to prevent bus errors
11 years ago
Andrew Tridgell
b1c5f23bbd
AP_InertialSensor: make get_delta_time() const
...
allows use from AP_NavEKF
11 years ago
Andrew Tridgell
a0688a69d4
AP_InertialSensor: generalise the accel/gyro calibration for N sensors
11 years ago
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.
11 years ago
Andrew Tridgell
80def01fbe
AP_InertialSensor: fixed semaphore error on startup for MPU6000
11 years ago
Andrew Tridgell
f5299e2e11
AP_InertialSensor: added healthy check for PX4 and HIL
...
used to detect bad accels
11 years ago
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
11 years ago
Andrew Tridgell
b98bcbf715
AP_InertialSensor: automatically lower bus speed on mpu6k bad reads
11 years ago
Andrew Tridgell
bdc40cc7df
AP_InertialSensor: try to lower SPI bus speed on errors
11 years ago
Andrew Tridgell
9833900f91
AP_InertialSensor: run MPU6000 sensor register reads at 8MHz
...
run other register IO at 500kHz
11 years ago
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
12 years ago
Andrew Tridgell
dda68bddcb
AP_InertialSensor: updates for AP_HAL::MemberProc
12 years ago
Andrew Tridgell
03036c632d
AP_InertialSensor: use new scheduler API
12 years ago
Randy Mackay
f7ba0438ef
InertialSensor: remove DMP
...
this saves 3K of flash
12 years ago
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.
12 years ago
Andrew Tridgell
1ec5cbed81
AP_InertialSensor: removed SMACCM support
12 years ago
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.
12 years ago
Andrew Tridgell
76e20150e9
AP_InertialSensor: ensure parent class is initialised in instance classes
12 years ago
Randy Mackay
af13f6795c
INS: switch to global definition of GRAVITY_MSS
...
saves 4 bytes of RAM
12 years ago
Randy Mackay
318a831b57
INS: set default filter to 20hz for APM2.x and PX4
12 years ago
Andrew Tridgell
a63275d284
AP_InertialSensor: expand register range in MPU6000 _dump_registers()
12 years ago
Andrew Tridgell
7b1245937c
AP_InertialSensor: always sample at 200Hz in MPU6000
...
this changes the sampling to 200Hz regardless of requested rate, and
it is downsampled inside num_samples_available() using a shift. This
gives better noise resistance in ArduPlane.
This patch also makes it possible to update the filter frequency while
running, which is very useful for bench testing with a vibration
source
12 years ago
Randy Mackay
bad81a5113
AP_InertialSensor_MPU6k: remove unnecessary check of sign when receiving fifo packet from dmp
12 years ago
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.
12 years ago
Andrew Tridgell
d7996acdf7
AP_InertialSensor: added set_board_orientation() method
12 years ago
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()
12 years ago
Pat Hickey
910e09fc96
AP_InertialSensor_MPU6000: fix sync/async semaphore usage with new scheduler
12 years ago
James Bielman
8e38ef6567
MPU6000: Flip Y and Z axes for SMACCM_HAL.
...
- The accelerometer is upside-down on the PX4FMU vs the APM2.
12 years ago
James Bielman
1309b7332a
MPU6000: Use signed addition when accumulating readings.
...
- Fixes very erratic accel readings on the PX4 board.
12 years ago
Andrew Tridgell
f48790a56e
AP_InertialSensor: poll for new data in num_samples_available()
...
this lowers the latency for new data
12 years ago
Andrew Tridgell
4ab1cddd15
AP_InertialSensor: ensure we always have the SPI semaphore for MPU6k
12 years ago
Andrew Tridgell
b39166b71a
MPU6000: fixed minor timing bug
...
if we miss a sample due to SPI contention we shouldn't update last
sample time
12 years ago
James Bielman
d84ba8ef59
Use HAL suspend/resume timer procs rather than atomic.
...
- Preparation for removing begin/end atomic.
12 years ago
Pat Hickey
d808c19c10
AP_InertialSensor_MPU6000: uses new semaphores
...
* some refactoring to fix differences between timerprocess
and non-timerprocess usage
12 years ago