FlightTaskManual: fix two very stupid mistakes in the yaw hold logic

This commit is contained in:
Matthias Grob 2017-12-18 08:27:51 +01:00 committed by Beat Küng
parent 37e0f91c39
commit 089ebcbfa4

View File

@ -150,9 +150,9 @@ void FlightTaskManual::_updateYaw()
const float yaw_speed = _sticks(3) * math::radians(_man_yaw_max.get());
_setYawspeedSetpoint(yaw_speed);
const bool stick_yaw_zero = yaw_speed <= FLT_EPSILON;
const bool stick_yaw_zero = fabsf(yaw_speed) <= FLT_EPSILON;
if (stick_yaw_zero && !PX4_ISFINITE(_hold_position(2))) {
if (stick_yaw_zero && !PX4_ISFINITE(_hold_yaw)) {
_hold_yaw = _yaw;
} else if (!stick_yaw_zero) {