mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 15:53:56 -04:00
AP_RangeFinder: PWM driver adds offset param value
This commit is contained in:
parent
dfd1e4c839
commit
db3f1cb3b3
@ -166,6 +166,8 @@ void AP_RangeFinder_PWM::update(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!get_reading(state.distance_cm)) {
|
if (!get_reading(state.distance_cm)) {
|
||||||
|
// add offset
|
||||||
|
state.distance_cm += params.offset;
|
||||||
// failure; consider changing our state
|
// failure; consider changing our state
|
||||||
if (AP_HAL::millis() - state.last_reading_ms > 200) {
|
if (AP_HAL::millis() - state.last_reading_ms > 200) {
|
||||||
set_status(RangeFinder::RangeFinder_NoData);
|
set_status(RangeFinder::RangeFinder_NoData);
|
||||||
|
Loading…
Reference in New Issue
Block a user