Class GuidanceComputer
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
The guidance computer is a specific computer class that is able to contain a series of attitude guidance chains, each which can provide different pointing modes. Depending on the required mode, the guidance computer will set up the software and connect the messages automatically. This only works for the spacecraft.
public class GuidanceComputer : Computer, IGroundStationAttachment
- Inheritance
-
GuidanceComputer
- Implements
- Derived
- Inherited Members
Constructors
GuidanceComputer()
Default constructor for the guidance computer.
public GuidanceComputer()
Fields
In_SoftwareChainMsg
Computer command input message
public SoftwareChainMessage? In_SoftwareChainMsg
Field Value
Properties
Out_AttGuidMsg
Gets the current guidance error message from the pointing chain, if it exists.
public AttGuidMessage? Out_AttGuidMsg { get; }
Property Value
Out_AttRefMsg
Gets the current guidance reference message from the pointing chain, if it exists.
public AttRefMessage? Out_AttRefMsg { get; }
Property Value
Out_CmdTorqueBodyMsg
Gets the current torque message from the controller chain, if it exists.
public CmdTorqueBodyMessage? Out_CmdTorqueBodyMsg { get; }
Property Value
Out_NavAttMsg
Gets the current navigation attitude message from the navigation chain, if it exists.
public NavAttMessage? Out_NavAttMsg { get; }
Property Value
Out_NavTransMsg
Gets the current navigation translation message from the navigation chain, if it exists.
public NavTransMessage? Out_NavTransMsg { get; }
Property Value
Methods
ClearErrorCache()
Clears the error message cache which can be done from an external source, such as Unreal.
protected void ClearErrorCache()
ConfigureExternalTorqueMapping()
Configures the external force torque mapping chain and initialises the properties.
public void ConfigureExternalTorqueMapping()
ConfigureGroundPointing(Vector3, GroundStatesMessage, string)
Configures the ground pointing software chain with some parameters about the ground pointing software.
public void ConfigureGroundPointing(Vector3 alignment, GroundStatesMessage msg, string body)
Parameters
alignment
Vector3The alignment vector to point the relative frame towards
msg
GroundStatesMessageThe ground station message coming from the ground station
body
stringThe celestial body that the ground station is on
ConfigureIdleController(Vector3)
Configures the idle controller chain by giving the option to set the torque applied to the actuator.
public void ConfigureIdleController(Vector3 torque)
Parameters
torque
Vector3The torque represented in the body frame
ConfigureInertialPointing(Matrix3, Matrix3)
Configures the inertial hold software to point a particular matrix in the direction of some other matrix.
public void ConfigureInertialPointing(Matrix3 alignment, Matrix3 target)
Parameters
alignment
Matrix3The alignment matrix to point towards the target frame
target
Matrix3The target frame in inertial coordinates to align with
ConfigureLocationPointing(Vector3, double, double, double, string)
Configures the location pointing software chain with some parameters about the location pointing software.
public void ConfigureLocationPointing(Vector3 alignment, double latitude, double longitude, double altitude, string body)
Parameters
alignment
Vector3The alignment vector to point the relative frame towards
latitude
double[deg] The latitude of the location to point in
longitude
double[deg] The longitude of the location to point in
altitude
double[m] The altitude of the location to point in
body
stringThe celestial body that the ground station is on
ConfigureMRPController(double, double, double, double, Vector3)
Configures the MRP controller to have a specific set of PID feedback constants for the system.
public void ConfigureMRPController(double k, double p, double ki, double limit, Vector3 torque)
Parameters
k
double[rad/sec] Proportional gain applied to MRP errors
p
double[Nms] Rate error feedback gain applied
ki
double[Nm] Integration feedback error on rate error
limit
double[Nm] Integration limit to avoid wind-up issue
torque
Vector3[Nm] Known external torque in body frame vector components
ConfigureNadirPointing(Matrix3, string)
Configures the nadir pointing software chain with some parameters about the nadir pointing software.
public void ConfigureNadirPointing(Matrix3 alignment, string body)
Parameters
alignment
Matrix3The alignment matrix as an orientation to align to
body
stringThe celestial body to target
ConfigureReactionWheelPowerMapping(Matrix3, double, double, double)
Configures the reaction wheel power mapping chain to orient the control axis of the reaction wheel spins and the power system.
public void ConfigureReactionWheelPowerMapping(Matrix3 control, double minVoltage, double maxVoltage, double k)
Parameters
control
Matrix3The control axis the reaction wheels are configured in
minVoltage
double[V] The minimum voltage associated with the reaction wheel speed
maxVoltage
double[V] The maximum voltage associated with the reaction wheel speed
k
double[Nm/V] Gain to convert voltage to motor torque errors
ConfigureReactionWheelsMapping(Matrix3)
Configures the reaction wheel mapping chain to orient the control axis of the reaction wheel spins.
public void ConfigureReactionWheelsMapping(Matrix3 control)
Parameters
control
Matrix3The control axis the reaction wheels are configured in
ConfigureRelativePointing(Vector3, BodyStatesMessage)
Configures the relative pointing software chain with some parameters about the relative pointing software.
public void ConfigureRelativePointing(Vector3 alignment, BodyStatesMessage msg)
Parameters
alignment
Vector3The alignment vector to point the relative frame towards
msg
BodyStatesMessageThe body states message coming from the other spacecraft
ConfigureSimpleNavigation(bool, bool, bool)
Configures the navigation chain to use some additional parameters for the configuration, in terms of what errors are produced.
public void ConfigureSimpleNavigation(bool crossTrans, bool crossAtt, bool useEclipse)
Parameters
crossTrans
boolHave position error depend on velocity
crossAtt
boolHave attitude depend on attitude rate
useEclipse
boolHave the sun pointing vector take eclipses into account
ConfigureSunEstimationNavigation(bool, bool, bool)
Configures the sun estimation navigation chain to use some additional parameters for the configuration, in terms of what errors are produced.
public void ConfigureSunEstimationNavigation(bool crossTrans, bool crossAtt, bool useEclipse)
Parameters
crossTrans
boolHave position error depend on velocity
crossAtt
boolHave attitude depend on attitude rate
useEclipse
boolHave the sun pointing vector take eclipses into account
ConfigureSunPointing(Vector3, Vector3)
Configures the sun pointing software to point a vector in the direction of the sun.
public void ConfigureSunPointing(Vector3 alignment, Vector3 omega)
Parameters
alignment
Vector3The alignment vector to point towards the target frame
omega
Vector3The attitude rate in the body frame when the spacecraft is in eclipse
ConfigureVelocityPointing(Matrix3, string)
Configures the velocity pointing software chain with some parameters about the velocity pointing software.
public void ConfigureVelocityPointing(Matrix3 alignment, string body)
Parameters
alignment
Matrix3The alignment matrix as an orientation to align to
body
stringThe celestial body to orbit around
Load()
Loads the chains for the flight computer before the begin is called. This is useful for Unreal to load messages and chains before the simulation begins to tick.
public void Load()
OnBegin(double)
Called when the 'Component' is beginning
protected override void OnBegin(double time)
Parameters
time
doublecurrent time (seconds)
OnDecodeMetadata(JObject)
Called after the "Component" was loaded to handle additional metadata.
protected override void OnDecodeMetadata(JObject metadata)
Parameters
metadata
JObject
OnEncodeMetadata(JObject)
Called while the "Component" is being saved to save additional metadata.
protected override JObject OnEncodeMetadata(JObject metadata)
Parameters
metadata
JObject
Returns
- JObject
OnUpdate(double, double)
Called when the 'Component' should update
protected override void OnUpdate(double time, double step)
Parameters
SafeMode()
Set the computer into a safe mode - ensuring that only the most important systems are running and the rest are in safety.
public override void SafeMode()
Shutdown()
Shut the computer down safely. Disable all software and set the status to SHUTDOWN.
public override void Shutdown()
Startup()
Start the computer safely. Enable all software and set the status to RUNNING.
public override void Startup()