Commit Graph

451 Commits

Author SHA1 Message Date
Andrew Tridgell 5d0eb49114 AP_InertialSensor: calculate queue depth based on requested sample rate
this auto-scales the queue depth for plane, rover and copter
2015-03-12 12:50:30 +11:00
Andrew Tridgell ea49d1cd39 AP_InertialSensor: removed unused variable 2015-03-12 12:50:30 +11:00
Andrew Tridgell e6a4b9f68c AP_InertialSensor: check accel health during accel cal 2015-03-12 12:50:29 +11:00
Andrew Tridgell 875339f12a AP_InertialSensor: try to avoid a compiler fault in travis 2015-03-12 12:50:29 +11:00
Andrew Tridgell 786172aa4e AP_InertialSensor: removed 1D accel calibration
it is finally time to move on from this. We want to push people
towards better calibration and removing the 1D accel cal is the first
step
2015-03-12 12:50:28 +11:00
Andrew Tridgell a975520033 AP_InertialSensor: check range of accels in 3D calibration
during 3D accel cal it is possible to get data which passes the sphere
fit but which has very poor coverage and does not provide sufficient
data for a good result. This checks that each axis covers a range of
at least 12 m/s/s in body frame
2015-03-12 12:50:28 +11:00
Andrew Tridgell a8a8628515 AP_InertialSensor: added INS_CALSENSFRAME parameter
this allows us to detect if accel calibration was done in sensor frame
or not. If it was done in sensor frame then the accel calibration is
independent of AHRS_ORIENTATION, which makes it easier to move a board
to a new airframe without having to recalibrate.
2015-03-12 12:50:28 +11:00
Jonathan Challinger bc655ff0cc AP_InertialSensor_PX4: add optional debug 2015-03-12 12:50:28 +11:00
Jonathan Challinger 074ee49cd0 AP_InertialSensor_PX4: interleave accel and gyro samples by time 2015-03-12 12:50:28 +11:00
Jonathan Challinger addf80b669 AP_InertialSensor_PX4: explicitly configure sensors, publish deltas 2015-03-12 12:50:27 +11:00
Jonathan Challinger b5131b7b64 AP_InertialSensor: add coning.py example 2015-03-12 12:50:27 +11:00
Jonathan Challinger 2a547f329b AP_InertialSensor: allow backends to publish delta velocities and angles 2015-03-12 12:50:27 +11:00
Jonathan Challinger 155c173ed1 AP_InertialSensor: rename _rotate_and_offset to _publish 2015-03-12 12:50:27 +11:00
Jonathan Challinger 502446d821 AP_InertialSensor: use LowPassFilter2pVector3f 2015-03-12 12:50:27 +11:00
Randy Mackay 5f26a36060 INS: protect against two calibrations running at the same time 2015-03-09 17:58:38 +11:00
Randy Mackay f9c6e35d19 INS: add calibrating method 2015-03-09 17:58:38 +11:00
Randy Mackay b0e7990c90 INS: set gyro_cal_ok only after completing calibration 2015-03-09 17:58:37 +11:00
Andrew Tridgell aec7907571 AP_InertialSensor: updated comment on accel check in gyro cal 2015-03-09 17:58:36 +11:00
Andrew Tridgell 494e909703 AP_InertialSensor: ensure accel cal completion messages get through 2015-03-09 07:36:50 +11:00
Andrew Tridgell 38bde56523 AP_InertialSensor: continue finding best gyro after convergence
with multiple gyros if we are still calibrating one of the gyros then
keep looking for better values for the already converged gyros.
2015-03-08 07:49:38 +11:00
Andrew Tridgell 20a4c98bac AP_InertialSensor: use accelerometers to prevent bad gyro cal
if the board is rotating at a steady rate we can end up with a bad
gyro calibration. This can happen on a steadily moving platform such
as a ship.

This uses the accelerometers to detect the steady movement and not
accept the gyro calibration
2015-03-08 07:48:16 +11:00
Andrew Tridgell 434d094993 AP_InertialSensor: allow MAVLink packets to flow during accelcal
this uses the snoop functionality of GCS_MAVLink to allow the delay
callback to be used during accel calibration
2015-03-07 21:56:39 +11:00
Randy Mackay b650d39786 InertialSensor: remove product_id set to zero 2015-02-21 09:14:33 +09:00
Andrew Tridgell 9b2d44d6ed AP_InertialSensor: use delay_microseconds_boost()
this gives much more consistent timing for PX4
2015-02-16 12:19:13 +11:00
Andrew Tridgell f54d799bff AP_InertialSensor: added TIMING_DEBUG code for finding loop timing issues 2015-02-16 10:12:10 +11:00
Andrew Tridgell 04bef5ccf3 AP_InertialSensor: don't skip delay if we are a bit early
this produces a bit more even timing
2015-02-14 12:25:44 +11:00
Andrew Tridgell 4537acb898 AP_InertialSensor: change for new PX4 device paths 2015-02-14 12:25:43 +11:00
mirkix 460b434708 AP_InertialSensor: add apm1 oilpan support 2015-02-11 18:22:44 +11:00
Grant Morphett b511410b48 AP_InertialSensor: Changes to fix the warnings in rover sitl build.
We are starting the process of resolving all the warnings in the
ardupilot builds of all vehicles and platforms.
2015-02-11 18:16:45 +11:00
Emile Castelnuovo dae32984f1 AP_InertialSensor: use PX4 library for VRBRAIN boards. 2015-02-02 08:43:59 +11:00
Emile Castelnuovo 731329fc55 AP_InertialSensor: correction to AP_InertialSensor_VRBRAIN 2015-02-02 08:43:58 +11:00
LukeMike 6a93148b92 AP_InertialSensor: added library for VRBRAIN Inertial Sensor 2015-02-02 08:43:58 +11:00
Andrew Tridgell 6e62e1ca7b AP_InertialSensor: make calibrated() const 2015-02-01 14:13:54 +11:00
Randy Mackay b43dc3bdfb INS: fix example sketch 2015-01-28 17:15:42 +09:00
Andrew Tridgell 8b59c72eb9 AP_InertialSensor: cope with 2 IMUs in SITL 2015-01-20 19:47:45 +11:00
Andrew Tridgell b3ce56d34d AP_InertialSensor: fixed 2nd IMU in Replay
this makes for much more accurate replay runs
2015-01-20 09:20:47 +11:00
mirkix fa950a735e AP_InertialSensor: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
Andrew Tridgell 1b3c3c754d AP_InertialSensor: use correct ifdef for AK8963 2015-01-07 11:58:05 +11:00
Staroselskii Georgii f7f9cd2173 AP_InertialSensor: prevented MPU9250 from disabling I2C slaves 2015-01-07 08:41:13 +11:00
Andrew Tridgell 745b739ab7 AP_InertialSensor: make calibrated() function fast enough to call in flight
this will be used in plane to make AHRS SYS_STATUS unhealthy if a user
tries to fly with EKF enabled without a full 3D accel cal.

Note that it doesn't rely on using AP_Param load() to detect that a
value has been set, as some users are first doing a 3D cal then later
doing a 1D cal. In that case load() was returning true and would give
a false positive
2015-01-03 14:06:42 +11:00
Andrew Tridgell 06a72839ed AP_InertialSensor: fixed error detection on secondary IMUs
the break; was preventing error detection on lsm303d/l3gd20
2015-01-01 08:55:57 +11:00
Andrew Tridgell b9adc6e466 AP_InertialSensor: prefer sensors that have zero error counts
if a sensor has failed in flight then try not to use it if another
error-free sensor is available
2014-12-29 21:19:35 +11:00
Andrew Tridgell 7bb56e50aa AP_InertialSensor: fixed example build 2014-11-28 10:40:19 +11:00
Andrew Tridgell f84f432ecf AP_InertialSensor: allow gyro calibration to take up to 30 seconds
this gives time for the user time to get their battery hatches on and
hold the model steady. 5 seconds was just far too short
2014-11-22 18:27:51 +11:00
Andrew Tridgell 7c288e020b AP_InertialSensor: fixed detection of dead IMU
if a PX4 sensor does not give new data we need to avoid calling
_rotate_and_offset_*() to avoid marking it as healthy. Otherwise if
the MPU6k dies we won't switch to the LSM303D automatically
2014-11-16 12:30:33 +11:00
Andrew Tridgell 986b7bf894 AP_InertialSensor: fixed frequency to 16 bit in LDM303D and L3GD20 drivers 2014-11-11 17:06:22 +11:00
Andrew Tridgell 3518cf5480 AP_InertialSensor: fixed default MPU9250 orientation for NavIO 2014-11-04 16:18:35 +11:00
Andrew Tridgell ad7c612334 AP_InertialSensor: fixed SITL with new HIL code 2014-10-24 15:05:44 +11:00
Andrew Tridgell aeaa3c1e04 AP_InertialSensor: fixed build for VRBrain 2014-10-24 12:10:41 +11:00
Andrew Tridgell 40e83ceb1f AP_InertialSensor: simplify next sample time calculations
this makes the calculation much clearer
2014-10-24 12:10:40 +11:00
Andrew Tridgell 9dfbdb1e69 AP_InertialSensor: run the MPU6000 at 1kHz on fast CPUs
use a software filter and 1kHz sampling for better filtering if we
have a fast enough CPU to do it
2014-10-24 12:10:40 +11:00
Andrew Tridgell a047d1f569 AP_InertialSensor: moved default filter and sample_rate to frontend
this simplifies the backends and prevents code repitition
2014-10-24 12:10:40 +11:00
Andrew Tridgell 17b2214798 AP_InertialSensor: make it easier to add multiple backends
use _add_backend() to add new backends on startup
2014-10-24 12:10:40 +11:00
Andrew Tridgell bc5d79118d AP_InertialSensor: updated comments 2014-10-24 12:10:39 +11:00
Andrew Tridgell 3a9a5a9c18 AP_InertialSensor: implement gyro and accel health monitoring
sensor is healthy if it gave a sample on the last update()
2014-10-24 12:10:39 +11:00
Andrew Tridgell 586fa9a816 AP_InertialSensor: added product_id support
fill in parameter from first backend
2014-10-24 12:10:39 +11:00
Andrew Tridgell 520727e5bd AP_InertialSensor: fixed example build 2014-10-24 12:10:39 +11:00
Andrew Tridgell dbcd02f2be AP_InertialSensor: converted MPU9150 driver
untested conversion
2014-10-24 12:10:38 +11:00
Andrew Tridgell ff5f791343 AP_InertialSensor: converted flymaple driver to new API 2014-10-24 12:10:38 +11:00
Andrew Tridgell a42af0f2f1 AP_InertialSensor: use common AP_InertialSensor driver for PX4 and VRBRAIN 2014-10-24 12:10:38 +11:00
Andrew Tridgell 3ce7667e5a AP_InertialSensor: tidy up MPU6000 driver 2014-10-24 12:10:37 +11:00
Andrew Tridgell 2d47a07480 AP_InertialSensor: ported L3G4200D driver to new API 2014-10-24 12:10:37 +11:00
Andrew Tridgell deafcd6ddc AP_InertialSensor: improved timing in all drivers 2014-10-24 12:10:37 +11:00
Andrew Tridgell ff6d87f145 AP_InertialSensor: minor tidy up for HIL driver 2014-10-24 12:10:37 +11:00
Andrew Tridgell 85686c22ec AP_InertialSensor: converted the APM1/Oilpan driver to new API 2014-10-24 12:10:37 +11:00
Andrew Tridgell dcef9bb3b8 AP_InertialSensor: converted the MPU9250 driver to new API 2014-10-24 12:10:37 +11:00
Andrew Tridgell d48beb0c0f AP_InertialSensor: converted PX4 driver to new API 2014-10-24 12:10:37 +11:00
Andrew Tridgell ec11417705 AP_InertialSensor: converted HIL backend, which gets SITL working 2014-10-24 12:10:36 +11:00
Andrew Tridgell 448efc70a3 AP_InertialSensor: first steps in frontend/backend split
This converts the MPU6000 driver to a frontend/backend structure, and
disables all other drivers. They will be progressively re-enabled as
each is converted
2014-10-24 12:10:36 +11:00
Randy Mackay 834f2bea07 INS: add gyro_calibrated_ok_all method
This returns true if the gyros have been calibrated successfully
2014-10-09 10:00:07 +09:00
Randy Mackay 0803d79701 INS: param descriptions for ACC2, GYR2 2014-09-27 21:05:33 +09:00
Randy Mackay 74553e523d INS: add get_accel_health_all and get_gyro_health_all
Returns true only if all available accels or gyros are healthy
2014-09-03 11:22:46 +09:00
Randy Mackay 50ae5b2519 InertialSensor: reorder .cpp file to match .h
No functional changes
2014-09-03 11:19:36 +09:00
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
2014-08-22 21:13:11 +10:00
Andrew Tridgell 5c9e5fbc11 AP_InertialSensor: removed use of hrt_absolute_time() 2014-08-20 09:10:24 +10:00
Andrew Tridgell a14f8dbd0a AP_InertialSensor_MPU9250: use micros64() and millis64() 2014-08-20 08:02:34 +10:00
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
2014-08-19 20:03:33 +10:00
Andrew Tridgell 9e01c657e5 AP_InertialSensor: update MPU9250 driver for 1kHz operation
use a time base sample wait, with 1kHz sampling
2014-08-19 20:03:33 +10:00
Andrew Tridgell 532e9aace4 AP_InertialSensor: fixed timer bug in HIL sensors 2014-08-19 20:03:33 +10:00
Andrew Tridgell 12239de00d AP_InertialSensor: fix data_ready return for L3GD20 2014-08-19 10:14:20 +10:00
Andrew Tridgell 7286e7acd2 AP_InertialSensor: fixed build errors on APM2 2014-08-19 10:08:17 +10:00
Andrew Tridgell 50068a7c6a AP_InertialSensor: fixed default orientation for PXF board MPU9250 2014-08-19 10:08:16 +10:00
Víctor Mayoral Vilches 5e5319e23b AP_InertialSensor: MPU9250 cleaning 2014-08-19 10:08:16 +10:00
Víctor Mayoral Vilches df1de4efd6 AP_InertialSensor: Driver added for the LSM303D 2014-08-19 10:08:15 +10:00
Víctor Mayoral Vilches 8968647873 AP_InertialSensor: INS_generic example, add support L3GD20 2014-08-19 10:08:15 +10:00
Víctor Mayoral Vilches 0f908a8ccd HAL_Linux: Add L3GD20 to the AP_InertialSensor header 2014-08-19 10:08:15 +10:00
Víctor Mayoral Vilches 556d46a4ef AP_InertialSensor: L3GD20 driver added
L3GD20 gyro userspace sensor added. The driver constructs
over the implementation of the PX4 Dev Team at
https://github.com/diydrones/PX4Firmware.
2014-08-19 10:08:15 +10:00
Víctor Mayoral Vilches bfacf08c30 HAL_Linux: LSM9DS0 legacy driver moved to AP_InertialSensor/LSM9DS0/
The new LSM9DS0 driver will consist of the AP_InertialSensor_L3GD20 and
the AP_InertialSensor_LSM303D. For that reason the old LSM9DS0
(consisting of gyro and accel+mag implemented on a single class) has
been moved to a folder.

Legacy LSM9DS0 didn't probe to receive "correct" data.
2014-08-19 10:08:15 +10:00
Randy Mackay 51f40fe3d6 INS: add accessor for mpu6k filter 2014-08-14 11:47:23 +09:00
Randy Mackay 0e7cbd28c8 INS_HIL: init members to resolve compiler warnings 2014-08-14 11:27:32 +09:00
Andrew Tridgell 24251a7e12 AP_InertialSensor: fixed example build 2014-08-13 21:48:35 +10:00
Andrew Tridgell 984064f3d3 AP_InertialSensor: fixed example build 2014-08-13 18:46:44 +10:00
Mikhail Avkhimenia 34da221c3d AP_InertialSensor: Use MPU9250 DRDY pin only on boards that support it 2014-08-12 22:13:00 +10:00
Andrew Tridgell f8ceccce32 AP_InertialSensor: improved HIL timing consistancy
try to keep the average time for each sample right
2014-08-09 22:50:15 +10:00
Andrew Tridgell 1d4d848300 AP_InertialSensor: fixed a build warning 2014-08-08 13:48:03 +10:00
Andrew Tridgell ed6ab5f1d3 AP_InertialSensor: use bool for blocking_read()
uint8_t return was confusing
2014-08-07 13:09:17 +10:00
Michael Carpenter b4c0e1215b AP_InertialSensor: Use return value of blocking_read to handle calibration timeouts 2014-08-07 13:04:18 +10:00
Andrew Tridgell cc735a4200 AP_InertialSensor: some more debug info for VibTest 2014-07-31 12:48:30 +10:00
Andrew Tridgell f7b01a6f3f AP_InertialSensor: avoid integer underflow in mavlink txspace check 2014-07-27 22:18:52 +10:00
Andrew Tridgell 662276597a AP_InertialSensor: fixed example build 2014-07-25 17:52:14 +10:00