AP_RangeFinder: Change division to multiplication
This commit is contained in:
parent
5b56d9104d
commit
b85ecb9526
@ -68,7 +68,7 @@ bool AP_RangeFinder_BLPing::get_reading(float &reading_m)
|
||||
}
|
||||
if (protocol.parse_byte(b) == PingProtocol::MessageId::DISTANCE_SIMPLE) {
|
||||
averageStruct.count++;
|
||||
averageStruct.sum_cm += protocol.get_distance_mm()/10.0f;
|
||||
averageStruct.sum_cm += protocol.get_distance_mm()*0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ bool AP_RangeFinder_LeddarVu8::get_reading(float &reading_m)
|
||||
} else {
|
||||
// if only out of range readings return larger of
|
||||
// driver defined maximum range for the model and user defined max range + 1m
|
||||
reading_m = MAX(LEDDARVU8_DIST_MAX_CM, max_distance_cm() + LEDDARVU8_OUT_OF_RANGE_ADD_CM)/100.0f;
|
||||
reading_m = MAX(LEDDARVU8_DIST_MAX_CM, max_distance_cm() + LEDDARVU8_OUT_OF_RANGE_ADD_CM)*0.01f;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user