mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +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
|
||||
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) {
|
||||
_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.yaw_body = 0;
|
||||
}
|
||||
|
||||
_control_mode_current = FW_POSCTRL_MODE_POSITION;
|
||||
|
||||
} 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) {
|
||||
case FW_POSCTRL_MODE_AUTO:
|
||||
{
|
||||
case FW_POSCTRL_MODE_AUTO: {
|
||||
/* reset hold 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 */
|
||||
_att_sp.roll_reset_integral = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case FW_POSCTRL_MODE_POSITION:
|
||||
{
|
||||
case FW_POSCTRL_MODE_POSITION: {
|
||||
/* update desired altitude based on user pitch stick input */
|
||||
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.yaw_body = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case FW_POSCTRL_MODE_ALTITUDE:
|
||||
{
|
||||
case FW_POSCTRL_MODE_ALTITUDE: {
|
||||
/* ALTITUDE CONTROL: pitch stick moves altitude setpoint, throttle stick sets airspeed */
|
||||
|
||||
/* Get demanded airspeed */
|
||||
@@ -957,8 +958,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
|
||||
break;
|
||||
}
|
||||
|
||||
case FW_POSCTRL_MODE_OTHER:
|
||||
{
|
||||
case FW_POSCTRL_MODE_OTHER: {
|
||||
/* do not publish the setpoint */
|
||||
setpoint = false;
|
||||
// reset hold altitude
|
||||
@@ -969,6 +969,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
|
||||
reset_landing_state();
|
||||
reset_takeoff_state();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user