Browse Source

AP_Math: Remove ROTATION_COMBINATION_SUPPORT

This function is not used.
master
dgrat 9 years ago committed by Lucas De Marchi
parent
commit
7c4c8ea579
  1. 36
      libraries/AP_Math/AP_Math.cpp
  2. 7
      libraries/AP_Math/AP_Math.h

36
libraries/AP_Math/AP_Math.cpp

@ -32,41 +32,5 @@ float safe_sqrt(float v) @@ -32,41 +32,5 @@ float safe_sqrt(float v)
return ret;
}
#if ROTATION_COMBINATION_SUPPORT
// find a rotation that is the combination of two other
// rotations. This is used to allow us to add an overall board
// rotation to an existing rotation of a sensor such as the compass
// Note that this relies the set of rotations being complete. The
// optional 'found' parameter is for the test suite to ensure that it is.
enum Rotation rotation_combination(enum Rotation r1, enum Rotation r2, bool *found)
{
Vector3f tv1, tv2;
enum Rotation r;
tv1(1,2,3);
tv1.rotate(r1);
tv1.rotate(r2);
for (r=ROTATION_NONE; r<ROTATION_MAX;
r = (enum Rotation)((uint8_t)r+1)) {
Vector3f diff;
tv2(1,2,3);
tv2.rotate(r);
diff = tv1 - tv2;
if (diff.length() < 1.0e-6f) {
// we found a match
if (found) {
*found = true;
}
return r;
}
}
// we found no matching rotation. Someone has edited the
// rotations list and broken its completeness property ...
if (found) {
*found = false;
}
return ROTATION_NONE;
}
#endif

7
libraries/AP_Math/AP_Math.h

@ -90,13 +90,6 @@ float safe_asin(float v); @@ -90,13 +90,6 @@ float safe_asin(float v);
// a varient of sqrt() that always gives a valid answer.
float safe_sqrt(float v);
#if ROTATION_COMBINATION_SUPPORT
// find a rotation that is the combination of two other
// rotations. This is used to allow us to add an overall board
// rotation to an existing rotation of a sensor such as the compass
enum Rotation rotation_combination(enum Rotation r1, enum Rotation r2, bool *found = NULL);
#endif
// longitude_scale - returns the scaler to compensate for shrinking longitude as you move north or south from the equator
// Note: this does not include the scaling to convert longitude/latitude points to meters or centimeters
float longitude_scale(const struct Location &loc);

Loading…
Cancel
Save