fw_att_control: in acro use thrust from rate setpoint topic

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman
2018-03-09 11:04:39 +01:00
committed by Lorenz Meier
parent 74730273c1
commit 64b97cb18e
@@ -613,7 +613,6 @@ void FixedwingAttitudeControl::run()
float roll_sp = _att_sp.roll_body;
float pitch_sp = _att_sp.pitch_body;
float yaw_sp = _att_sp.yaw_body;
float throttle_sp = _att_sp.thrust;
/* Prepare data for attitude controllers */
struct ECL_ControlData control_input = {};
@@ -708,8 +707,8 @@ void FixedwingAttitudeControl::run()
}
/* throttle passed through if it is finite and if no engine failure was detected */
_actuators.control[actuator_controls_s::INDEX_THROTTLE] = (PX4_ISFINITE(throttle_sp)
&& !_vehicle_status.engine_failure) ? throttle_sp : 0.0f;
_actuators.control[actuator_controls_s::INDEX_THROTTLE] = (PX4_ISFINITE(_att_sp.thrust)
&& !_vehicle_status.engine_failure) ? _att_sp.thrust : 0.0f;
/* scale effort by battery status */
if (_parameters.bat_scale_en &&
@@ -772,7 +771,7 @@ void FixedwingAttitudeControl::run()
_actuators.control[actuator_controls_s::INDEX_YAW] = (PX4_ISFINITE(yaw_u)) ? yaw_u + _parameters.trim_yaw :
_parameters.trim_yaw;
_actuators.control[actuator_controls_s::INDEX_THROTTLE] = PX4_ISFINITE(throttle_sp) ? throttle_sp : 0.0f;
_actuators.control[actuator_controls_s::INDEX_THROTTLE] = PX4_ISFINITE(_rates_sp.thrust) ? _rates_sp.thrust : 0.0f;
}
rate_ctrl_status_s rate_ctrl_status;