2019-06-18 15:29:05 -03:00
|
|
|
//
|
|
|
|
// functions to support precision landing
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "Copter.h"
|
|
|
|
|
2023-03-22 05:45:41 -03:00
|
|
|
#if AC_PRECLAND_ENABLED
|
2019-06-18 15:29:05 -03:00
|
|
|
|
|
|
|
void Copter::init_precland()
|
|
|
|
{
|
2024-09-22 00:46:09 -03:00
|
|
|
// scheduler table specifies 400Hz, but we can call it no faster
|
|
|
|
// than the scheduler loop rate:
|
|
|
|
copter.precland.init(MIN(400, scheduler.get_loop_rate_hz()));
|
2019-06-18 15:29:05 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
void Copter::update_precland()
|
|
|
|
{
|
2021-04-14 01:02:18 -03:00
|
|
|
// alt will be unused if we pass false through as the second parameter:
|
|
|
|
return precland.update(rangefinder_state.alt_cm_glitch_protected,
|
|
|
|
rangefinder_alt_ok());
|
2019-06-18 15:29:05 -03:00
|
|
|
}
|
|
|
|
#endif
|