Skip to content

Commit

Permalink
Prevent double declaration
Browse files Browse the repository at this point in the history
Prevent double declaration
  • Loading branch information
Tinyu-Zhao authored Mar 20, 2022
2 parents aa98efa + c696151 commit 819a1f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utility/quaternionFilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static float GyroMeasError = PI * (40.0f / 180.0f);
// the faster the solution converges, usually at the expense of accuracy.
// In any case, this is the free parameter in the Madgwick filtering and
// fusion scheme.
static float beta = sqrt(3.0f / 4.0f) * GyroMeasError; // Compute beta
static float gyro_beta = sqrt(3.0f / 4.0f) * GyroMeasError; // Compute beta
// Compute zeta, the other free parameter in the Madgwick scheme usually
// set to a small or zero value
// static float zeta = sqrt(3.0f / 4.0f) * GyroMeasDrift;
Expand Down Expand Up @@ -120,10 +120,10 @@ void MadgwickQuaternionUpdate(float ax, float ay, float az, float gx, float gy,
s4 *= norm;

// Compute rate of change of quaternion
qDot1 = 0.5f * (-q2 * gx - q3 * gy - q4 * gz) - beta * s1;
qDot2 = 0.5f * (q1 * gx + q3 * gz - q4 * gy) - beta * s2;
qDot3 = 0.5f * (q1 * gy - q2 * gz + q4 * gx) - beta * s3;
qDot4 = 0.5f * (q1 * gz + q2 * gy - q3 * gx) - beta * s4;
qDot1 = 0.5f * (-q2 * gx - q3 * gy - q4 * gz) - gyro_beta * s1;
qDot2 = 0.5f * (q1 * gx + q3 * gz - q4 * gy) - gyro_beta * s2;
qDot3 = 0.5f * (q1 * gy - q2 * gz + q4 * gx) - gyro_beta * s3;
qDot4 = 0.5f * (q1 * gz + q2 * gy - q3 * gx) - gyro_beta * s4;

// Integrate to yield quaternion
q1 += qDot1 * deltat;
Expand Down

0 comments on commit 819a1f9

Please sign in to comment.