mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
fix(StickYaw): Fixes potential bug if unaided yaw becomes nan during execution in StickYaw.cpp (#25710)
* Fixes potential bug if unaided yaw becomes nan during execution: if unaided yaw becomes nan during execution the yaw correction would jumpt to 0 causing a large jump in yaw the change removes this jump by holding the current yaw correction instead * Remove Python extra paths from settings.json Removed Python extra paths from VS Code settings.
This commit is contained in:
parent
12babb33cb
commit
c2ea4e6121
@ -73,7 +73,8 @@ void StickYaw::generateYawSetpoint(float &yawspeed_setpoint, float &yaw_setpoint
|
||||
bool StickYaw::updateYawCorrection(const float yaw, const float unaided_yaw, const float deltatime)
|
||||
{
|
||||
if (!PX4_ISFINITE(unaided_yaw)) {
|
||||
_yaw_correction = 0.f;
|
||||
// If unaided yaw is not available we leave yaw_correction_ unchanged
|
||||
// Meaning yaw_setpoint - yaw_correction_prev + _yaw_correction = yaw_setpoint
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user