Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fw_att_control: in acro use thrust from rate setpoint topic #9048

Merged
merged 1 commit into from
Mar 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -617,7 +617,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 @@ -694,8 +693,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 @@ -758,7 +757,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