Skip to content

Commit

Permalink
Node executor: aligned is good enough for RCS ullaging
Browse files Browse the repository at this point in the history
we shouldn't need to worry about being settled to start ullaging.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Nov 7, 2023
1 parent 3b4e45a commit e93ea6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions MechJeb2/MechJebModuleNodeExecutor.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -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()).
Expand Down

0 comments on commit e93ea6e

Please sign in to comment.