AP_RangeFinder: PWM driver adds offset param value

This commit is contained in:
Randy Mackay 2020-01-16 12:35:25 +09:00
parent 58a0990a5b
commit a2fdc5b428
1 changed files with 2 additions and 0 deletions

View File

@ -166,6 +166,8 @@ void AP_RangeFinder_PWM::update(void)
}
if (!get_reading(state.distance_cm)) {
// add offset
state.distance_cm += params.offset;
// failure; consider changing our state
if (AP_HAL::millis() - state.last_reading_ms > 200) {
set_status(RangeFinder::RangeFinder_NoData);