Skip to content

Commit 4f708d7

Browse files
committed
FW: set attitude_setpoint.yaw to NAN if yaw is not controlled (instead of 0)
Signed-off-by: Silvan Fuhrer <[email protected]>
1 parent 4cf8eb8 commit 4f708d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/modules/fw_att_control/FixedwingAttitudeControl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ FixedwingAttitudeControl::vehicle_manual_poll()
155155
_att_sp.pitch_body = constrain(_att_sp.pitch_body,
156156
-radians(_param_fw_man_p_max.get()), radians(_param_fw_man_p_max.get()));
157157

158-
_att_sp.yaw_body = 0.0f;
158+
_att_sp.yaw_body = NAN;
159159
_att_sp.thrust_body[0] = math::constrain(_manual_control_setpoint.z, 0.0f, 1.0f);
160160

161161
Quatf q(Eulerf(_att_sp.roll_body, _att_sp.pitch_body, _att_sp.yaw_body));

src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ FixedwingPositionControl::set_control_mode_current(bool pos_sp_curr_valid)
693693
/* reset setpoints from other modes (auto) otherwise we won't
694694
* level out without new manual input */
695695
_att_sp.roll_body = _manual_control_setpoint.y * radians(_param_fw_man_r_max.get());
696-
_att_sp.yaw_body = 0;
696+
_att_sp.yaw_body = NAN;
697697
}
698698

699699
_control_mode_current = FW_POSCTRL_MODE_POSITION;
@@ -1678,7 +1678,7 @@ FixedwingPositionControl::control_altitude(const hrt_abstime &now, const Vector2
16781678
_manual_height_rate_setpoint_m_s);
16791679

16801680
_att_sp.roll_body = _manual_control_setpoint.y * radians(_param_fw_man_r_max.get());
1681-
_att_sp.yaw_body = 0;
1681+
_att_sp.yaw_body = NAN;
16821682

16831683
/* Copy thrust and pitch values from tecs */
16841684
if (_landed) {
@@ -1797,7 +1797,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
17971797
}
17981798

17991799
_att_sp.roll_body = roll_sp_new;
1800-
_att_sp.yaw_body = 0;
1800+
_att_sp.yaw_body = NAN;
18011801
}
18021802

18031803
/* Copy thrust and pitch values from tecs */

0 commit comments

Comments
 (0)