AP_Proximity: fix proximity ignored zone calulation

It seems there was a typo in the checking of proximity ignored zones.
This commit is contained in:
Andras Schaffer 2020-06-03 00:07:06 +02:00 committed by Andrew Tridgell
parent 61446d749b
commit a58415391f
1 changed files with 1 additions and 1 deletions

View File

@ -239,7 +239,7 @@ bool AP_Proximity_Backend::ignore_reading(uint16_t angle_deg) const
// check angle vs each ignore area
for (uint8_t i=0; i < PROXIMITY_MAX_IGNORE; i++) {
if (frontend._ignore_width_deg[i] != 0) {
if (abs(angle_deg - frontend._ignore_width_deg[i]) <= (frontend._ignore_width_deg[i]/2)) {
if (abs(angle_deg - frontend._ignore_angle_deg[i]) <= (frontend._ignore_width_deg[i]/2)) {
return true;
}
}