Commit Graph

120 Commits

Author SHA1 Message Date
Jonathan Challinger 159599879f AP_InertialSensor: simplify and correct AHRS_TRIM computation 2015-05-15 21:03:03 +10:00
Randy Mackay 1f14eec4ea InertialSensor: accel_calibrated_all_ok replaces calibrated
This checks that the current number of accelerometers matches the number
of calibrated accels in order to catch accel failures at boot
2015-05-12 16:32:16 +09:00
Andrew Tridgell 8bf2baef70 AP_InertialSensor: fixed primary accel/gyro in replay 2015-05-11 11:19:11 +10:00
Andrew Tridgell 7d90033a36 AP_InertialSensor: support raw accel and gyro dataflash logging 2015-05-07 12:08:30 +10:00
Andrew Tridgell 089e63f987 AP_InertialSensor: fixed PSTR handling
must use PSTR on code compiled for AVR
2015-05-05 13:54:00 +10:00
Andrew Tridgell e6a8a6da07 AP_InertialSensor: revert AP_Math class change 2015-05-05 13:27:06 +10:00
Tom Pittenger 9e98c68099 AP_InertialSensor: compile warnings: format not a string literal, argument types not checked
PSTR() goofs things up when using hal.console->printf_P()
2015-05-05 13:27:01 +10:00
Tom Pittenger 820199635b AP_InertialSensors: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:51 +10:00
Tom Pittenger 3cb2221315 AP_IntertialSensor: double to float warning 2015-05-05 13:26:50 +10:00
Randy Mackay 6773c0b232 AP_InertialSensor: default primary accel and gyro 2015-05-01 16:37:33 +09:00
Tom Pittenger a4b8575432 InertialSensor: fix compile warnings re float constants 2015-04-24 14:03:49 +09:00
Andrew Tridgell 45e016ea5b AP_InertialSensor: check for zero delta_velocity dt 2015-04-03 15:10:47 -07:00
Jonathan Challinger b306d7a356 AP_InertialSensor: accel cal sample for 400ms instead of 1s 2015-04-03 14:54:19 -07:00
Jonathan Challinger 1e1d8efa22 AP_InertialSensor: use expected update rate for accel cal sampling 2015-04-03 14:54:17 -07:00
Jonathan Challinger bd84328440 AP_InertialSensor: hack to "reset" the accel filter before taking a cal sample 2015-04-03 14:54:15 -07:00
Jonathan Challinger b2b42e081a AP_InertialSensor: use delta_velocity/dt for calibration if available 2015-04-03 14:54:10 -07:00
Andrew Tridgell 4147825b87 AP_InertialSensor: fixed gyro calibration bug
we must not update _gyro_offset[] until we have completed calibration
of that gyro, or we will end up using the new offsets when asking for
the raw gyro vector
2015-04-03 06:57:30 -07:00
Andrew Tridgell cf2445dc97 AP_InertialSensor: prevent nested accelerometer calibration 2015-03-15 15:22:59 +11:00
Andrew Tridgell 8a99cab535 AP_InertialSensor: load only HIL backend for hil_mode 2015-03-13 22:52:55 +11:00
Andrew Tridgell 07fd31c724 AP_InertialSensor: change copter filters to 20Hz
with the backend filters disabled 20Hz is closer to the old default of
30Hz
2015-03-12 13:11:17 +11:00
Andrew Tridgell 3d7d46b9b0 AP_InertialSensor: replaced INS_MPU6K_FILTER with INS_ACCEL_FILTER and INS_GYRO_FILTER
this allows filtering to be set separately on accels and gyros where possible
2015-03-12 12:50:31 +11:00
Andrew Tridgell f3314791f2 AP_InertialSensor: removed INS_CALSENSFRAME
it is no longer needed as we have shifted the accel cal indexes
2015-03-12 12:50:31 +11:00
Andrew Tridgell 4bc6c8e655 AP_InertialSensor: shift to new parameter indexes for accel calibration
this allows for users to switch between development trees and previous
stable versions while retaining their accel calibration values.
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 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
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 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
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
Emile Castelnuovo dae32984f1 AP_InertialSensor: use PX4 library for VRBRAIN boards. 2015-02-02 08:43:59 +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
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
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 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 ad7c612334 AP_InertialSensor: fixed SITL with new HIL code 2014-10-24 15:05:44 +11:00