1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +03:00

tasks and integration

This commit is contained in:
Pawel Spychalski (DzikuVx) 2016-09-04 21:03:08 +02:00
parent 0dc1c21365
commit bfec626640
10 changed files with 343 additions and 46 deletions

View file

@ -303,8 +303,8 @@ static void imuMahonyAHRSupdate(float dt, float gx, float gy, float gz,
if (accWeight > 0) {
float kpAcc = imuRuntimeConfig->dcm_kp_acc * imuGetPGainScaleFactor();
// Just scale by 1G length - That's our vector adjustment. Rather than
// using one-over-exact length (which needs a costly square root), we already
// Just scale by 1G length - That's our vector adjustment. Rather than
// using one-over-exact length (which needs a costly square root), we already
// know the vector is enough "roughly unit length" and since it is only weighted
// in by a certain amount anyway later, having that exact is meaningless. (c) MasterZap
ax *= (1.0f / GRAVITY_CMSS);
@ -506,7 +506,7 @@ void imuUpdateAccelerometer(void)
#endif
}
void imuUpdateGyroAndAttitude(void)
void imuUpdateAttitude(void)
{
/* Calculate dT */
static uint32_t previousIMUUpdateTime;
@ -514,9 +514,6 @@ void imuUpdateGyroAndAttitude(void)
float dT = (currentTime - previousIMUUpdateTime) * 1e-6;
previousIMUUpdateTime = currentTime;
/* Update gyroscope */
gyroUpdate();
if (sensors(SENSOR_ACC) && isAccelUpdatedAtLeastOnce) {
#ifdef HIL
if (!hilActive) {