Commit Graph

1340 Commits

Author SHA1 Message Date
Andrew Tridgell
045b49c4c4 DCM: removed update_DCM_fast
this combines the functionality of the 'fast' DCM with the normal one,
and also speeds up both the yaw drift correction and the matrix update
code
2012-03-10 10:34:31 +11:00
Andrew Tridgell
321200ebbc AP_IMU: fixed led flashing in gyro cal
thanks Pat!
2012-03-10 10:34:31 +11:00
Andrew Tridgell
a92fb67b70 AP_Math: expanded the math test suite 2012-03-10 10:34:31 +11:00
Andrew Tridgell
4d65cda0ea AP_Math: added quaternion->matrix and earth frame routines
this will be used for 3d acceleration
2012-03-10 10:34:31 +11:00
Andrew Tridgell
8abbbe5713 AP_Math: better way of handling safe_sqrt()
better to test the result, than predict it
2012-03-10 10:34:31 +11:00
Andrew Tridgell
ccada2e9c2 SITL: avoid parent pid code on cygwin
this causes problems on windows
2012-03-10 10:34:31 +11:00
Andrew Tridgell
3666476bcb SITL: prevent nested timer interrupts 2012-03-10 10:34:31 +11:00
Andrew Tridgell
3b7d78cf02 Quat: test patch for michael 2012-03-10 10:34:31 +11:00
Andrew Tridgell
f363f81869 Quaternion: added NaN paranoid checking
this is for Michael to run
2012-03-10 10:34:30 +11:00
Andrew Tridgell
1ec4c0777c Math: added comment on quaternion constructor 2012-03-10 10:34:30 +11:00
Andrew Tridgell
f5e6dc0757 Math: added is_inf() on vector3f 2012-03-10 10:34:30 +11:00
Andrew Tridgell
066a513758 Quaternion: added more numerical safety in the quaternion code
prevent infinities from creeping in and prevent large drift changes
2012-03-10 10:34:30 +11:00
Andrew Tridgell
c7d5f06b21 AP_Math: added quaternion helper functions and a test suite 2012-03-10 10:34:30 +11:00
Andrew Tridgell
f70dfe440d Quaternion: fix the gyro bias in centripetal and remove smoothing
the centripetal code needs to take account of the current gyro
bias.

It turned out that the accel and gyro smoothing was causing
significant control lag, and we're better off just letting the
quaternion code handle it via its own smoothing parameters
2012-03-10 10:34:30 +11:00
Andrew Tridgell
47ddd4dfdd SITL: disable interrupts during register updates
this may prevent bogus mode channel reads
2012-03-10 10:34:30 +11:00
Andrew Tridgell
7256652de5 Quaternion: use GPS to correct for linear acceleration
this gives much better pitch estimates. We should do this with the
airspeed sensor if available.
2012-03-10 10:34:30 +11:00
Andrew Tridgell
c7ef72cf28 Quaternion: don't update if we have a very long deltat
this can be caused by stopping the system in a debugger
2012-03-10 10:34:30 +11:00
Andrew Tridgell
6d356b6c6e Compass: fixed last_update time for HIL compass 2012-03-10 10:34:30 +11:00
Andrew Tridgell
ebc55bb494 RC: disable interrupts when reading the RC registers
this prevents getting bogus values which could cause a flight mode
change
2012-03-10 10:34:30 +11:00
Andrew Tridgell
57f67ca6e3 GPS: added an acceleration estimate to the GPS driver
This uses the GPS ground speed to estimate acceleration
2012-03-10 10:34:30 +11:00
Andrew Tridgell
7fbfcc2721 GPS: fixed some stdint types 2012-03-10 10:34:29 +11:00
Andrew Tridgell
e699e9ace0 Quaternion: added in reporting of gyro drift and rp/yaw errors 2012-03-10 10:34:29 +11:00
Andrew Tridgell
2a8b167d95 fixed comment 2012-03-10 10:34:29 +11:00
Andrew Tridgell
c73c55aa90 DCM: fixed an uninitialised variable warning 2012-03-10 10:34:29 +11:00
Andrew Tridgell
d8234882d4 Quaternion: tweak the quaternion gains a bit 2012-03-10 10:34:29 +11:00
Andrew Tridgell
cc887949c9 AP_IMU: improved the gyro calibration code
this should give a much more accurate result
2012-03-10 10:34:29 +11:00
Andrew Tridgell
ffa6786697 Quaternion: drop the gyro drift rates down
this should allow us to cope with noise more readily
2012-03-10 10:34:29 +11:00
Andrew Tridgell
bee4bd9474 DCM: fixed bug in accel averaging
sorry Randy!
2012-03-10 10:34:29 +11:00
Andrew Tridgell
25e5ddeaa4 AP_Quaternion: fixed build on Arduino 1.0 2012-03-10 10:34:29 +11:00
Andrew Tridgell
c369d9f60a AP_Quaternion: added DCM compatibility interfaces
useful for getting the code going quickly
2012-03-10 10:34:29 +11:00
Andrew Tridgell
6138f31cec AP_IMU: added new_data_available() interface 2012-03-10 10:34:29 +11:00
Andrew Tridgell
a9dea35310 AP_InertialSensor: added new_data_available() interface 2012-03-10 10:34:28 +11:00
Andrew Tridgell
c80ec9a55c AP_ADC: added new_data_available() interface
returns true if more samples are available
2012-03-10 10:34:28 +11:00
Andrew Tridgell
c8a459ab0d fixed deltat in quaternion 2012-03-10 10:34:28 +11:00
Andrew Tridgell
a791224d07 SITL: make SITL not depend on DCM 2012-03-10 10:34:28 +11:00
Andrew Tridgell
74eef7018a Quaternion: added an AP_Quaternion library
this is for experimenting with the Madgwick quaternion system, to see
if it is more or less noise sensitive than DCM
2012-03-10 10:34:28 +11:00
Andrew Tridgell
fd2a24f8ed SITL: reduce the simulated compass offsets
this was causing us problems in getting DCM right
2012-03-10 10:34:28 +11:00
Andrew Tridgell
bddc6ba241 SITL: separate out drift speed and drift level 2012-03-10 10:34:28 +11:00
Andrew Tridgell
25cad09746 SITL: added a drift_level multiplier
this makes it easier to experiment with different gyro drift levels
2012-03-10 10:34:28 +11:00
Andrew Tridgell
b11b571778 DCM: fixed the averaging of accel values for update_DCM_fast()
this should improve drift correction for ArduCopter
2012-03-10 10:34:28 +11:00
Andrew Tridgell
145fc91701 AP_Math: added a .zero() method to Vector3f 2012-03-10 10:34:28 +11:00
Andrew Tridgell
ae51173656 SITL: fixed delay() to account for signal interrupions
when a timer went off we stopped the delay() code
2012-03-10 10:34:28 +11:00
Andrew Tridgell
fe173227de DCM_Test: fixed example code to work with SITL
this also fixes the compass setup
2012-03-10 10:34:27 +11:00
Andrew Tridgell
8424609924 SITL: push noise level to 2.0 for DCM testing 2012-03-10 10:34:27 +11:00
Andrew Tridgell
6ba6e11e7b DCM: added a small amount of accel smoothing to update_DCM_fast() 2012-03-10 10:34:27 +11:00
Andrew Tridgell
3b1782f369 DCM: don't use the z accel sensor for drift correction
the z accel is the noisest, and seems to do more harm than good. Using
just x and y is sufficient for drift correction by assuming the vector
length
2012-03-10 10:34:27 +11:00
Andrew Tridgell
4031320f7c DCM: added a small amount of gyro and accel smoothing
possibly not needed, but convenient to be able to test with different
values
2012-03-10 10:34:27 +11:00
Andrew Tridgell
94d0236b97 DCM: added reporting interfaces for DCM state 2012-03-10 10:34:27 +11:00
Andrew Tridgell
772c30ba86 SITL: added sitl_simstate_send()
used to report simulator state in logs
2012-03-10 10:34:27 +11:00
Andrew Tridgell
9df332f0ae MAVLink: import new message types DCM, HWSTATUS and SIMSTATE 2012-03-10 10:34:27 +11:00