Skip to content
Permalink
Browse files

Version 5.4 commit - has updated attitude shifting in the ahrs algorithm

  • Loading branch information...
spencerdynojet committed Apr 9, 2019
1 parent 9df5016 commit 5695154ae98025c34c322c2bd5b7c611026fb1ad
Showing with 4 additions and 3 deletions.
  1. +1 −1 ExEFIS/ExEFIS.cpp
  2. +1 −1 ExEFIS/SKFilter.cpp
  3. +2 −1 ExEFIS/adhrs.cpp
@@ -26,7 +26,7 @@ int main(int argc, char *argv[])

/* Start some String outputs in case you are launching the app with loggint enabled */
qDebug("****************** LOG BEGINS HERE **************************");
qDebug("Version 5.3 - Added settings file and Attitude Adjust ");
qDebug("Version 5.4 - Added settings file and Attitude Adjust - added attitude offset for Filter ");

system("cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2");
system("gpio mode 26 out");
@@ -436,7 +436,7 @@ bool SKFilter::update(float gx, float gy, float gz, float ax, float ay, float az
acState.turning = !axisstill.gyroyaw || !axisstill.magyaw;
acState.wingslevel = (!acState.turning && acState.ballcentered);
acState.oneG = (abs(1.0f - totalmag) <= 0.012f);
acState.pitchlevel = acState.oneG && acState.pitchstill && abs(_accelEuler[1] - attitudeOffset) < 0.02 && !acState.turning;
acState.pitchlevel = acState.oneG && acState.pitchstill && abs(_accelEuler[1] - attitudeOffset) < 0.05 && !acState.turning;


if (acState.pitchlevel)
@@ -495,7 +495,8 @@ void adhrs::setSteerToSettings(int* steerto)

void adhrs::setAttitudeOffset(int offset_deg)
{
hrs->setAttitudeOffset((float)(offset_deg*M_PI/180.0f));
//Note the negative here to account for the opposite of the level flag in the AHRS
hrs->setAttitudeOffset((float)(-offset_deg*M_PI/180.0f));
}


0 comments on commit 5695154

Please sign in to comment.
You can’t perform that action at this time.