From e93ea6e535f732d81d0242df658724b690ee0563 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 7 Nov 2023 10:15:12 -0800 Subject: [PATCH] Node executor: aligned is good enough for RCS ullaging we shouldn't need to worry about being settled to start ullaging. Signed-off-by: Lamont Granquist --- MechJeb2/MechJebModuleNodeExecutor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MechJeb2/MechJebModuleNodeExecutor.cs b/MechJeb2/MechJebModuleNodeExecutor.cs index 598cb6a8..b483b4ba 100644 --- a/MechJeb2/MechJebModuleNodeExecutor.cs +++ b/MechJeb2/MechJebModuleNodeExecutor.cs @@ -143,7 +143,7 @@ private void DoRCS(FlightCtrlState s) if (!Vessel.ActionGroups[KSPActionGroup.RCS]) Vessel.ActionGroups.SetGroup(KSPActionGroup.RCS, true); - if (!AlignedAndSettled()) + if (!Aligned()) return; s.Z = -1.0F; @@ -290,7 +290,9 @@ private bool ShouldTerminateStock() private bool ShouldTerminate() => _isLoadedPrincipia ? ShouldTerminatePrincipia() : ShouldTerminateStock(); - private bool AlignedAndSettled() => AngleFromDirection() < Deg2Rad(1) && Core.vessel.angularVelocity.magnitude < 0.001; + private bool Aligned() => AngleFromDirection() < Deg2Rad(1); + + private bool AlignedAndSettled() => Aligned() && Core.vessel.angularVelocity.magnitude < 0.001; // This returns the angle to the node (in radians), note that you probably don't want to use this outside of // stock checks for maneuver termination, and probably never in principia (see SafeCurrentPrincipiaNode()).