Plane: Soaring: Use circling time as timeout if less than 20s.
This commit is contained in:
parent
6de4967a3d
commit
e0f524d425
@ -111,8 +111,9 @@ void Plane::update_soaring() {
|
|||||||
|
|
||||||
// Some other loiter status, we need to think about exiting loiter.
|
// Some other loiter status, we need to think about exiting loiter.
|
||||||
const uint32_t time_in_loiter_ms = AP_HAL::millis() - plane.soaring_mode_timer_ms;
|
const uint32_t time_in_loiter_ms = AP_HAL::millis() - plane.soaring_mode_timer_ms;
|
||||||
|
const uint32_t timeout = MIN(1000*g2.soaring_controller.get_circling_time(), 20000);
|
||||||
|
|
||||||
if (!soaring_exit_heading_aligned() && loiterStatus!=SoaringController::LoiterStatus::ALT_TOO_LOW && time_in_loiter_ms < 20000) {
|
if (!soaring_exit_heading_aligned() && loiterStatus != SoaringController::LoiterStatus::ALT_TOO_LOW && time_in_loiter_ms < timeout) {
|
||||||
// Heading not lined up, and not timed out or in a condition requiring immediate exit.
|
// Heading not lined up, and not timed out or in a condition requiring immediate exit.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -127,6 +127,8 @@ public:
|
|||||||
|
|
||||||
float get_alt_cutoff() const {return alt_cutoff;}
|
float get_alt_cutoff() const {return alt_cutoff;}
|
||||||
|
|
||||||
|
float get_circling_time() const {return _vario.tau;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// slow down messages if they are the same. During loiter we could smap the same message. Only show new messages during loiters
|
// slow down messages if they are the same. During loiter we could smap the same message. Only show new messages during loiters
|
||||||
LoiterStatus _cruise_criteria_msg_last;
|
LoiterStatus _cruise_criteria_msg_last;
|
||||||
|
Loading…
Reference in New Issue
Block a user