Update fw_att_control_main.cpp

Make the declarations of the  variables "roll_sp, pitch_sp, yaw_sp, throttle_sp," in the main loop more readable.
This commit is contained in:
CAI Dongcai 2017-06-04 16:25:54 +08:00 committed by Lorenz Meier
parent d9dd1b231d
commit 0dfd8cd039
1 changed files with 5 additions and 10 deletions

View File

@ -985,12 +985,6 @@ FixedwingAttitudeControl::task_main()
float gspd_scaling_trim = (_parameters.airspeed_min * 0.6f);
float groundspeed_scaler = gspd_scaling_trim / ((groundspeed < gspd_scaling_trim) ? gspd_scaling_trim : groundspeed);
float roll_sp = _parameters.rollsp_offset_rad;
float pitch_sp = _parameters.pitchsp_offset_rad;
float yaw_sp = 0.0f;
float yaw_manual = 0.0f;
float throttle_sp = 0.0f;
// in STABILIZED mode we need to generate the attitude setpoint
// from manual user inputs
if (!_vcontrol_mode.flag_control_climb_rate_enabled && !_vcontrol_mode.flag_control_offboard_enabled) {
@ -1009,10 +1003,11 @@ FixedwingAttitudeControl::task_main()
orb_publish_auto(_attitude_setpoint_id, &_attitude_sp_pub, &_att_sp, &instance, ORB_PRIO_DEFAULT);
}
roll_sp = _att_sp.roll_body;
pitch_sp = _att_sp.pitch_body;
yaw_sp = _att_sp.yaw_body;
throttle_sp = _att_sp.thrust;
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;
float yaw_manual = 0.0f;
/* allow manual yaw in manual modes */
if (_vcontrol_mode.flag_control_manual_enabled) {