fixed warnings in AP_DCM

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2559 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
tridge60@gmail.com 2011-06-15 12:24:51 +00:00
parent 439b65324d
commit 88b00edaf3
1 changed files with 8 additions and 10 deletions

View File

@ -124,8 +124,6 @@ void
AP_DCM::accel_adjust(void) AP_DCM::accel_adjust(void)
{ {
Vector3f veloc, temp; Vector3f veloc, temp;
float vel;
veloc.x = _gps->ground_speed / 100; // We are working with acceleration in m/s^2 units veloc.x = _gps->ground_speed / 100; // We are working with acceleration in m/s^2 units
// We are working with a modified version of equation 26 as our IMU object reports acceleration in the positive axis direction as positive // We are working with a modified version of equation 26 as our IMU object reports acceleration in the positive axis direction as positive
@ -187,21 +185,21 @@ AP_DCM::normalize(void)
Vector3f Vector3f
AP_DCM::renorm(Vector3f const &a, int &problem) AP_DCM::renorm(Vector3f const &a, int &problem)
{ {
float renorm; float renorm_val;
renorm = a * a; renorm_val = a * a;
if (renorm < 1.5625f && renorm > 0.64f) { // Check if we are OK to use Taylor expansion if (renorm_val < 1.5625f && renorm_val > 0.64f) { // Check if we are OK to use Taylor expansion
renorm = 0.5 * (3 - renorm); // eq.21 renorm_val = 0.5 * (3 - renorm_val); // eq.21
} else if (renorm < 100.0f && renorm > 0.01f) { } else if (renorm_val < 100.0f && renorm_val > 0.01f) {
renorm = 1.0 / sqrt(renorm); renorm_val = 1.0 / sqrt(renorm_val);
renorm_sqrt_count++; renorm_sqrt_count++;
} else { } else {
problem = 1; problem = 1;
renorm_blowup_count++; renorm_blowup_count++;
} }
return(a * renorm); return(a * renorm_val);
} }
/**************************************************/ /**************************************************/