Skip to content

Commit

Permalink
Update fw_att_control_main.cpp
Browse files Browse the repository at this point in the history
Make the declarations of the  variables "roll_sp, pitch_sp, yaw_sp, throttle_sp," in the main loop more readable.
  • Loading branch information
oneWayOut authored and LorenzMeier committed Jun 4, 2017
1 parent d9dd1b2 commit 0dfd8cd
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/modules/fw_att_control/fw_att_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 0dfd8cd

Please sign in to comment.