mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 16:33:33 +08:00
fw-lat-lon: set altitude setpoint to NAN if height rate setpoint is provided.
When both are set, TECS only considers the height rate.
This commit is contained in:
@@ -206,7 +206,10 @@ void FwLateralLongitudinalControl::Run()
|
||||
const float airspeed_sp_eas = adapt_airspeed_setpoint(control_interval, _long_control_sp.equivalent_airspeed,
|
||||
_min_airspeed_from_guidance, _lateral_control_state.wind_speed.length());
|
||||
|
||||
tecs_update_pitch_throttle(control_interval, _long_control_sp.altitude,
|
||||
// If the both altitude and height rate are set, set altitude setpoint to NAN
|
||||
const float altitude_sp = PX4_ISFINITE(_long_control_sp.height_rate) ? NAN : _long_control_sp.altitude;
|
||||
|
||||
tecs_update_pitch_throttle(control_interval, altitude_sp,
|
||||
airspeed_sp_eas,
|
||||
_long_configuration.pitch_min,
|
||||
_long_configuration.pitch_max,
|
||||
|
||||
Reference in New Issue
Block a user