We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// Read n-samples for (uint8_t i = 0; i < samples; ++i) { readRawGyro(); sumX += rg.XAxis; sumY += rg.YAxis; sumZ += rg.ZAxis; sigmaX += rg.XAxis * rg.XAxis; sigmaY += rg.YAxis * rg.YAxis; sigmaZ += rg.ZAxis * rg.ZAxis; delay(5); } // Calculate delta vectors dg.XAxis = sumX / samples; dg.YAxis = sumY / samples; dg.ZAxis = sumZ / samples; // Calculate threshold vectors th.XAxis = sqrt((sigmaX / 50) - (dg.XAxis * dg.XAxis)); th.YAxis = sqrt((sigmaY / 50) - (dg.YAxis * dg.YAxis)); th.ZAxis = sqrt((sigmaZ / 50) - (dg.ZAxis * dg.ZAxis));
as we can see, the threshold vectors are calculated from raw data, but in function readNormalizeGyro()
Vector MPU6050::readNormalizeGyro(void) { readRawGyro(); if (useCalibrate) { ng.XAxis = (rg.XAxis - dg.XAxis) * dpsPerDigit; ng.YAxis = (rg.YAxis - dg.YAxis) * dpsPerDigit; ng.ZAxis = (rg.ZAxis - dg.ZAxis) * dpsPerDigit; } else { ng.XAxis = rg.XAxis * dpsPerDigit; ng.YAxis = rg.YAxis * dpsPerDigit; ng.ZAxis = rg.ZAxis * dpsPerDigit; } if (actualThreshold) { if (abs(ng.XAxis) < tg.XAxis) ng.XAxis = 0; if (abs(ng.YAxis) < tg.YAxis) ng.YAxis = 0; if (abs(ng.ZAxis) < tg.ZAxis) ng.ZAxis = 0; } return ng; }
the threshold vectors are compared to normalize data, these few lines should be modified to?
if (actualThreshold) { if (abs(rg.XAxis) < tg.XAxis) ng.XAxis = 0; if (abs(rg.YAxis) < tg.YAxis) ng.YAxis = 0; if (abs(rg.ZAxis) < tg.ZAxis) ng.ZAxis = 0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
as we can see, the threshold vectors are calculated from raw data, but in function readNormalizeGyro()
the threshold vectors are compared to normalize data, these few lines should be modified to?
The text was updated successfully, but these errors were encountered: