mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
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:
committed by
Lorenz Meier
parent
d9dd1b231d
commit
0dfd8cd039
@@ -985,12 +985,6 @@ FixedwingAttitudeControl::task_main()
|
|||||||
float gspd_scaling_trim = (_parameters.airspeed_min * 0.6f);
|
float gspd_scaling_trim = (_parameters.airspeed_min * 0.6f);
|
||||||
float groundspeed_scaler = gspd_scaling_trim / ((groundspeed < gspd_scaling_trim) ? gspd_scaling_trim : groundspeed);
|
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
|
// in STABILIZED mode we need to generate the attitude setpoint
|
||||||
// from manual user inputs
|
// from manual user inputs
|
||||||
if (!_vcontrol_mode.flag_control_climb_rate_enabled && !_vcontrol_mode.flag_control_offboard_enabled) {
|
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);
|
orb_publish_auto(_attitude_setpoint_id, &_attitude_sp_pub, &_att_sp, &instance, ORB_PRIO_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
roll_sp = _att_sp.roll_body;
|
float roll_sp = _att_sp.roll_body;
|
||||||
pitch_sp = _att_sp.pitch_body;
|
float pitch_sp = _att_sp.pitch_body;
|
||||||
yaw_sp = _att_sp.yaw_body;
|
float yaw_sp = _att_sp.yaw_body;
|
||||||
throttle_sp = _att_sp.thrust;
|
float throttle_sp = _att_sp.thrust;
|
||||||
|
float yaw_manual = 0.0f;
|
||||||
|
|
||||||
/* allow manual yaw in manual modes */
|
/* allow manual yaw in manual modes */
|
||||||
if (_vcontrol_mode.flag_control_manual_enabled) {
|
if (_vcontrol_mode.flag_control_manual_enabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user