From ab7b6fc39490ec9a1d19831ccd9420dd9c338079 Mon Sep 17 00:00:00 2001 From: DTaskiran Date: Fri, 26 Dec 2025 16:35:39 +0100 Subject: [PATCH] Commit fixes the bug from issue #2048 The bug occurs when using the autoascent feature for negative inclination orbits. Namely, the circularization burn was explicitly trying to achieve the _abs(inclination)_ instead of the target. The bug was fixed by removing the `Math.Abs()` from the OrbitalManeuverCalculator.DeltaVToChangeInclination input. --- MechJeb2/MechJebModuleAscentBaseAutopilot.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MechJeb2/MechJebModuleAscentBaseAutopilot.cs b/MechJeb2/MechJebModuleAscentBaseAutopilot.cs index ce887b1ea..3920b79c6 100644 --- a/MechJeb2/MechJebModuleAscentBaseAutopilot.cs +++ b/MechJeb2/MechJebModuleAscentBaseAutopilot.cs @@ -267,7 +267,7 @@ private void DriveCircularizationBurn() // FIXME? this inclination correction is unlikely to be at tha AN/DN and will throw the LAN off with anything other than high // TWR launches from equatorial launch sites -- should probably be made optional (or clip it if the correction is too large). Vector3d inclinationCorrection = - OrbitalManeuverCalculator.DeltaVToChangeInclination(Orbit, ut, Math.Abs(AscentSettings.DesiredInclination)); + OrbitalManeuverCalculator.DeltaVToChangeInclination(Orbit, ut, AscentSettings.DesiredInclination); Vector3d smaCorrection = OrbitalManeuverCalculator.DeltaVForSemiMajorAxis(Orbit.PerturbedOrbit(ut, inclinationCorrection), ut, AscentSettings.DesiredOrbitAltitude + MainBody.Radius); Vector3d dV = inclinationCorrection + smaCorrection;