mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 01:19:07 +08:00
FlightTaskManual: fix two very stupid mistakes in the yaw hold logic
This commit is contained in:
parent
37e0f91c39
commit
089ebcbfa4
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user