mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-04 05:05:19 +08:00
FW Pos controller: fix format in new switch
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
JaeyoungLim
parent
c3e961a1ed
commit
ae9e91f90c
@@ -671,7 +671,8 @@ FixedwingPositionControl::do_takeoff_help(float *hold_altitude, float *pitch_lim
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FixedwingPositionControl::set_control_mode_current(bool pos_sp_curr_valid) {
|
FixedwingPositionControl::set_control_mode_current(bool pos_sp_curr_valid)
|
||||||
|
{
|
||||||
|
|
||||||
if ((_control_mode.flag_control_auto_enabled || _control_mode.flag_control_offboard_enabled) && pos_sp_curr_valid) {
|
if ((_control_mode.flag_control_auto_enabled || _control_mode.flag_control_offboard_enabled) && pos_sp_curr_valid) {
|
||||||
_control_mode_current = FW_POSCTRL_MODE_AUTO;
|
_control_mode_current = FW_POSCTRL_MODE_AUTO;
|
||||||
@@ -689,6 +690,7 @@ FixedwingPositionControl::set_control_mode_current(bool pos_sp_curr_valid) {
|
|||||||
_att_sp.roll_body = _manual_control_setpoint.y * radians(_param_fw_man_r_max.get());
|
_att_sp.roll_body = _manual_control_setpoint.y * radians(_param_fw_man_r_max.get());
|
||||||
_att_sp.yaw_body = 0;
|
_att_sp.yaw_body = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_control_mode_current = FW_POSCTRL_MODE_POSITION;
|
_control_mode_current = FW_POSCTRL_MODE_POSITION;
|
||||||
|
|
||||||
} else if (_control_mode.flag_control_altitude_enabled) {
|
} else if (_control_mode.flag_control_altitude_enabled) {
|
||||||
@@ -749,8 +751,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (_control_mode_current) {
|
switch (_control_mode_current) {
|
||||||
case FW_POSCTRL_MODE_AUTO:
|
case FW_POSCTRL_MODE_AUTO: {
|
||||||
{
|
|
||||||
/* reset hold altitude */
|
/* reset hold altitude */
|
||||||
_hold_alt = _current_altitude;
|
_hold_alt = _current_altitude;
|
||||||
|
|
||||||
@@ -811,11 +812,11 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
|
|||||||
/* just kicked out of loiter, reset roll integrals */
|
/* just kicked out of loiter, reset roll integrals */
|
||||||
_att_sp.roll_reset_integral = true;
|
_att_sp.roll_reset_integral = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FW_POSCTRL_MODE_POSITION:
|
case FW_POSCTRL_MODE_POSITION: {
|
||||||
{
|
|
||||||
/* update desired altitude based on user pitch stick input */
|
/* update desired altitude based on user pitch stick input */
|
||||||
update_desired_altitude(dt);
|
update_desired_altitude(dt);
|
||||||
|
|
||||||
@@ -914,11 +915,11 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
|
|||||||
_att_sp.roll_body = roll_sp_new;
|
_att_sp.roll_body = roll_sp_new;
|
||||||
_att_sp.yaw_body = 0;
|
_att_sp.yaw_body = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FW_POSCTRL_MODE_ALTITUDE:
|
case FW_POSCTRL_MODE_ALTITUDE: {
|
||||||
{
|
|
||||||
/* ALTITUDE CONTROL: pitch stick moves altitude setpoint, throttle stick sets airspeed */
|
/* ALTITUDE CONTROL: pitch stick moves altitude setpoint, throttle stick sets airspeed */
|
||||||
|
|
||||||
/* Get demanded airspeed */
|
/* Get demanded airspeed */
|
||||||
@@ -957,8 +958,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FW_POSCTRL_MODE_OTHER:
|
case FW_POSCTRL_MODE_OTHER: {
|
||||||
{
|
|
||||||
/* do not publish the setpoint */
|
/* do not publish the setpoint */
|
||||||
setpoint = false;
|
setpoint = false;
|
||||||
// reset hold altitude
|
// reset hold altitude
|
||||||
@@ -969,6 +969,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
|
|||||||
reset_landing_state();
|
reset_landing_state();
|
||||||
reset_takeoff_state();
|
reset_takeoff_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user