space_ex v0.3.0 SpaceEx.SpaceCenter.Vessel
These objects are used to interact with vessels in KSP.
This includes getting
orbital and flight data, manipulating control inputs and managing resources.
Created using SpaceEx.SpaceCenter.active_vessel/1
or SpaceEx.SpaceCenter.vessels/1
.
Link to this section Summary
Functions
The angular velocity of the vessel, in the given reference frame
An SpaceEx.SpaceCenter.AutoPilot
object, that can be used to perform
simple auto-piloting of the vessel
The maximum torque that the aerodynamic control surfaces can generate
The maximum torque that the currently active and gimballed engines can generate
The maximum torque that parts (excluding reaction wheels, gimballed engines, RCS and control surfaces) can generate
The maximum torque that the currently active RCS thrusters can generate
The maximum torque that the currently active and powered reaction wheels can generate
Gets the total available thrust that can be produced by the vessel's active engines, in Newtons
The maximum torque that the vessel generates
The name of the biome the vessel is currently in
The axis-aligned bounding box of the vessel in the given reference frame
Returns a SpaceEx.SpaceCenter.Comms
object that can be used to interact
with CommNet for this vessel
Returns a SpaceEx.SpaceCenter.Control
object that can be used to manipulate
the vessel's control inputs
The crew in the vessel
The number of crew that can occupy the vessel
The number of crew that are occupying the vessel
The direction in which the vessel is pointing, in the given reference frame
The total mass of the vessel, excluding resources, in kg
Returns a SpaceEx.SpaceCenter.Flight
object that can be used to get flight
telemetry for the vessel, in the specified reference frame
The inertia tensor of the vessel around its center of mass,
in the vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
)
The combined specific impulse of all active engines at sea level on Kerbin, in seconds
The total mass of the vessel, including resources, in kg
The total maximum thrust that can be produced by the vessel's active engines, in Newtons
The total maximum thrust that can be produced by the vessel's active engines when the vessel is in a vacuum, in Newtons
The mission elapsed time in seconds
The moment of inertia of the vessel around its center of mass in \(kg.m^2\)
The name of the vessel
The current orbit of the vessel
The reference frame that is fixed relative to the vessel, and orientated with the vessels orbital prograde/normal/radial directions
A SpaceEx.SpaceCenter.Parts
object, that can used to interact with the parts that make up this vessel
The position of the center of mass of the vessel, in the given reference frame
Recover the vessel
Whether the vessel is recoverable
The reference frame that is fixed relative to the vessel, and orientated with the vessel
A SpaceEx.SpaceCenter.Resources
object, that can used to get information
about resources stored in the vessel
Returns a SpaceEx.SpaceCenter.Resources
object, that can used to get
information about resources stored in a given stage
The rotation of the vessel, in the given reference frame
The name of the vessel
The type of the vessel
The situation the vessel is in
The combined specific impulse of all active engines, in seconds
The reference frame that is fixed relative to the vessel, and orientated with the surface of the body being orbited
The reference frame that is fixed relative to the vessel, and orientated with the velocity vector of the vessel relative to the surface of the body being orbited
The total thrust currently being produced by the vessel's engines, in Newtons
The type of the vessel
The combined vacuum specific impulse of all active engines, in seconds
The velocity of the center of mass of the vessel, in the given reference frame
Link to this section Functions
The angular velocity of the vessel, in the given reference frame.
Returns: The angular velocity as a vector. The magnitude of the vector is the rotational speed of the vessel, in radians per second. The direction of the vector indicates the axis of rotation, using the right-hand rule.
referenceFrame
— The reference frame the returned angular velocity is in.
An SpaceEx.SpaceCenter.AutoPilot
object, that can be used to perform
simple auto-piloting of the vessel.
The maximum torque that the aerodynamic control surfaces can generate.
Returns the torques in \(N.m\) around each of the coordinate axes of the
vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
These axes are equivalent to the pitch, roll and yaw axes of the vessel.
The maximum torque that the currently active and gimballed engines can generate.
Returns the torques in \(N.m\) around each of the coordinate axes of the
vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
These axes are equivalent to the pitch, roll and yaw axes of the vessel.
The maximum torque that parts (excluding reaction wheels, gimballed engines, RCS and control surfaces) can generate.
Returns the torques in \(N.m\) around each of the coordinate axes of the
vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
These axes are equivalent to the pitch, roll and yaw axes of the vessel.
The maximum torque that the currently active RCS thrusters can generate.
Returns the torques in \(N.m\) around each of the coordinate axes of the
vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
These axes are equivalent to the pitch, roll and yaw axes of the vessel.
The maximum torque that the currently active and powered reaction wheels can generate.
Returns the torques in \(N.m\) around each of the coordinate axes of the
vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
These axes are equivalent to the pitch, roll and yaw axes of the vessel.
Gets the total available thrust that can be produced by the vessel's active engines, in Newtons.
This is computed by summing
SpaceEx.SpaceCenter.Engine.available_thrust/2
for every active engine in the vessel.
The maximum torque that the vessel generates.
Includes contributions from
reaction wheels, RCS, gimballed engines and aerodynamic control surfaces.
Returns the torques in \(N.m\) around each of the coordinate axes of the
vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
These axes are equivalent to the pitch, roll and yaw axes of the vessel.
The name of the biome the vessel is currently in.
The axis-aligned bounding box of the vessel in the given reference frame.
Returns: The positions of the minimum and maximum vertices of the box, as position vectors.
referenceFrame
— The reference frame that the returned position vectors are in.
Returns a SpaceEx.SpaceCenter.Comms
object that can be used to interact
with CommNet for this vessel.
Returns a SpaceEx.SpaceCenter.Control
object that can be used to manipulate
the vessel's control inputs.
For example, its pitch/yaw/roll controls, RCS and thrust.
The crew in the vessel.
The number of crew that can occupy the vessel.
The number of crew that are occupying the vessel.
The direction in which the vessel is pointing, in the given reference frame.
Returns: The direction as a unit vector.
referenceFrame
— The reference frame that the returned direction is in.
The total mass of the vessel, excluding resources, in kg.
Returns a SpaceEx.SpaceCenter.Flight
object that can be used to get flight
telemetry for the vessel, in the specified reference frame.
referenceFrame
— Reference frame. Defaults to the vessel's surface reference frame (SpaceEx.SpaceCenter.Vessel.surface_reference_frame/2
).
The inertia tensor of the vessel around its center of mass,
in the vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
Returns the 3x3 matrix as a list of elements, in row-major order.
The combined specific impulse of all active engines at sea level on Kerbin, in seconds.
This is computed using the formula described here.
The total mass of the vessel, including resources, in kg.
The total maximum thrust that can be produced by the vessel's active engines, in Newtons.
This is computed by summing
SpaceEx.SpaceCenter.Engine.max_thrust/2
for every active engine.
The total maximum thrust that can be produced by the vessel's active engines when the vessel is in a vacuum, in Newtons.
This is computed by
summing SpaceEx.SpaceCenter.Engine.max_vacuum_thrust/2
for every active engine.
The mission elapsed time in seconds.
The moment of inertia of the vessel around its center of mass in \(kg.m^2\).
The inertia values in the returned 3-tuple are around the
pitch, roll and yaw directions respectively.
This corresponds to the vessels reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
The name of the vessel.
The current orbit of the vessel.
The reference frame that is fixed relative to the vessel, and orientated with the vessels orbital prograde/normal/radial directions.
The origin is at the center of mass of the vessel.
The axes rotate with the orbital prograde/normal/radial directions.
The x-axis points in the orbital anti-radial direction.
The y-axis points in the orbital prograde direction.
The z-axis points in the orbital normal direction.
Be careful not to confuse this with 'orbit' mode on the navball.
A SpaceEx.SpaceCenter.Parts
object, that can used to interact with the parts that make up this vessel.
The position of the center of mass of the vessel, in the given reference frame.
Returns: The position as a vector.
referenceFrame
— The reference frame that the returned position vector is in.
Recover the vessel.
Whether the vessel is recoverable.
The reference frame that is fixed relative to the vessel, and orientated with the vessel.
The origin is at the center of mass of the vessel.
The axes rotate with the vessel.
The x-axis points out to the right of the vessel.
The y-axis points in the forward direction of the vessel.
The z-axis points out of the bottom off the vessel.
A SpaceEx.SpaceCenter.Resources
object, that can used to get information
about resources stored in the vessel.
Returns a SpaceEx.SpaceCenter.Resources
object, that can used to get
information about resources stored in a given stage
.
stage
— Get resources for parts that are decoupled in this stage.cumulative
— Whenfalse
, returns the resources for parts decoupled in just the given stage. Whentrue
returns the resources decoupled in the given stage and all subsequent stages combined.
The rotation of the vessel, in the given reference frame.
Returns: The rotation as a quaternion of the form \((x, y, z, w)\).
referenceFrame
— The reference frame that the returned rotation is in.
The name of the vessel.
The type of the vessel.
The situation the vessel is in.
The combined specific impulse of all active engines, in seconds.
This is computed using the formula described here.
The reference frame that is fixed relative to the vessel, and orientated with the surface of the body being orbited.
The origin is at the center of mass of the vessel.
The axes rotate with the north and up directions on the surface of the body.
The x-axis points in the zenith direction (upwards, normal to the body being orbited, from the center of the body towards the center of mass of the vessel).
The y-axis points northwards towards the astronomical horizon (north, and tangential to the surface of the body — the direction in which a compass would point when on the surface).
The z-axis points eastwards towards the astronomical horizon (east, and tangential to the surface of the body — east on a compass when on the surface).
Be careful not to confuse this with 'surface' mode on the navball.
The reference frame that is fixed relative to the vessel, and orientated with the velocity vector of the vessel relative to the surface of the body being orbited.
The origin is at the center of mass of the vessel.
The axes rotate with the vessel's velocity vector.
The y-axis points in the direction of the vessel's velocity vector, relative to the surface of the body being orbited.
The z-axis is in the plane of the astronomical horizon.
The x-axis is orthogonal to the other two axes.
The total thrust currently being produced by the vessel's engines, in Newtons.
This is computed by summing SpaceEx.SpaceCenter.Engine.thrust/2
for
every engine in the vessel.
The type of the vessel.
The combined vacuum specific impulse of all active engines, in seconds.
This is computed using the formula described here.
The velocity of the center of mass of the vessel, in the given reference frame.
Returns: The velocity as a vector. The vector points in the direction of travel, and its magnitude is the speed of the body in meters per second.
referenceFrame
— The reference frame that the returned velocity vector is in.