Andrew Tridgell
e470bf2354
DCM: minor tuning based on testing my quad
2012-03-10 10:34:33 +11:00
Andrew Tridgell
97faa47ba6
SITL: make the yaw match the APM conventions
2012-03-10 10:34:33 +11:00
Andrew Tridgell
d1713bd2fb
SITL: fixed the pwm output on startup
2012-03-10 10:34:33 +11:00
Andrew Tridgell
8b37790bd1
Quaternion: code cleanups and added comments
2012-03-10 10:34:32 +11:00
Andrew Tridgell
f5e5ccff6a
DCM: code cleanup and added more comments
2012-03-10 10:34:32 +11:00
Andrew Tridgell
e2b2c9181e
Quaternion: bumb up gyro drift limit to match DCM
2012-03-10 10:34:32 +11:00
Andrew Tridgell
2b6fae6e16
ADC: removed the ADC level accel smoothing
...
the quaternion code does a better job of handling this noise than this
filter does
2012-03-10 10:34:32 +11:00
Andrew Tridgell
8ad6b5f4d1
Quaternion: separate out drift correction from main updates
2012-03-10 10:34:32 +11:00
Andrew Tridgell
ff4f7ccc65
InertionSensor: update for new Ch6() interface
2012-03-10 10:34:32 +11:00
Andrew Tridgell
d1976449fd
IMU: fixed a warning
2012-03-10 10:34:32 +11:00
Andrew Tridgell
e9f35bfa7f
GPS: expose last_fix_time
2012-03-10 10:34:32 +11:00
Andrew Tridgell
17daa2f31c
Compass: change last_update to be in microseconds
2012-03-10 10:34:32 +11:00
Andrew Tridgell
404a4e4896
ADC: use floats for ADC averaging
...
this costs almost nothing and improved accel/gyro calibration
2012-03-10 10:34:32 +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
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
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
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
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
79b8ddc236
DCM: added a small amount of accel smoothing to update_DCM_fast()
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
Andrew Tridgell
82032b17a9
DCM: added reporting interfaces for DCM state
2012-03-10 10:34:27 +11:00
Andrew Tridgell
ae6a94a933
SITL: added sitl_simstate_send()
...
used to report simulator state in logs
2012-03-10 10:34:27 +11:00
Andrew Tridgell
d106e3a970
MAVLink: import new message types DCM, HWSTATUS and SIMSTATE
2012-03-10 10:34:27 +11:00
Andrew Tridgell
4e354a9731
DCM: got rid of _error_roll_pitch from object state
...
this can be a local error variable in common with the yaw code. This
saves 12 bytes in the object.
2012-03-10 10:34:27 +11:00
Jason Short
13e9608fb8
Consolidated Barometer pressure sensing to a single filter based on Randy's new filter class.
2012-03-08 23:13:04 -08:00
Jason Short
34cf1e8fb3
Updated on Barometer - increased the Temp filtering and decreased the pressure filtering to and get less temp noise, faster response from pressure. I'm filtering the Climb rate differently now, so this higher pressure noise should not hurt the derivative calcs at all now.
2012-03-06 20:55:35 -08:00
rmackay9
6c1299fe7e
AP_RC - removed unused library
2012-03-04 18:21:52 +09:00
Andrew Tridgell
dd9065123c
SITL: use the new noise model
...
use the new noise model at a low level for master until we sort out
DCM noise handling
2012-03-02 18:31:07 +11:00
Andrew Tridgell
63ea5dfb49
APM_RC: allow the fast RC speed to be passed as a parameter
...
this will allow users to test different speeds
2012-03-02 17:57:08 +11:00
Andrew Tridgell
f1a389fe19
AP_Param: ensure we can't have duplicate keys in Parameters.h
...
this is O(n^2), but only at startup, and takes less than 1ms to run.
It catches a very nasty coding error
2012-03-02 15:48:28 +11:00
Andrew Tridgell
1476f044e6
I2C: added lockup_count() interface
...
used for reporting I2C problems
2012-03-02 15:48:27 +11:00
Andrew Tridgell
c9031f1d36
SITL: implement cli()/sei() properly for desktop build
...
this disables simulated hardware interrupts during critical sections
2012-03-02 15:48:27 +11:00
Jason Short
59e1d43f60
Updated fastPWM to 490Hz
2012-02-29 22:17:38 -08:00
Pat Hickey
8fa559930f
AP_Param: nested group recursion into next_group disableable by macro
...
* c.f. 0251932c81fe7eb, e5515bb6ef82
2012-02-29 19:48:43 -08:00
Pat Hickey
8b3d013294
AP_Param: One more nexted group recursion disableable by macro
...
* c.f. e5515bb6ef82
2012-02-29 18:48:54 -08:00
rmackay9
9832ac879e
AP_Compass - fixed compile warning
2012-02-29 22:57:35 +09:00
rmackay9
0311b70004
AP_Baro - fixed small compiler warning to do with order of parameters in constructor
2012-02-29 22:46:29 +09:00
rmackay9
64f9f1d92e
AP_Compass - fixed small compiler warning to do with order of parameters in constructor
2012-02-29 22:45:49 +09:00
rmackay9
7c1d1b45a7
AP_DCM - fixed small compiler warning to do with order of parameters in constructor
2012-02-29 22:45:26 +09:00
rmackay9
3cbd172ea9
RC_Channel - fixed small compiler warning
2012-02-29 22:44:29 +09:00
rmackay9
ced49f7d01
AP_ADC - removed small compiler warning
2012-02-29 22:43:46 +09:00
Pat Hickey
42078f2794
AP_Param: Make nested group recursion disableable by macro
...
* Eliminates recursive calls inside AP_Param.
This is important to Pat @ Galois, but not the project in general.
Recursion depth on these functions is bounded structurally using
existing nested group constructors (can't create loops in finite space)
and checked at init time
2012-02-28 16:28:27 -08:00
rmackay9
400a4b0bdb
AP_RangeFinder - changed example sketch to work with new Filter library
2012-02-28 21:02:10 +09:00
rmackay9
5b89c65d9c
Filter - updated example sketch to use modified library
2012-02-28 21:01:35 +09:00
rmackay9
d17a015df1
Filter - added AverageFilter, removed SumFilter
...
added FilterWithBuffer to allow removal of malloc/free without losing ability to pass around filter objects
2012-02-28 21:01:11 +09:00
Andrew Tridgell
078268528e
AP_Param: show numerical value in eeprom dump utility
2012-02-28 09:43:49 +11:00
Andrew Tridgell
701da6c30f
AP_Param: fixed v.load() on a sub-element of a AP_Vector3f
...
this isn't actually used at the moment in APM, but we should get it
right in case someone does try to load a single element of a vector
2012-02-28 09:43:49 +11:00
Andrew Tridgell
34f1ebcfb4
SITL: simulate noise on each ADC channel separately
...
scale the noise based on the period of the motors
2012-02-28 09:43:49 +11:00
Andrew Tridgell
4cdc0a8c11
SITL: raise the ADC noise level to 8 bits when flying
...
this is about the level of noise of a aircraft that has a lot of
vibration
2012-02-28 09:43:49 +11:00
Andrew Tridgell
b32701e008
IMU: removed unused accel_filtered code
2012-02-28 09:43:49 +11:00
Andrew Tridgell
ac44b73951
AP_Param: fixed setting of CAM_P_G in ArduCopter
...
the variable CAM_P_G has the same prefix as the CAM_P group. We want
to allow for parameters having a common prefix with a group, so we
need to keep searching after we've found a group that matches the
prefix
2012-02-27 10:54:33 +11:00
Andrew Tridgell
7fe4a41c31
AP_Param: make the templating code a bit clearer
...
add comments on the arguments, and name them in a clearer way
2012-02-27 10:54:33 +11:00
Andrew Tridgell
5bf138fb38
DCM: fixed the sense of the compass GPS test in initial yaw
...
we were only disabling null offsets when we didn't have a compass,
which doesn't make much sense!
2012-02-26 22:24:45 +11:00
rmackay9
747e045193
ModeFilter - corrected shadowed variable compiler warning for drop_high_sample
2012-02-26 17:57:28 +09:00
rmackay9
e01477a7a8
Filter - added AverageFilter - this will be used in place of SumFilter because it removes the possibility of overflows
2012-02-26 17:34:36 +09:00
rmackay9
b345529241
Filter - removed shadowing of variables in constructors for Filter, ModeFilter and SumFilter (sorry tridge!)
...
increased maximum sample buffer size from 6 to 10
2012-02-26 17:17:46 +09:00
rmackay9
3f0d27ec87
ModeFilter - remove older ModeFilter library (new library is now in Filter directory)
2012-02-26 15:36:23 +09:00
rmackay9
00a1b5cd53
AP_RangeFinder - cut over to use new ModeFilter from Filter library
2012-02-26 15:34:50 +09:00
rmackay9
ae8fd43335
Filter - first version of filter library include ModeFilter
2012-02-26 15:34:05 +09:00
rmackay9
f6f05755d9
AP_Mount - #include FastSerial first to allow it to compile under Arduino 1.0
2012-02-26 15:31:56 +09:00