Class in Zendir.Universe | Inherits from PhysicalObject

Declaration

class Spacecraft;

Description

The spacecraft is a complex object that is used to represent a spacecraft in the simulation. It is a physical object that can be affected by external forces, contain state and dynamic effectors and is able to be integrated.


Properties

DeclaredDescription
AccelerationThe acceleration of the body in the inertial frame
AttitudeThe attitude of the dynamic body in the form of a ModifiedRodriguez Parameter (MRP). This is converted from the transformationof the local frame. This is equivalent to Transform_BN_N.
AttitudeRateStores the current body attitude rate in the body frame
DynamicTypeThe type of orbit propagation that is used for this object.
GeodeticCoordinatesA geodetic coordinates for the spacecraft relative to the orbiting planet.This will be in the form of latitude, longitude and altitude, where the unitsare in degrees and meters.
HubA reference to the hub spacecraft. If there is no hub spacecraft, it is assumedto be itself. Otherwise, the mass properties and physics will be applied to thehub spacecraft instead.
HubTransformThe relative transform between the hub and the spacecraft. This is used forcalculations of position and rotation based on the hub spacecraft.
In_PlanetStateMsgA reference to the planet state message of the nearest bodythat the spacecraft is orbiting.
InitialOrbitThe initial classical elements of the body if the orbit is set
InitialOrbitTimeThe simulation time in which the initial orbit was calculated.
InitialPeriodThe orbital period of the body if the initial orbit is set
IntegratePostLookupA flag for if the body should integrate its state after the lookup is completed
LookupFilePathThe full file path for the CSV file, if it exists. This will ensure thata lookup table can be loaded correctly if the file path is valid and notempty.
LookupRepeatA flag for if the body should repeat the lookup data at the end of the data set,making a loop of the data.
LookupRotationTypeThe type of the rotation used for the orbital trajectories
LookupTimeThe current time on the lookup trajectory
LookupTrajectoryTypeThe type of trajectory used for the orbital trajectories
OrbitedBodyThe name of the body that this object is currently orbiting, if itexists. This will be used to calculate the gravitational forces actingaround that body.
Out_BodyMassMsgThe body mass properties message that stores the mass propertiesfrom all of the components that are added to this body. This willbe the sum of all components and is used by the integrator.
Out_GravityMsgThe gravitational message that describes the gravitational energy of theobject at a particular location.
Out_SpacecraftStateMsgThe body states message of the spacecraft contains all the informationabout the spacecraft’s properties, including the position, energy andacceleration.
OverrideMassA flag whether to override the mass properties with somenew custom ones. If this flag is enabled, the local massvalues, including Center of Mass and Moment of Inertia,will be used instead of the totals for the mass calculation.
PositionThe position of the body in the inertial world state
Position_CN_NThe center of mass inertial position
TotalCenterOfMassB_BThe total center of mass in the body frame including allcomponents attached
TotalMassThe total mass of the body including all components
TotalMomentOfInertiaB_BThe total moment of inertia in the body frame including allcomponents attached
VelocityThe velocity of the body in the inertial frame
WGSCoordinatesA WGS Accurate Earth model coordinate system with the Earth as the centerbeing used for the position.
InheritedDescription
BehavioursA collection of behaviours attached to this object.
CenterOfMassB_BThe center of mass of the component in respect to the bodyframe (B) of the component. This is isolated from any childrenand exists in isolation.
CenterOfMassDot_LB_BThe center of mass time-derivative of the component within itsown local coordinates. This does not include any of the sub-componentsand exists in isolation.
CenterOfMassDotB_BThe center of mass time-derivative of the component relative tothe body frame (B). This does not include any of the sub-componentsand exists in isolation.
CenterOfMassL_LThe center of mass of the component within its own localcoordinates. This does not include any of the sub-components andexists in isolation.
CenterOfMassPrime_LB_BThe center of mass general-derivative of the component within itsown local coordinates. This does not include any of the sub-componentsand exists in isolation.
CenterOfMassPrimeB_B[m/s] The center of mass general-derivative of the component relativeto the body frame (B). This does not include any of the sub-componentsand exists in isolation.
ChildrenA collection of children attached to this object.
DCM_BNThe rotational DCM matrix between the body frame (B) at the topof this component chain and the inertial frame (N).
DCM_LBThe rotational DCM matrix between the component frame of thisobject (L) relative to the body frame (B).
DCM_LNThe DCM rotational matrix of the component relative to theinertial origin (N) of the world.
IsEnabledIs true if the object is currently enabled.
LocalForwardThe direction of the transform frame’s forward vector, which is along the Y axis.
LocalRightThe direction of the transform frame’s right vector, which is along the X axis.
LocalUpThe direction of the transform frame’s up vector, which is along the Z axis.
MassThe component mass defined in the object. This is independentof any parent or children objects and exists in isolation.
MassDotThe component mass time-derivative defined in the object. Thisis independent of any parent or children objects and exists in isolation.
ModelsA collection of models attached to this object.
MomentOfInertia_LBThe moment of inertia of the component, measured at thelocal center of mass, represented with its own local coordinates.This does not include any of the sub-components and exists inisolation.
MomentOfInertiaB_BThe moment of inertia of this component, measured inthe body frame relative to the parented body. This is independentof any children and exists in isolation.
MomentOfInertiaPrime_LBThe derivative of the moment of inertia of the component,measured at the local center of mass, represented with its own localcoordinates. This does not include any of the sub-components andexists in isolation.
MomentOfInertiaPrimeB_BThe derivative of the moment of inertia of the component,represented in the body frame (B). This is independent and exists inisolation.
NameThe display name or tag of this object.
Out_ComponentMassMsgThe component mass message defines the set of mass properties andstates of the system within this component locally. This is independentof any parent or children properties or objects.
Out_TransformMsgThis defines the base transform message that stores the state of the transform of this object.
ParentThe currently attached parent object (if any).
Position_BN_NThe position of the body (the root parent B) in theinertial frame relative to the inertial point (N).
Position_LB_BThe position of the component relative to the rootobject of this hierarchy. This is in the inertial frameand if the component is the root object, then there willbe no position.
Position_LN_NThe position of the inertial world space. This position isderived from the world’s transform (N).
RootThe root object in the parent chain.
Rotation[-] The rotation of the object relative to the parent or to the world origin, if no parent exists.
ThermalA reference to the thermal model that is attached to this object.This will allow the object to have thermal properties and be ableto be used in thermal simulations.

Methods

DeclaredDescription
ComputeEnergyMomentumComputes the total energy and momentum of the object. It finds the total orbital energy,total orbital angular momentum, total rotational energy and total rotational angular momentum.These values are used for validation purposes
DockDocks the spacecraft to another spacecraft. This will determinewhich spacecraft is the hub and which is the child. The hub willbe the one with the largest mass. The child will be the other one.
GetLookupTrajectoryCoordinatesReturns a list of all the lookup data positions from the lookup table,if they exist. These will be in the form of a Geodetic or PCI frame,depending on the input type.
GetOrbitalPositionReturns the position between the spacecraft and the orbited body.If there is no orbiting body, this will be the spacecraft’s inertialposition.
GetOrbitalVelocityReturns the velocity between the spacecraft and the orbited body.If there is no orbiting body, this will be the spacecraft’s inertialvelocity.
GetRelativePositionReturns the relative position between the body and anotherplanet.
GetRelativeVelocityReturns the relative velocity between the body and anotherplanet.
InitialiseBodyInitialises the object with a series of elements from the Vector elements library
IsConnectedReturns whether this spacecraft is connected to another spacecraft.
IsDockedReturns true if the spacecraft is docked to another hub. Thiswill return true if the spacecraft is not the hub itself.
SetClassicElementsSets the classic elements of a body to a series of parameters based onthe Keplerian elements.
SetCustomTrajectorySets the path to the lookup data to read from. This should be an absolute pathto the CSV file with the data from the file. This assumes the file is of the correctformat, but will not throw an error if not.
SetGeodeticElementsSets the Geodetic Elements of Latitude, Longitude and Altitude to some propertiesin the element struct.
SetHillFrameElementsConfigures the spacecraft to be in a Hill frame with another (chief) spacecraft. Thisframe is a relative position and velocity in the Hill frame, where X is the radial directionaway from the chief, Y is the along-track direction and Z is the orbit normal direction.
SetRelativeBodyVectorElementsSets the relative position and velocity of a body to a series of parameters based onanother spacecraft and the relative position and velocity, in the body frame.
SetRelativeVectorElementsSets the relative position and velocity of a body to a series of parameters based onanother spacecraft and the relative position and velocity, in the inertial frame.
SetTwoLineElementsSets the Two Line Elements (TLE) data of a particular craft to a specific positionstored in the struct.
SetVectorElementsSets the position and velocity of a body to a series of parameters based onthe Vector Elements. This is just a position and velocity, with an optionalorbiting body.
UndockUndocks the spacecraft from the hub. This will set the hub tothe current spacecraft. All children will be undocked as well.Or, the spacecraft will be undocked from its parent hub. If aspecific other spacecraft is provided, it will undock from thatspacecraft only, instead of all children.
UpdateEquationsOfMotionUpdates all of the State Equations with their correct derivatives
UpdateMassPropertiesUpdates the Mass Properties of the body and all components.This will also attempt to cache the data on the componentsthat exist on the hierarchy tree (in the body [B] frame) ina transform state for multiple use. This is the dirty flag.
WriteOutputMessagesWrites data to output messages that are able to store the state of data. Thiswill write data based on the hub and will correctly determine the right valuesto write.
InheritedDescription
AddObjectReturns a new simulation object with the specified type.
AttachAttempts to attach this object to a new parent. This will only work if the current object is no parented to anyother object.
ContainsModelWithIDReturns true if an attached model satisfies the specified ID.
ContainsModelWithTypeReturns true if an attached model satisfies the specified type.
DestroyRemoves the current object from the simulation.
DetachThis is an action to detach the current object from its parent, if it exists and move it to another object or tojust exist within the simulation.
FindBehavioursWithTypeReturns all attached behaviours that satisfies the specified type.
FindBehaviourWithIDReturns an attached behaviour that satisfies the specified ID.
FindBehaviourWithTypeReturns an attached behaviour that satisfies the specified type.
FindChildrenWithTypeReturns all attached children that satisfies the specified type.
FindChildWithIDReturns an attached child that satisfies the specified ID.
FindChildWithTypeReturns an attached child that satisfies the specified type.
FindModelsWithTypeReturns all attached models that satisfies the specified type.
FindModelWithIDReturns an attached model that satisfies the specified ID.
FindModelWithTypeReturns an attached model that satisfies the specified type.
FindParentWithIDReturns an attached parent that satisfies the specified ID.
FindParentWithTypeReturns an attached parent that satisfies the specified type.
FindRootWithIDReturns a root object that satisfies the specified ID.
FindRootWithTypeReturns a root object that satisfies the specified type.
GetModelReturns a valid assigned model with the specified type.
GetWorldTransformReturns the world transform of the object which is relative to the parent. If no parent exists, this will be thetransform of the object in world space.
ReadBodyTransformThis method will reset the dirty flag on the mass so thatit has been read successfully and is valid.