TargetController#

TargetController

The target controller, which holds MechJeb’s target.

Note

Positions and directions are in world space, the coordinate system of the game’s physics.

A TargetController object is passed and returned as its identifier, a number. A path that acts on an object takes it as (id).

GET /mech-jeb/target-controller/(id)/can-align#

Whether the vessel can align with the target, which it can with a docking port. Throws an exception if there is no target.

Parameters:
Response JSON Object:
  • value (bool)

GET /mech-jeb/target-controller/(id)/distance#

The distance to the target, in meters. Throws an exception if there is no target.

Parameters:
Response JSON Object:
  • value (float)

GET /mech-jeb/target-controller/(id)/docking-axis#

The world space docking axis of the target. Throws an exception if there is no target.

Parameters:
Response JSON Object:
  • value (tuple<double, double, double>)

GET /mech-jeb/target-controller/(id)/normal-target-exists#

Whether there is a target that is a vessel, a body or a direction target.

Parameters:
Response JSON Object:
  • value (bool)

GET /mech-jeb/target-controller/(id)/position#

The world space position of the target. Throws an exception if there is no target.

Parameters:
Response JSON Object:
  • value (tuple<double, double, double>)

GET /mech-jeb/target-controller/(id)/position-target-exists#

Whether there is a target that is a position or a vessel.

Parameters:
Response JSON Object:
  • value (bool)

GET /mech-jeb/target-controller/(id)/relative-position#

The world space position of the vessel relative to the target. Throws an exception if there is no target.

Parameters:
Response JSON Object:
  • value (tuple<double, double, double>)

GET /mech-jeb/target-controller/(id)/relative-velocity#

The world space velocity of the vessel relative to the target, in \(\mathrm{m/s}\). Throws an exception if there is no target.

Parameters:
Response JSON Object:
  • value (tuple<double, double, double>)

POST /mech-jeb/target-controller/(id)/set-direction-target#

Set the target to a direction.

Parameters:
Request JSON Object:
  • name (string) – The name of the target.

GET /mech-jeb/target-controller/(id)/target-orbit#

The orbit of the target. Throws an exception if there is no target, or the target has no orbit.

Parameters:
Response JSON Object:
  • value (SpaceCenter.Orbit)

POST /mech-jeb/target-controller/(id)/update-direction-target#

Set the direction of the direction target.

Parameters:
Request JSON Object:
  • direction (tuple<double, double, double>) – The world space direction.