Skip to content
Snippets Groups Projects
Commit 64b97cb1 authored by Roman's avatar Roman Committed by Lorenz Meier
Browse files

fw_att_control: in acro use thrust from rate setpoint topic


Signed-off-by: default avatarRoman <bapstroman@gmail.com>
parent 74730273
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment