Skip to content

Commit

Permalink
fw_att_control: in acro use thrust from rate setpoint topic
Browse files Browse the repository at this point in the history
Signed-off-by: Roman <[email protected]>
  • Loading branch information
RomanBapst authored and LorenzMeier committed Mar 9, 2018
1 parent 7473027 commit 64b97cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/fw_att_control/FixedwingAttitudeControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down Expand Up @@ -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 &&
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 64b97cb

Please sign in to comment.