FW: set attitude_setpoint.yaw to NAN if yaw is not controlled (instead of 0)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2021-10-19 15:40:39 +02:00
parent 4cf8eb8226
commit 4f708d7a6f
2 changed files with 4 additions and 4 deletions

View File

@ -155,7 +155,7 @@ FixedwingAttitudeControl::vehicle_manual_poll()
_att_sp.pitch_body = constrain(_att_sp.pitch_body,
-radians(_param_fw_man_p_max.get()), radians(_param_fw_man_p_max.get()));
_att_sp.yaw_body = 0.0f;
_att_sp.yaw_body = NAN;
_att_sp.thrust_body[0] = math::constrain(_manual_control_setpoint.z, 0.0f, 1.0f);
Quatf q(Eulerf(_att_sp.roll_body, _att_sp.pitch_body, _att_sp.yaw_body));

View File

@ -693,7 +693,7 @@ FixedwingPositionControl::set_control_mode_current(bool pos_sp_curr_valid)
/* reset setpoints from other modes (auto) otherwise we won't
* level out without new manual input */
_att_sp.roll_body = _manual_control_setpoint.y * radians(_param_fw_man_r_max.get());
_att_sp.yaw_body = 0;
_att_sp.yaw_body = NAN;
}
_control_mode_current = FW_POSCTRL_MODE_POSITION;
@ -1678,7 +1678,7 @@ FixedwingPositionControl::control_altitude(const hrt_abstime &now, const Vector2
_manual_height_rate_setpoint_m_s);
_att_sp.roll_body = _manual_control_setpoint.y * radians(_param_fw_man_r_max.get());
_att_sp.yaw_body = 0;
_att_sp.yaw_body = NAN;
/* Copy thrust and pitch values from tecs */
if (_landed) {
@ -1797,7 +1797,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
}
_att_sp.roll_body = roll_sp_new;
_att_sp.yaw_body = 0;
_att_sp.yaw_body = NAN;
}
/* Copy thrust and pitch values from tecs */