Browse Source

Plane: Soaring: Use circling time as timeout if less than 20s.

zr-v5.1
Samuel Tabor 5 years ago committed by Tom Pittenger
parent
commit
e0f524d425
  1. 3
      ArduPlane/soaring.cpp
  2. 2
      libraries/AP_Soaring/AP_Soaring.h

3
ArduPlane/soaring.cpp

@ -111,8 +111,9 @@ void Plane::update_soaring() { @@ -111,8 +111,9 @@ void Plane::update_soaring() {
// 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 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.
break;
}

2
libraries/AP_Soaring/AP_Soaring.h

@ -127,6 +127,8 @@ public: @@ -127,6 +127,8 @@ public:
float get_alt_cutoff() const {return alt_cutoff;}
float get_circling_time() const {return _vario.tau;}
private:
// 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;

Loading…
Cancel
Save