@@ -973,6 +973,7 @@ FixedwingPositionControl::control_auto_descend(const float control_interval)
973
973
// Hard-code descend rate to 0.5m/s. This is a compromise to give the system to recover,
974
974
// but not letting it drift too far away.
975
975
const float descend_rate = -0 .5f ;
976
+ const bool disable_underspeed_handling = false ;
976
977
977
978
tecs_update_pitch_throttle (control_interval,
978
979
_current_altitude,
@@ -983,7 +984,7 @@ FixedwingPositionControl::control_auto_descend(const float control_interval)
983
984
_param_fw_thr_max.get (),
984
985
_param_sinkrate_target.get (),
985
986
_param_climbrate_target.get (),
986
- false ,
987
+ disable_underspeed_handling ,
987
988
descend_rate);
988
989
989
990
const float roll_body = math::radians (_param_nav_gpsf_r.get ()); // open loop loiter bank angle
@@ -1170,6 +1171,7 @@ FixedwingPositionControl::control_auto_velocity(const float control_interval, co
1170
1171
target_airspeed = _npfg.getAirspeedRef () / _eas2tas;
1171
1172
1172
1173
float yaw_body = _yaw;
1174
+ const bool disable_underspeed_handling = false ;
1173
1175
1174
1176
tecs_update_pitch_throttle (control_interval,
1175
1177
position_sp_alt,
@@ -1180,7 +1182,7 @@ FixedwingPositionControl::control_auto_velocity(const float control_interval, co
1180
1182
tecs_fw_thr_max,
1181
1183
_param_sinkrate_target.get (),
1182
1184
_param_climbrate_target.get (),
1183
- false ,
1185
+ disable_underspeed_handling ,
1184
1186
pos_sp_curr.vz );
1185
1187
const float pitch_body = get_tecs_pitch ();
1186
1188
@@ -1541,6 +1543,8 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
1541
1543
_tecs.resetIntegrals ();
1542
1544
}
1543
1545
1546
+ const bool disable_underspeed_handling = true ;
1547
+
1544
1548
tecs_update_pitch_throttle (control_interval,
1545
1549
altitude_setpoint_amsl,
1546
1550
target_airspeed,
@@ -1550,7 +1554,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
1550
1554
_param_fw_thr_max.get (),
1551
1555
_param_sinkrate_target.get (),
1552
1556
_performance_model.getMaximumClimbRate (_air_density),
1553
- true ); // disable underspeed handling
1557
+ disable_underspeed_handling);
1554
1558
1555
1559
_tecs.set_equivalent_airspeed_min (_performance_model.getMinimumCalibratedAirspeed ()); // reset after TECS calculation
1556
1560
@@ -1626,6 +1630,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
1626
1630
1627
1631
const float max_takeoff_throttle = (_launchDetector.getLaunchDetected () < launch_detection_status_s::STATE_FLYING) ?
1628
1632
_param_fw_thr_idle.get () : _param_fw_thr_max.get ();
1633
+ const bool disable_underspeed_handling = true ;
1629
1634
1630
1635
tecs_update_pitch_throttle (control_interval,
1631
1636
altitude_setpoint_amsl,
@@ -1636,7 +1641,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
1636
1641
max_takeoff_throttle,
1637
1642
_param_sinkrate_target.get (),
1638
1643
_performance_model.getMaximumClimbRate (_air_density),
1639
- true ); // disable underspeed handling
1644
+ disable_underspeed_handling);
1640
1645
1641
1646
if (_launchDetector.getLaunchDetected () < launch_detection_status_s::STATE_FLYING) {
1642
1647
// explicitly set idle throttle until motors are enabled
@@ -1813,6 +1818,7 @@ FixedwingPositionControl::control_auto_landing_straight(const hrt_abstime &now,
1813
1818
const float throttle_max = flare_ramp_interpolator_sqrt * _param_fw_thr_idle.get () +
1814
1819
(1 .0f - flare_ramp_interpolator_sqrt) *
1815
1820
_param_fw_thr_max.get ();
1821
+ const bool disable_underspeed_handling = true ;
1816
1822
1817
1823
tecs_update_pitch_throttle (control_interval,
1818
1824
altitude_setpoint,
@@ -1823,7 +1829,7 @@ FixedwingPositionControl::control_auto_landing_straight(const hrt_abstime &now,
1823
1829
throttle_max,
1824
1830
_param_sinkrate_target.get (),
1825
1831
_param_climbrate_target.get (),
1826
- true ,
1832
+ disable_underspeed_handling ,
1827
1833
height_rate_setpoint);
1828
1834
1829
1835
/* set the attitude and throttle commands */
@@ -2029,6 +2035,7 @@ FixedwingPositionControl::control_auto_landing_circular(const hrt_abstime &now,
2029
2035
const float throttle_max = flare_ramp_interpolator_sqrt * _param_fw_thr_idle.get () +
2030
2036
(1 .0f - flare_ramp_interpolator_sqrt) *
2031
2037
_param_fw_thr_max.get ();
2038
+ const bool disable_underspeed_handling = true ;
2032
2039
2033
2040
tecs_update_pitch_throttle (control_interval,
2034
2041
_current_altitude, // is not controlled, control descend rate
@@ -2039,7 +2046,7 @@ FixedwingPositionControl::control_auto_landing_circular(const hrt_abstime &now,
2039
2046
throttle_max,
2040
2047
_param_sinkrate_target.get (),
2041
2048
_param_climbrate_target.get (),
2042
- true ,
2049
+ disable_underspeed_handling ,
2043
2050
height_rate_setpoint);
2044
2051
2045
2052
/* set the attitude and throttle commands */
@@ -2085,6 +2092,8 @@ FixedwingPositionControl::control_auto_landing_circular(const hrt_abstime &now,
2085
2092
const float glide_slope_sink_rate = airspeed_land * glide_slope / sqrtf (glide_slope * glide_slope + 1 .0f );
2086
2093
const float desired_max_sinkrate = math::min (math::max (glide_slope_sink_rate, _param_sinkrate_target.get ()),
2087
2094
_param_fw_t_sink_max.get ());
2095
+ const bool disable_underspeed_handling = false ;
2096
+
2088
2097
tecs_update_pitch_throttle (control_interval,
2089
2098
_current_altitude, // is not controlled, control descend rate
2090
2099
target_airspeed,
@@ -2094,7 +2103,7 @@ FixedwingPositionControl::control_auto_landing_circular(const hrt_abstime &now,
2094
2103
_param_fw_thr_max.get (),
2095
2104
desired_max_sinkrate,
2096
2105
_param_climbrate_target.get (),
2097
- false ,
2106
+ disable_underspeed_handling ,
2098
2107
-glide_slope_sink_rate); // heightrate = -sinkrate
2099
2108
2100
2109
/* set the attitude and throttle commands */
@@ -2151,6 +2160,8 @@ FixedwingPositionControl::control_manual_altitude(const float control_interval,
2151
2160
throttle_max = 0 .0f ;
2152
2161
}
2153
2162
2163
+ const bool disable_underspeed_handling = false ;
2164
+
2154
2165
tecs_update_pitch_throttle (control_interval,
2155
2166
_current_altitude,
2156
2167
calibrated_airspeed_sp,
@@ -2160,7 +2171,7 @@ FixedwingPositionControl::control_manual_altitude(const float control_interval,
2160
2171
throttle_max,
2161
2172
_param_sinkrate_target.get (),
2162
2173
_param_climbrate_target.get (),
2163
- false ,
2174
+ disable_underspeed_handling ,
2164
2175
height_rate_sp);
2165
2176
2166
2177
float roll_body = _manual_control_setpoint.roll * radians (_param_fw_r_lim.get ());
@@ -2251,6 +2262,8 @@ FixedwingPositionControl::control_manual_position(const float control_interval,
2251
2262
}
2252
2263
}
2253
2264
2265
+ const bool disable_underspeed_handling = false ;
2266
+
2254
2267
tecs_update_pitch_throttle (control_interval,
2255
2268
_current_altitude, // TODO: check if this is really what we want.. or if we want to lock the altitude.
2256
2269
calibrated_airspeed_sp,
@@ -2260,7 +2273,7 @@ FixedwingPositionControl::control_manual_position(const float control_interval,
2260
2273
throttle_max,
2261
2274
_param_sinkrate_target.get (),
2262
2275
_param_climbrate_target.get (),
2263
- false ,
2276
+ disable_underspeed_handling ,
2264
2277
height_rate_sp);
2265
2278
2266
2279
if (!_yaw_lock_engaged || fabsf (_manual_control_setpoint.roll ) >= HDG_HOLD_MAN_INPUT_THRESH ||
0 commit comments