diff --git a/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp b/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp index 40d4fa08fbd..018d4b9e33b 100644 --- a/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp +++ b/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp @@ -754,7 +754,7 @@ float FwLateralLongitudinalControl::getGuidanceQualityFactor(const vehicle_local 0.f, 1.f)); // Check that the angle between heading and track is not off too much. if it is greater than 90° we will be pushed back from the wind and the npfg will propably give a roll command in the wrong direction. - const Vector2f heading_vector(matrix::Dcm2f(local_pos.heading)*Vector2f({1.f, 0.f})); + const Vector2f heading_vector(matrix::Dcm2f(_yaw)*Vector2f({1.f, 0.f})); const Vector2f ground_vel_norm(ground_vel.normalized()); const float flying_forward_factor(math::constrain((heading_vector.dot(ground_vel_norm) - COS_HEADING_TRACK_ANGLE_PUSHED_BACK) / ((COS_HEADING_TRACK_ANGLE_NOT_PUSHED_BACK - diff --git a/src/modules/fw_mode_manager/FixedWingModeManager.cpp b/src/modules/fw_mode_manager/FixedWingModeManager.cpp index b69330a5e79..41af5d102f4 100644 --- a/src/modules/fw_mode_manager/FixedWingModeManager.cpp +++ b/src/modules/fw_mode_manager/FixedWingModeManager.cpp @@ -1989,7 +1989,7 @@ float FixedWingModeManager::rollAngleToLateralAccel(float roll_body) const void FixedWingModeManager::control_backtransition_heading_hold() { if (!PX4_ISFINITE(_backtrans_heading)) { - _backtrans_heading = _local_pos.heading; + _backtrans_heading = _yaw; } fixed_wing_lateral_setpoint_s fw_lateral_ctrl_sp{empty_lateral_control_setpoint};