scanningInstrumentController#
Executive Summary#
Module to perform continuous instrument control if attitude error and attitude rate are within specified tolerances. If within the specified tolerances, the module will send an imaging command to the instrument. Applicable use case could be a continuous nadir imaging (scanning), where it must constantly check for attitude requirements.
Message Connection Descriptions#
The following table lists all the module input and output messages. The module msg connection is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.
Msg Variable Name |
Msg Type |
Description |
---|---|---|
accessInMsg |
AccessMsgPayload |
Ground location access input message |
attGuidInMsg |
AttGuidMsgPayload |
Attitude guidance input message |
deviceStatusInMsg |
DeviceStatusMsgPayload |
(optional) Device status input message |
deviceCmdOutMsg |
DeviceCmdMsgPayload |
Device status command output message |
Detailed Module Description#
This module writes out a DeviceCmdMsgPayload to turn on an instrument, i.e. simpleInstrument, continuously while the requirement conditions are met.
The module first checks if the instrument controller is active using the controllerStatus
variable. This variable
defaults to 0 (inactive) due to swig initialization of the module, but the user may set the variable to 1 (active)
with the deviceStatusInMsg
or controllerStatus
variable. If the instrument controller is active, the module
then checks if the norm of the attitude error is less than the user specified tolerance and if the groundLocation
is accessible. If both are true, the module sets the deviceCmd
to 1. Otherwise, the deviceCmd
is set to 0.
User Guide#
Two variables must be set, attErrTolerance
and useRateTolerance
. The variable attErrTolerance
is the norm
of the acceptable attitude error in MRPs; It must be set at the beginning of the sim. Also, useRateTolerance
must
be set to specify if the module should check for attitude rate requirements (set useRateTolerance
to 1 to check,
otherwise set to 0).
If useRateTolerance
is set to 1, rateErrTolerance
must be set to the norm of the acceptable attitude rate
in rad/s. Otherwise, if useRateTolerance
is set to 0, rateErrTolerance
is not used.
If the user desires to make the instrument controller inactive, the controllerStatus
variable should be set to 0.
This may be done if the controller is to match the status of corresponding instrument data and power modules. This
may also be accomplished by writing out a DeviceStatusMsgPayload to the deviceStatusInMsg
.
Class ScanningInstrumentController#
-
class ScanningInstrumentController : public SysModel#
Module to perform continuous instrument control.
Public Functions
-
void updateState(uint64_t callTime) override#
This method checks the status of the device and if there is access to target, as well if the magnitude of the attitude error and attitude rate are within the tolerance. If so, the instrument is turned on, otherwise it is turned off.
- Parameters:
callTime – The clock time at which the function was called (nanoseconds)
- Returns:
void
-
void reset(uint64_t callTime) override#
This method checks if required input messages (accessInMsg and attGuidInMsg) are connected.
- Parameters:
this – The configuration data associated with the module
callTime – [ns] time the method is called
moduleID – The module identifier
- Returns:
void
Public Members
-
double attErrTolerance#
Normalized MRP attitude error tolerance.
-
unsigned int useRateTolerance#
Flag to enable rate error tolerance.
-
double rateErrTolerance#
Rate error tolerance in rad/s.
-
unsigned int controllerStatus#
dictates whether or not the controller should be running
-
ReadFunctor<AccessMsgPayload> accessInMsg#
Ground location access.
-
ReadFunctor<AttGuidMsgPayload> attGuidInMsg#
Attitude guidance input message.
-
ReadFunctor<DeviceStatusMsgPayload> deviceStatusInMsg#
Device status input message.
-
Message<DeviceCmdMsgPayload> deviceCmdOutMsg#
Device status output message.
-
BSKLogger bskLogger = {}#
BSK Logging.
-
void updateState(uint64_t callTime) override#