Commit Graph

4359 Commits

Author SHA1 Message Date
Andrew Tridgell
3239a00b23 APM: avoid fetching the DCM matrix twice
also no special case for quaternions
2012-03-10 10:34:32 +11:00
Andrew Tridgell
e2c525434a ACM: removed quaternion special cases in CLI code 2012-03-10 10:34:31 +11:00
Andrew Tridgell
e870e7bd82 ACM: removed the DCM tuning overrides
not needed now that DCM scales with deltat
2012-03-10 10:34:31 +11:00
Andrew Tridgell
13bddf05b0 ACM: removed the special case for quaternions in GCS code 2012-03-10 10:34:31 +11:00
Andrew Tridgell
1547977e1b ACM: no need to fetch offsets at startup
AP_Param handles this
2012-03-10 10:34:31 +11:00
Andrew Tridgell
34d25ab298 ACM: removed a lot of the special case code for quaternions 2012-03-10 10:34:31 +11:00
Andrew Tridgell
e780dd2b44 ACM: change DCM loop to 100Hz
On my APM2 quad this seems to give better results
2012-03-10 10:34:31 +11:00
Andrew Tridgell
4c6afa36cb 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
2c279639a3 AP_IMU: fixed led flashing in gyro cal
thanks Pat!
2012-03-10 10:34:31 +11:00
Andrew Tridgell
b39323bf1b AP_Math: expanded the math test suite 2012-03-10 10:34:31 +11:00
Andrew Tridgell
a8fd31a5e1 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
d3dc5bd751 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
b273df0725 SITL: avoid parent pid code on cygwin
this causes problems on windows
2012-03-10 10:34:31 +11:00
Andrew Tridgell
e1ff9a641b SITL: prevent nested timer interrupts 2012-03-10 10:34:31 +11:00
Andrew Tridgell
d11aab610d Quat: test patch for michael 2012-03-10 10:34:31 +11:00
Andrew Tridgell
a954f68f27 Quaternion: added NaN paranoid checking
this is for Michael to run
2012-03-10 10:34:30 +11:00
Andrew Tridgell
756a91a3ee ACM: removed incorrect mode definition 2012-03-10 10:34:30 +11:00
Andrew Tridgell
d24b055b66 Math: added comment on quaternion constructor 2012-03-10 10:34:30 +11:00
Andrew Tridgell
1f5095e722 Math: added is_inf() on vector3f 2012-03-10 10:34:30 +11:00
Andrew Tridgell
89a10c584d 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
f2e6714598 AP_Math: added quaternion helper functions and a test suite 2012-03-10 10:34:30 +11:00
Andrew Tridgell
f71311fdc0 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
76736792f8 SITL: disable interrupts during register updates
this may prevent bogus mode channel reads
2012-03-10 10:34:30 +11:00
Andrew Tridgell
e445a455d0 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
1ea1b500a6 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
8b73166605 Compass: fixed last_update time for HIL compass 2012-03-10 10:34:30 +11:00
Andrew Tridgell
2969e16f7d 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
efe2686b33 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
02ae5358d5 GPS: fixed some stdint types 2012-03-10 10:34:29 +11:00
Andrew Tridgell
2f5a4cdc4a Quaternion: added in reporting of gyro drift and rp/yaw errors 2012-03-10 10:34:29 +11:00
Andrew Tridgell
04826065ef Quaternion: show "Quaternion test" on startup if enabled 2012-03-10 10:34:29 +11:00
Andrew Tridgell
934a05bbc6 fixed comment 2012-03-10 10:34:29 +11:00
Andrew Tridgell
a60cf111c5 DCM: fixed an uninitialised variable warning 2012-03-10 10:34:29 +11:00
Andrew Tridgell
7d9c4094a2 Quaternion: tweak the quaternion gains a bit 2012-03-10 10:34:29 +11:00
Andrew Tridgell
e33bb217bc 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
de1cfc8e34 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
2d6680f144 DCM: fixed bug in accel averaging
sorry Randy!
2012-03-10 10:34:29 +11:00
Andrew Tridgell
73594199c8 AP_Quaternion: fixed build on Arduino 1.0 2012-03-10 10:34:29 +11:00
Andrew Tridgell
1591d41b33 ACM: make it possible to build ArduCopter with quaternions 2012-03-10 10:34:29 +11:00
Andrew Tridgell
bc81d8e6ac ACM: only call the fast loop if the imu has new data
this prevents us spinning waiting for the sensors to gather some data
2012-03-10 10:34:29 +11:00
Andrew Tridgell
aa4beb9753 APM: make it possible to build ArduPlane with quaternion support 2012-03-10 10:34:29 +11:00
Andrew Tridgell
a85ba80246 AP_Quaternion: added DCM compatibility interfaces
useful for getting the code going quickly
2012-03-10 10:34:29 +11:00
Andrew Tridgell
626f8598ed AP_IMU: added new_data_available() interface 2012-03-10 10:34:29 +11:00
Andrew Tridgell
a052aa8435 AP_InertialSensor: added new_data_available() interface 2012-03-10 10:34:28 +11:00
Andrew Tridgell
61d649e7ac AP_ADC: added new_data_available() interface
returns true if more samples are available
2012-03-10 10:34:28 +11:00
Andrew Tridgell
4a277f9871 fixed deltat in quaternion 2012-03-10 10:34:28 +11:00
Andrew Tridgell
353f9e613f SITL: make SITL not depend on DCM 2012-03-10 10:34:28 +11:00
Andrew Tridgell
fb23c617fa 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
a05eeab55e 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
a54d6f744e HWSTATUS: if we don't know the voltage, report it as zero
this will tell us if board_voltage() is really working
2012-03-10 10:34:28 +11:00