Skip to content

Commit

Permalink
Behavioral changes to Node Executor
Browse files Browse the repository at this point in the history
The stock node executor no longer "hunts" for the last dribbling
bit of the maneuver node and the "tolerance" setting has been
eliminated.  There is a 1 second terminal guidance period where
tracking is frozen and the burn terminates when the angle between
the heading and the maneuver node is >= 90 degrees.

This also backs out the MANEUVER_COT and thrustForward stuff for
asymmetric thrust vehicles.  This is because thrustForward isn't
valid if the engines are off.  Don't know if VesselState needs
fixing to fix thrustForward or if the node executor needs to
switch modes based on thrust being on or not, but it feels like
VesselState should be updated.

replaces #1771

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Oct 24, 2023
1 parent c79001f commit d7a69e0
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 152 deletions.
2 changes: 1 addition & 1 deletion MechJeb2/MechJebModuleAttitudeController.cs
Expand Up @@ -183,7 +183,7 @@ public Quaternion attitudeGetReferenceRotation(AttitudeReference reference)
switch (reference)
{
case AttitudeReference.INERTIAL_COT:
rotRef = Quaternion.FromToRotation(thrustForward, VesselState.forward) * rotRef;
rotRef = Quaternion.FromToRotation(thrustForward, VesselState.forward);
break;
case AttitudeReference.ORBIT:
rotRef = Quaternion.LookRotation(VesselState.orbitalVelocity.normalized, VesselState.up);
Expand Down
20 changes: 0 additions & 20 deletions MechJeb2/MechJebModuleManeuverPlanner.cs
Expand Up @@ -160,26 +160,6 @@ protected override void WindowGUI(int windowID)
GUILayout.Toggle(Core.Node.Autowarp, Localizer.Format("#MechJeb_Maneu_Autowarp"), GUILayout.ExpandWidth(true)); //"Auto-warp"

GUILayout.BeginVertical();
GUILayout.BeginHorizontal();
GUILayout.Label(Localizer.Format("#MechJeb_Maneu_Tolerance"), GUILayout.ExpandWidth(false)); //"Tolerance:"
Core.Node.Tolerance.text = GUILayout.TextField(Core.Node.Tolerance.text, GUILayout.Width(35), GUILayout.ExpandWidth(false));
if (GUILayout.Button("+", GUILayout.ExpandWidth(false)))
{
Core.Node.Tolerance.val += 0.1;
}

if (GUILayout.Button("-", GUILayout.ExpandWidth(false)))
{
Core.Node.Tolerance.val -= Core.Node.Tolerance.val > 0.1 ? 0.1 : 0.0;
}

if (GUILayout.Button("R", GUILayout.ExpandWidth(false)))
{
Core.Node.Tolerance.val = 0.1;
}

GUILayout.Label("m/s", GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal();
GUILayout.Label(Localizer.Format("#MechJeb_Maneu_Lead_time"), GUILayout.ExpandWidth(false)); //Lead time:
Expand Down
3 changes: 0 additions & 3 deletions MechJeb2/MechJebModuleNodeEditor.cs
Expand Up @@ -283,9 +283,6 @@ protected override void WindowGUI(int windowID)
GUILayout.BeginHorizontal();
Core.Node.Autowarp =
GUILayout.Toggle(Core.Node.Autowarp, Localizer.Format("#MechJeb_NodeEd_checkbox1"), GUILayout.ExpandWidth(true)); //"Auto-warp"
GUILayout.Label(Localizer.Format("#MechJeb_NodeEd_Label7"), GUILayout.ExpandWidth(false)); //"Tolerance:"
Core.Node.Tolerance.text = GUILayout.TextField(Core.Node.Tolerance.text, GUILayout.Width(35), GUILayout.ExpandWidth(false));
GUILayout.Label("m/s", GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
}

Expand Down

0 comments on commit d7a69e0

Please sign in to comment.