diff --git a/libraries/AP_TECS/AP_TECS.cpp b/libraries/AP_TECS/AP_TECS.cpp index 966c56f2a1..d6ea880ff4 100644 --- a/libraries/AP_TECS/AP_TECS.cpp +++ b/libraries/AP_TECS/AP_TECS.cpp @@ -241,6 +241,13 @@ const AP_Param::GroupInfo AP_TECS::var_info[] = { // @Values: 0:Disable,1:Enable // @User: Advanced AP_GROUPINFO("SYNAIRSPEED", 27, AP_TECS, _use_synthetic_airspeed, 0), + + // @Param: OPTIONS + // @DisplayName: Extra TECS options + // @Description: This allows the enabling of special features in the speed/height controller + // @Bitmask: 0:GliderOnly + // @User: Advanced + AP_GROUPINFO("OPTIONS", 28, AP_TECS, _options, 0), AP_GROUPEND }; @@ -1082,7 +1089,7 @@ void AP_TECS::update_pitch_throttle(int32_t hgt_dem_cm, _detect_bad_descent(); // when soaring is active we never trigger a bad descent - if (soaring_active) { + if (soaring_active || (_options & OPTION_GLIDER_ONLY)) { _flags.badDescent = false; } diff --git a/libraries/AP_TECS/AP_TECS.h b/libraries/AP_TECS/AP_TECS.h index 78739b6af6..4c0eb8c4db 100644 --- a/libraries/AP_TECS/AP_TECS.h +++ b/libraries/AP_TECS/AP_TECS.h @@ -166,6 +166,11 @@ private: AP_Int8 _pitch_min; AP_Int8 _land_pitch_max; AP_Float _maxSinkRate_approach; + AP_Int32 _options; + + enum { + OPTION_GLIDER_ONLY=(1<<0), + }; // temporary _pitch_max_limit. Cleared on each loop. Clear when >= 90 int8_t _pitch_max_limit = 90;