After disarming and allowing the gyros to settle with no motion, temporarily increase the dcmKpGain to rapidly converge on the correct attitude as indicated by the accelerometer (if present).
Addresses the case of the attitude estimate becoming significantly incorrect after a crash due to high gyro rates. While the estimate will eventually converge, it does so quite slowly. The pilot may re-arm before the estimate has corrected leading to instant flips in self-leveling modes. By speeding up the convergence when disarmed we help reduce this risk.
The function imuIsAccelerometerHealthy() was only using the last ACC sample to determine if the sensor was returning "healthy" data. This then controlled whether the IMU attitude calculation considered ACC data at all. There were two problems with this:
1. A single sample from the ACC can be very noisy and exceed the check threshold resulting in a false negative on the health of the sensor.
2. The attitude calculations exclusively used the averaged ACC samples so there was an inconsistency in checking only the last sample to determine if the data was useful.
This change should lead to fewer occurences of the ACC sensor data being ignored in the attitude estimation which should in turn improve the overall estimate.
If USE_MAG was undefined but USE_GPS was defined, then the "else if" would incorrectly apply to a condition above making the USE_GPS section unlikely to execute.
use quaternion directly & we can fly in 3D mode now
rename uartPort_t to tcpPort_t
fix race on ACC, GYRO, IMU
fix gyro scale & disable SystemLoad calculate
update README.md
remove some unused
fix scale on 3D mode
need implement fake eeprom & fake IO
need implement fake system function
can compile, stuck in isEEPROMContentValid()
EEPROM in memory work
EEPROM as file should work
fix some complie warning
MSP over TCP work (add dyad.c)
a little clean up
fix FLASH_CONFIG_Size in ld script & implement some pwmout
IO to simulator work!! need to check direction & scale!!
can fly but Gyro buggy
move dyad.c
fix busy-loop (limit to max 20kHz)
can simulatie in different speed now! (hard code)
add option for IMU calculation
add README.md
move dyad.c and fix F3 overrun the flash size
explanation SITL in README.md and reuse CFLAGS, ASFLAGS