# Maneuver Node¶

Contents

A planned velocity change along an orbit. These are the nodes that you can set in the KSP user interface. Setting one through kOS will make it appear on the in-game map view, and creating one manually on the in-game map view will cause it to be visible to kOS.

Warning

Be aware that a limitation of KSP makes it so that some vessels’ maneuver node systems cannot be accessed. KSP appears to limit the maneuver node system to only functioning on the current PLAYER vessel, under the presumption that its the only vessel that needs them, as ever other vessel cannot be maneuvered. kOS can maneuver a vessel that is not the player vessel, but it cannot overcome this limitation of the base game that unloads the maneuver node system for other vessels.

Be aware that the effect this has is that when you try to use some of these commands on some vessels, they won’t work because those vessels do not have their maneuver node system in play. This is mostly only going to happen when you try to run a script on a vessel that is not the current player active vessel.

## Creation¶

NODE(utime, radial, normal, prograde)
Parameters: utime – (sec) Time of this maneuver radial – (m/s) Delta-V in radial-out direction normal – (m/s) Delta-V normal to orbital plane prograde – (m/s) Delta-V in prograde direction ManeuverNode

You can make a maneuver node in a variable using the NODE function:

SET myNode to NODE( TIME:SECONDS+200, 0, 50, 10 ).


Once you have a maneuver node in a variable, you use the ADD and REMOVE commands to attach it to your vessel’s flight plan. A kOS CPU can only manipulate the flight plan of its CPU vessel.

Warning

When constructing a new node using the NODE function call, you use the universal time (you must add the ETA time to the current time to arrive at the value to pass in), but when using the suffix ManeuverNode:ETA, you do NOT use universal time, instead just giving the number of seconds from now.

Once you have created a node, it’s just a hypothetical node that hasn’t been attached to anything yet. To attach a node to the flight path, you must use the command ADD to attach it to the ship.

ADD

To put a maneuver node into the flight plan of the current CPU vessel (i.e. SHIP), just ADD it like so:

SET myNode to NODE( TIME:SECONDS+200, 0, 50, 10 ).


You should immediately see it appear on the map view when you do this. The ADD command can add nodes anywhere within the flight plan. To insert a node earlier in the flight than an existing node, simply give it a smaller ETA time and then ADD it.

Warning

As per the warning above at the top of the section, ADD won’t work on vessels that are not the active vessel.

REMOVE

To remove a maneuver node from the flight path of the current CPU vessel (i.e. SHIP), just REMOVE it like so:

REMOVE myNode.


Warning

As per the warning above at the top of the section, REMOVE won’t work on vessels that are not the active vessel.

NEXTNODE

NEXTNODE is a built-in variable that always refers to the next upcoming node that has been added to your flight plan:

SET MyNode to NEXTNODE.
REMOVE NEXTNODE.


Currently, if you attempt to query NEXTNODE and there is no node on your flight plan, it produces a run-time error. (This needs to be fixed in a future release so it is possible to query whether or not you have a next node).

Warning

As per the warning above at the top of the section, NEXTNODE won’t work on vessels that are not the active vessel.

The special identifier NEXTNODE is a euphemism for “whichever node is coming up soonest on my flight path”. Therefore you can remove a node even if you no longer have the maneuver node variable around, by doing this:

REMOVE NEXTNODE.

HASNODE
Type: Boolean Get only

Returns true if there is a planned maneuver ManeuverNode in the CPU vessel’s flight plan. This will always return false for the non-active vessel, as access to maneuver nodes is limited to the active vessel.

ALLNODES
Type: List of ManeuverNode elements Get only

Returns a list of all ManeuverNode objects currently on the CPU vessel’s flight plan. This list will be empty if no nodes are planned, or if the CPU vessel is currently unable to use maneuver nodes.

Note

If you store a reference to this list in a variable, the variable’s instance will not be automatically updated if you ADD or REMOVE maneuver nodes to the flight plan.

Note

Adding a ManeuverNode to this list, or a reference to this list will not add it to the flight plan. Use the ADD command instead.

## Structure¶

structure ManeuverNode

Here are some examples of accessing the suffixes of a ManeuverNode:

// creates a node 60 seconds from now with
SET X TO NODE(TIME:SECONDS+60, 0, 0, 100).

PRINT X:ETA.      // prints seconds till maneuver
PRINT X:DELTAV    // prints delta-v vector

REMOVE X.         // remove node from flight plan

// Create a blank node
SET X TO NODE(0, 0, 0, 0).

SET X:ETA to 30.       // Set to 30 sec from now

PRINT X:ORBIT:APOAPSIS.  // apoapsis after maneuver
PRINT X:ORBIT:PERIAPSIS. // periapsis after maneuver

Members
Suffix Type (units) Access Description
DELTAV Vector (m/s) Get only The burn vector with magnitude equal to delta-V
BURNVECTOR Vector (m/s) Get only Alias for DELTAV
ETA scalar (s) Get/Set Time until this maneuver
PROGRADE scalar (m/s) Get/Set Delta-V along prograde
RADIALOUT scalar (m/s) Get/Set Delta-V along radial to orbited Body
NORMAL scalar (m/s) Get/Set Delta-V along normal to the Vessel‘s Orbit
ORBIT Orbit Get only Expected Orbit after this maneuver
ManeuverNode:DELTAV
Access: Get only Vector

The vector giving the total burn of the node. The vector can be used to steer with, and its magnitude is the delta V of the burn.

ManeuverNode:BURNVECTOR

Alias for ManeuverNode:DELTAV.

ManeuverNode:ETA
Access: Get/Set scalar

The number of seconds until the expected burn time. If you SET this, it will actually move the maneuver node along the path in the map view, identically to grabbing the maneuver node and dragging it.

ManeuverNode:PROGRADE
Access: Get/Set scalar

The delta V in (meters/s) along just the prograde direction (the yellow and green ‘knobs’ of the maneuver node). A positive value is a prograde burn and a negative value is a retrograde burn.

ManeuverNode:RADIALOUT
Access: Get/Set scalar

The delta V in (meters/s) along just the radial direction (the cyan knobs’ of the maneuver node). A positive value is a radial out burn and a negative value is a radial in burn.

ManeuverNode:NORMAL
Access: Get/Set scalar

The delta V in (meters/s) along just the normal direction (the purple knobs’ of the maneuver node). A positive value is a normal burn and a negative value is an anti-normal burn.

ManeuverNode:ORBIT
Access: Get only Orbit

The new orbit patch that will begin starting with the burn of this node, under the assumption that the burn will occur exactly as planned.