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
| Declared | Description |
|---|---|
| Acceleration | The acceleration of the body in the inertial frame. |
| Attitude | The attitude of the dynamic body in the form of a Modified Rodriguez Parameter (MRP). This is converted from thetransformation of the local frame. This is equivalent to Transform_BN_N. |
| AttitudeRate | Stores the current body attitude rate in the body frame. |
| DynamicType | The type of orbit propagation that is used for this object. |
| GeodeticCoordinates | A geodetic coordinates for the spacecraft relative to the orbiting planet. This will be in the form of latitude,longitude and altitude, where the units are in degrees and meters. |
| Hub | A reference to the hub spacecraft. If there is no hub spacecraft, it is assumed to be itself. Otherwise, the massproperties and physics will be applied to the hub spacecraft instead. |
| HubTransform | The relative transform between the hub and the spacecraft. This is used for calculations of position and rotationbased on the hub spacecraft. |
| In_PlanetStateMsg | A reference to the planet state message of the nearest body that the spacecraft is orbiting. |
| InitialOrbit | The initial classical elements of the body if the orbit is set. |
| InitialOrbitTime | The simulation time in which the initial orbit was calculated. |
| InitialPeriod | The orbital period of the body if the initial orbit is set. |
| IntegratePostLookup | A flag for if the body should integrate its state after the lookup is completed. |
| LookupFilePath | The full file path for the CSV file, if it exists. This will ensure that a lookup table can be loaded correctlyif the file path is valid and not empty. |
| LookupRepeat | A flag for if the body should repeat the lookup data at the end of the data set, making a loop of the data. |
| LookupRotationType | The type of the rotation used for the orbital trajectories. |
| LookupTime | The current time on the lookup trajectory. |
| LookupTrajectoryType | The type of trajectory used for the orbital trajectories. |
| OrbitedBody | The name of the body that this object is currently orbiting, if it exists. This will be used to calculate thegravitational forces acting around that body. |
| Out_BodyMassMsg | The body mass properties message that stores the mass properties from all of the components that are added tothis body. This will be the sum of all components and is used by the integrator. |
| Out_GravityMsg | The gravitational message that describes the gravitational energy of the object at a particular location. |
| Out_SpacecraftStateMsg | The body states message of the spacecraft contains all the information about the spacecraft’s properties,including the position, energy and acceleration. |
| OverrideMass | A flag whether to override the mass properties with some new 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 masscalculation. |
| Position | The position of the body in the inertial world state. |
| Position_CN_N | The center of mass inertial position. |
| TotalCenterOfMassB_B | The total center of mass in the body frame including all components attached. |
| TotalMass | The total mass of the body including all components. |
| TotalMomentOfInertiaB_B | The total moment of inertia in the body frame including all components attached. |
| Velocity | The velocity of the body in the inertial frame. |
| WGSCoordinates | A WGS Accurate Earth model coordinate system with the Earth as the center being used for the position. |
| Inherited | Description |
|---|---|
| Behaviours | A collection of behaviours attached to this object. |
| CenterOfMassB_B | The center of mass of the component in respect to the body frame (B) of the component. This is isolated from anychildren and exists in isolation. |
| CenterOfMassDot_LB_B | The center of mass time-derivative of the component within its own local coordinates. This does not include anyof the sub-components and exists in isolation. |
| CenterOfMassDotB_B | The center of mass time-derivative of the component relative to the body frame (B). This does not include any ofthe sub-components and exists in isolation. |
| CenterOfMassL_L | The center of mass of the component within its own local coordinates. This does not include any of thesub-components and exists in isolation. |
| CenterOfMassPrime_LB_B | The center of mass general-derivative of the component within its own local coordinates. This does not includeany of the sub-components and exists in isolation. |
| CenterOfMassPrimeB_B | [m/s] The center of mass general-derivative of the component relative to the body frame (B). This does notinclude any of the sub-components and exists in isolation. |
| Children | A collection of children attached to this object. |
| DCM_BN | The rotational DCM matrix between the body frame (B) at the top of this component chain and the inertial frame (N). |
| DCM_LB | The rotational DCM matrix between the component frame of this object (L) relative to the body frame (B). |
| DCM_LN | The DCM rotational matrix of the component relative to the inertial origin (N) of the world. |
| IsEnabled | Is true if the object is currently enabled. |
| LocalForward | The direction of the transform frame’s forward vector, which is along the Y axis. |
| LocalRight | The direction of the transform frame’s right vector, which is along the X axis. |
| LocalUp | The direction of the transform frame’s up vector, which is along the Z axis. |
| Mass | The component mass defined in the object. This is independent of any parent or children objects and exists inisolation. |
| MassDot | The component mass time-derivative defined in the object. This is independent of any parent or children objectsand exists in isolation. |
| Models | A collection of models attached to this object. |
| MomentOfInertia_LB | 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 and exists in isolation. |
| MomentOfInertiaB_B | The moment of inertia of this component, measured in the body frame relative to the parented body. This isindependent of any children and exists in isolation. |
| MomentOfInertiaPrime_LB | The derivative of the moment of inertia of the component, measured at the local center of mass, represented withits own local coordinates. This does not include any of the sub-components and exists in isolation. |
| MomentOfInertiaPrimeB_B | The derivative of the moment of inertia of the component, represented in the body frame (B). This is independentand exists in isolation. |
| Name | The display name or tag of this object. |
| Out_ComponentMassMsg | The component mass message defines the set of mass properties and states of the system within this componentlocally. This is independent of any parent or children properties or objects. |
| Out_TransformMsg | This defines the base transform message that stores the state of the transform of this object. |
| Parent | The currently attached parent object (if any). |
| Position_BN_N | The position of the body (the root parent B) in the inertial frame relative to the inertial point (N). |
| Position_LB_B | The position of the component relative to the root object of this hierarchy. This is in the inertial frame and ifthe component is the root object, then there will be no position. |
| Position_LN_N | The position of the inertial world space. This position is derived from the world’s transform (N). |
| Root | The 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. |
| Thermal | [TEMPORARY] A reference to the thermal model that is attached to this object. This will allow the object to havethermal properties and be able to be used in thermal simulations. |
Methods
| Declared | Description |
|---|---|
| Dock | Docks the spacecraft to another spacecraft. This will determine which spacecraft is the hub and which is thechild. The hub will be the one with the largest mass. The child will be the other one. |
| GetLookupTrajectoryCoordinates | Returns a list of all the lookup data positions from the lookup table, if they exist. These will be in the formof a Geodetic or PCI frame, depending on the input type. |
| GetOrbitalPosition | Returns the position between the spacecraft and the orbited body. If there is no orbiting body, this will be thespacecraft’s inertial position. |
| GetOrbitalVelocity | Returns the velocity between the spacecraft and the orbited body. If there is no orbiting body, this will be thespacecraft’s inertial velocity. |
| GetRelativePosition | Returns the relative position between the body and another planet. |
| GetRelativeVelocity | Returns the relative velocity between the body and another planet. |
| InitialiseBody | Initialises the object with a series of elements from the Vector elements library. |
| IsConnected | Returns whether this spacecraft is connected to another spacecraft. |
| IsDocked | Returns true if the spacecraft is docked to another hub. This will return true if the spacecraft is not the hubitself. |
| SetClassicElements | Sets the classic elements of a body to a series of parameters based on all of the required parameters. |
| SetCustomTrajectory | Sets the path to the lookup data to read from. This should be an absolute path to the CSV file with the data fromthe file. This assumes the file is of the correct format, but will not throw an error if not. |
| SetGeodeticElements | Sets the Geodetic Elements of Latitude, Longitude and Altitude to some properties passed in by this function. |
| SetHillFrameElements | Configures the spacecraft to be in a Hill frame with another (chief) spacecraft. This frame is a relativeposition and velocity in the Hill frame, where X is the radial direction away from the chief, Y is thealong-track direction and Z is the orbit normal direction. |
| SetRelativeBodyVectorElements | Sets the position and velocity of a body to a series of parameters based on the relative position and velocityfrom another spacecraft, in the body frame. |
| SetRelativeVectorElements | Sets the position and velocity of a body to a series of parameters based on the relative position and velocityfrom another spacecraft, in the inertial frame. |
| SetTwoLineElements | Sets the Two Line Elements (TLE) data of a particular craft with some individual lines of the TLE. |
| SetVectorElements | Sets the position and velocity of a body to a series of parameters. |
| Undock | Undocks the spacecraft from the hub. This will set the hub to the current spacecraft. All children will beundocked as well. Or, the spacecraft will be undocked from its parent hub. If a specific other spacecraft isprovided, it will undock from that spacecraft only, instead of all children. |
| UpdateMassProperties | [DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED. |
| Inherited | Description |
|---|---|
| AddObject | Returns a new simulation object with the specified type. |
| Attach | Attempts to attach this object to a new parent. This will only work if the current object is no parented to anyother object. |
| ContainsModelWithID | Returns true if an attached model satisfies the specified ID. |
| ContainsModelWithType | Returns true if an attached model satisfies the specified type. |
| Detach | This 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. |
| FindBehavioursWithType | Returns all attached behaviours that satisfies the specified type. |
| FindBehaviourWithID | Returns an attached behaviour that satisfies the specified ID. |
| FindBehaviourWithType | Returns an attached behaviour that satisfies the specified type. |
| FindChildrenWithType | Returns all attached children that satisfies the specified type. |
| FindChildWithID | Returns an attached child that satisfies the specified ID. |
| FindChildWithType | Returns an attached child that satisfies the specified type. |
| FindModelsWithType | Returns all attached models that satisfies the specified type. |
| FindModelWithID | Returns an attached model that satisfies the specified ID. |
| FindModelWithType | Returns an attached model that satisfies the specified type. |
| FindParentWithID | Returns an attached parent that satisfies the specified ID. |
| FindParentWithType | Returns an attached parent that satisfies the specified type. |
| FindRootWithID | Returns a root object that satisfies the specified ID. |
| FindRootWithType | Returns a root object that satisfies the specified type. |
| GetModel | Returns a valid assigned model with the specified type. |
| GetWorldForward | [DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED. |
| GetWorldRight | [DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED. |
| GetWorldTransform | Returns 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. |
| GetWorldUp | [DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED. |
| ReadBodyTransform | This method will reset the dirty flag on the mass so that it has been read successfully and is valid. |
| SetWorldTransform | [DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED. |