mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 10:28:29 -04:00
AP_Math: move is_valid_octal into adsb
This doesn't ensure the value is octal digits - there's more magic in it.
This commit is contained in:
parent
919208c47c
commit
6e4813cc92
@ -321,23 +321,6 @@ Vector3f rand_vec3f(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool is_valid_octal(uint16_t octal)
|
||||
{
|
||||
// treat "octal" as decimal and test if any decimal digit is > 7
|
||||
if (octal > 7777) {
|
||||
return false;
|
||||
} else if (octal % 10 > 7) {
|
||||
return false;
|
||||
} else if ((octal % 100)/10 > 7) {
|
||||
return false;
|
||||
} else if ((octal % 1000)/100 > 7) {
|
||||
return false;
|
||||
} else if ((octal % 10000)/1000 > 7) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
return true if two rotations are equivalent
|
||||
This copes with the fact that we have some duplicates, like ROLL_180_YAW_90 and PITCH_180_YAW_270
|
||||
|
@ -274,9 +274,6 @@ float rand_float(void);
|
||||
// generate a random Vector3f of size 1
|
||||
Vector3f rand_vec3f(void);
|
||||
|
||||
// confirm a value is a valid octal value
|
||||
bool is_valid_octal(uint16_t octal) WARN_IF_UNUSED;
|
||||
|
||||
// return true if two rotations are equal
|
||||
bool rotation_equal(enum Rotation r1, enum Rotation r2) WARN_IF_UNUSED;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user