Commit Graph

4244 Commits

Author SHA1 Message Date
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
Andrew Tridgell
9393b21a8d ACM: adjust yaw drift correction constants
this should give the compass a bit more authority
2012-03-10 10:34:28 +11:00
Andrew Tridgell
8e162ec35b APM: fixed reset of control switch when short_fs_action is disabled
When FS_SHORT_ACTN is 0, we should not re-read the control switch
unless we changed mode on the initial short fs action
2012-03-10 10:34:28 +11:00
Andrew Tridgell
d03b11092b SITL: separate out drift speed and drift level 2012-03-10 10:34:28 +11:00
Andrew Tridgell
71d3847bfc 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
61ebcfe9fe 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
de32c3bc31 AP_Math: added a .zero() method to Vector3f 2012-03-10 10:34:28 +11:00
Andrew Tridgell
a0e2e69431 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
37ab76c9e6 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
d2a969ee95 SITL: push noise level to 2.0 for DCM testing 2012-03-10 10:34:27 +11:00
Andrew Tridgell
506b91a587 autotest: run fg viewers with less CPU priority 2012-03-10 10:34:27 +11:00
Andrew Tridgell
65b26619d4 autotest: added CMAC test circuit
this is what I am using for noise testing
2012-03-10 10:34:27 +11:00
Andrew Tridgell
79b8ddc236 DCM: added a small amount of accel smoothing to update_DCM_fast() 2012-03-10 10:34:27 +11:00
Andrew Tridgell
b07a3eb966 ACM: added SIMSTATE, DCM and HWSTATUS messages to ACM 2012-03-10 10:34:27 +11:00
Andrew Tridgell
55413bfcc1 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
a78b00513b 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