AP_RangeFinder: fixed TeraRangerI2C refresh rate and status
This commit is contained in:
parent
ec1b6db83b
commit
428d4d4574
@ -105,7 +105,7 @@ bool AP_RangeFinder_TeraRangerI2C::init(void)
|
||||
|
||||
dev->set_retries(1);
|
||||
|
||||
dev->register_periodic_callback(50000,
|
||||
dev->register_periodic_callback(10000,
|
||||
FUNCTOR_BIND_MEMBER(&AP_RangeFinder_TeraRangerI2C::timer, void));
|
||||
|
||||
return true;
|
||||
@ -158,7 +158,7 @@ bool AP_RangeFinder_TeraRangerI2C::process_raw_measure(uint16_t raw_distance, ui
|
||||
}
|
||||
|
||||
/*
|
||||
timer called at 20Hz
|
||||
timer called at 100Hz, EVO sensors max freq is 100..240Hz
|
||||
*/
|
||||
void AP_RangeFinder_TeraRangerI2C::timer(void)
|
||||
{
|
||||
@ -190,8 +190,8 @@ void AP_RangeFinder_TeraRangerI2C::update(void)
|
||||
state.last_reading_ms = AP_HAL::millis();
|
||||
accum.sum = 0;
|
||||
accum.count = 0;
|
||||
update_status();
|
||||
} else {
|
||||
update_status();
|
||||
} else if (AP_HAL::millis() - state.last_reading_ms > 200) {
|
||||
set_status(RangeFinder::RangeFinder_NoData);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user