Skip to content

MASIMechJeb

MOARdV edited this page Sep 1, 2016 · 21 revisions

#MASIMechJeb.cs

MASIMechJeb provides the interface for controlling and querying MechJeb from Avionics Systems.

##General Category

The General category provides some non-specific queries and actions (such as whether MechJeb functionality is available on a given craft).

###mechjeb.AutopilotActive()

Returns 1 if any of the MechJeb autopilots MAS can control are active.

###mechjeb.Available()

Returns 1 if MechJeb is installed and available on this craft, 0 if it is not available.

###mechjeb.ComputerActive()

Returns 1 if any managed autopilots are engaged, or if SmartASS is not OFF.

###mechjeb.Reset()

Resets / disables all auto pilots as well as SmartASS.

##Ascent Autopilot and Guidance Category

The Ascent Autopilot and Guidance methods provide an interface to MechJeb's Ascent Autopilot.

###mechjeb.AscentAutopilotActive()

Returns 1 if the MJ Ascent Autopilot is enabled; 0 otherwise.

###mechjeb.GetDesiredLaunchAltitude()

Returns the MJ Ascent Autopilot's targeted launch altitude in meters.

###mechjeb.GetDesiredLaunchInclination()

Returns the MJ Ascent Autopilot's targeted orbital inclination in degrees.

###mechjeb.SetDesiredLaunchAltitude(double altitude)

Set the ascent guidance desired altitude. Altitude is in meters.

###mechjeb.SetDesiredLaunchInclination(double inclination)

Set the desired launch inclination in the ascent guidance.

###mechjeb.ToggleAscentAutopilot()

Toggles the Ascent Autopilot on or off.

##Landing Autopilot and Computer Category

The Landing Autopilot and Computer methods provide an interface to MechJeb's Landing Autopilot. It can also independently trigger the Landing Computer to provide landing predictions.

###mechjeb.LandingAutopilotActive()

Returns: 1 if the landing autopilot is active, 0 otherwise

Returns 1 if the MechJeb landing autopilot is engaged.

###mechjeb.LandingComputerActive()

Returns: 1 if the landing prediction computer is enabled; 0 otherwise.

Returns 1 if the MechJeb landing prediction computer is engaged.

###mechjeb.LandingAltitude()

Returns: Terrain Altitude in meters at the predicted landing site; 0 if the orbit does not land.

When the landing prediction computer is engaged, returns the predicted altitude of the landing site. Returns 0 otherwise.

###mechjeb.LandingLatitude()

Returns: Latitude in degrees; north is positive, south is negative; 0 if the prediciton computer is off or the orbit does not land.

When the landing prediction computer is engaged, returns the predicted latitude of the landing site. Returns 0 otherwise.

###mechjeb.LandingLongitude()

Returns: Longitude in degrees. West is negative, east is positive; 0 if the orbit will not land.

When the landing prediction computer is engaged, returns the predicted longitude of the landing site. Returns 0 otherwise.

###mechjeb.LandingTime()

Returns: Time in seconds until landing; 0 if the prediction computer is off or the orbit does not land.

When the prediction computer is engaged, returns the predicted time until landing.

###mechjeb.ToggleLandingAutopilot()

Toggles the MechJeb landing autopilot on/off.

###mechjeb.ToggleLandingComputer()

Toggles the MechJeb landing prediction computer on/off independently of the landing autopilot.

##Maneuver Planner and Node Executor Category

TODO

###mechjeb.ChangeApoapsis(double newAp)

  • newAp: The new apoapsis in meters.

Change apoapsis to the specified altitude in meters. Command is ignored if Ap < Pe or the orbit is hyperbolic and the vessel is already past the Pe.

###mechjeb.ChangePeriapsis(double newPe)

  • newPe: The new periapsis in meters.

Change Periapsis to the new altitude in meters. Command is ignored if Pe > Ap.

###mechjeb.CircularizeAt(double newAlt)

  • newAlt: The altitude to circularize the orbit at, in meters.

Circularize at the specified altitude, in meters. Command is ignored if an invalid altitude is supplied.

###mechjeb.ManeuverNodeExecutorActive()

Returns: 1 if the node exeuctor is enabled; 0 otherwise.

Returns 1 if the maneuver node executor is active, 0 otherwise.

###mechjeb.MatchVelocities()

Instructs MechJeb to match velocities with the target at closest approach.

###mechjeb.PlotTransfer()

When a target is selected and the following conditions are met, this method will instruct MechJeb to plot an optimized Hohmann transfer to intercept the target.

If the target orbits a different body, an interplanetary transfer is calculated.

###mechjeb.ToggleManeuverNodeExecutor()

Enables / disables Maneuver Node Executor

##Rendezvous Autopilot Category

The Rendezvous Autopilot category contains methods to interact with the Rendezvous Autopilot.

###mechjeb.RendezvousAutopilotActive()

Returns 1 if the rendezvous autopilot is engaged.

###mechjeb.ToggleRendezvousAutopilot()

Engages / disengages the MechJeb Rendezvous Autopilot

##SmartASS Category

MechJeb's SmartASS attitude control system can be queried and controlled using methods from this category.

###mechjeb.GetSASSMode()

Returns the number of the currently active SASS mode, or zero if MechJeb is unavailable.

  • OFF = 0,
  • KILLROT = 1,
  • NODE = 2,
  • SURFACE = 3,
  • PROGRADE = 4,
  • RETROGRADE = 5,
  • NORMAL_PLUS = 6,
  • NORMAL_MINUS = 7,
  • RADIAL_PLUS = 8,
  • RADIAL_MINUS = 9,
  • RELATIVE_PLUS = 10,
  • RELATIVE_MINUS = 11,
  • TARGET_PLUS = 12,
  • TARGET_MINUS = 13,
  • PARALLEL_PLUS = 14,
  • PARALLEL_MINUS = 15,
  • ADVANCED = 16,
  • AUTO = 17,
  • SURFACE_PROGRADE = 18,
  • SURFACE_RETROGRADE = 19,
  • HORIZONTAL_PLUS = 20,
  • HORIZONTAL_MINUS = 21,
  • VERTICAL_PLUS = 22,

###mechjeb.GetSASSModeActive(double mode)

Returns 1 if the current SASS mode matches the listed value.

  • OFF = 0,
  • KILLROT = 1,
  • NODE = 2,
  • SURFACE = 3,
  • PROGRADE = 4,
  • RETROGRADE = 5,
  • NORMAL_PLUS = 6,
  • NORMAL_MINUS = 7,
  • RADIAL_PLUS = 8,
  • RADIAL_MINUS = 9,
  • RELATIVE_PLUS = 10,
  • RELATIVE_MINUS = 11,
  • TARGET_PLUS = 12,
  • TARGET_MINUS = 13,
  • PARALLEL_PLUS = 14,
  • PARALLEL_MINUS = 15,
  • ADVANCED = 16,
  • AUTO = 17,
  • SURFACE_PROGRADE = 18,
  • SURFACE_RETROGRADE = 19,
  • HORIZONTAL_PLUS = 20,
  • HORIZONTAL_MINUS = 21,
  • VERTICAL_PLUS = 22,

###mechjeb.SASSOff()

Returns true if SmartASS is off

###mechjeb.SetSASSMode(double mode)

Set the SmartASS pilot to the specified mode. Some modes may not be 'settable', such as AUTO or ADVANCED.

  • OFF = 0,
  • KILLROT = 1,
  • NODE = 2,
  • SURFACE = 3,
  • PROGRADE = 4,
  • RETROGRADE = 5,
  • NORMAL_PLUS = 6,
  • NORMAL_MINUS = 7,
  • RADIAL_PLUS = 8,
  • RADIAL_MINUS = 9,
  • RELATIVE_PLUS = 10,
  • RELATIVE_MINUS = 11,
  • TARGET_PLUS = 12,
  • TARGET_MINUS = 13,
  • PARALLEL_PLUS = 14,
  • PARALLEL_MINUS = 15,
  • ADVANCED = 16,
  • AUTO = 17,
  • SURFACE_PROGRADE = 18,
  • SURFACE_RETROGRADE = 19,
  • HORIZONTAL_PLUS = 20,
  • HORIZONTAL_MINUS = 21,
  • VERTICAL_PLUS = 22,

This documentation was automatically generated from source code at 14:57 UTC on 1/Sep/2016.

Clone this wiki locally