imuSensor#
Executive Summary#
Sensor model to simulate an IMU.
The module
PDF Description
contains further information on this module’s function,
how to run it, as well as testing.
The corruption types are outlined in this
PDF Description
.
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 |
---|---|---|
scStateInMsg |
SCStatesMsgPayload |
input essage name for spacecraft state |
sensorOutMsg |
IMUSensorMsgPayload |
output message name for IMU output data |
Class ImuSensor#
-
class ImuSensor : public SysModel#
IMU sensor class.
Public Functions
-
void reset(uint64_t currentSimNanos)#
Reset the module
- Parameters:
currentSimNanos – current time (ns)
- Returns:
void
-
void updateState(uint64_t currentSimNanos)#
update module states
- Parameters:
currentSimNanos – current time (ns)
-
void readInputMessages()#
read input messages
-
void writeOutputMessages(uint64_t Clock)#
write output messages
-
void setBodyToPlatformDCM(double yaw, double pitch, double roll)#
set body orientation DCM relative to platform
-
void computePlatformDR()#
This function gathers actual spacecraft attitude from the spacecraft output message. It then differences the state attitude between this time and the last time the IMU was called to get a DR (delta radians or delta rotation) The angular rate is retrieved directly from the spacecraft output message and passed through to theother IMU functions which add noise, etc.
-
void computePlatformDV(uint64_t CurrentTime)#
This functions gathers actual spacecraft velocity from the spacecraft output message. It then differences the velocity between this time and the last time the IMU was called to get a DV (delta velocity). The acceleration of the spacecraft in the body frame is gathered directly from the spacecraft output message. Then, it is converted to the platform frame and rotational terms are added to it to account for CoM offset of the platform frame.
- Parameters:
CurrentTime –
-
void applySensorErrors(uint64_t CurrentTime)#
apply sensor errors
-
void applySensorDiscretization(uint64_t CurrentTime)#
apply sensor direction
- Parameters:
CurrentTime –
-
void applySensorSaturation(uint64_t CurrentTime)#
apply sensor saturation
-
void computeSensorErrors()#
compute sensor errors
-
void scaleTruth()#
scale truth method
-
void setLSBs(double LSBa, double LSBo)#
set LSB values
-
void setCarryError(bool aCarry, bool oCarry)#
set Carry error value
-
void setRoundDirection(roundDirection_t aRound, roundDirection_t oRound)#
set round direction value
-
void set_oSatBounds(Eigen::MatrixXd oSatBounds)#
set o saturation bounds
- Parameters:
oSatBounds –
-
void set_aSatBounds(Eigen::MatrixXd aSatBounds)#
set a saturation bounds
- Parameters:
aSatBounds –
Public Members
-
ReadFunctor<SCStatesMsgPayload> scStateInMsg#
input essage name for spacecraft state
-
Message<IMUSensorMsgPayload> sensorOutMsg#
output message name for IMU output data
-
Eigen::Vector3d sensorPos_B#
[m] IMU sensor location in body
-
Eigen::Matrix3d dcm_PB#
— Transform from body to platform
-
Eigen::Vector3d senRotBias#
[r/s] Rotational Sensor bias value
-
Eigen::Vector3d senTransBias#
[m/s2] Translational acceleration sen bias
-
double senRotMax#
[r/s] Gyro saturation value
-
double senTransMax#
[m/s2] Accelerometer saturation value
-
uint64_t OutputBufferCount#
— number of output msgs stored
-
bool NominalReady#
— Flag indicating that system is in run
-
Eigen::Matrix3d PMatrixAccel#
[-] Cholesky-decomposition or matrix square root of the covariance matrix to apply errors with
-
Eigen::Matrix3d AMatrixAccel#
[-] AMatrix that we use for error propagation
-
Eigen::Vector3d walkBoundsAccel#
[-] “3-sigma” errors to permit for states
[-] Current navigation errors applied to truth
-
Eigen::Matrix3d PMatrixGyro#
[-] Cholesky-decomposition or matrix square root of the covariance matrix to apply errors with
-
Eigen::Matrix3d AMatrixGyro#
[-] AMatrix that we use for error propagation
-
Eigen::Vector3d walkBoundsGyro#
[-] “3-sigma” errors to permit for states
[-] Current navigation errors applied to truth
-
IMUSensorMsgPayload trueValues#
[-] total measurement without perturbations
-
IMUSensorMsgPayload sensedValues#
[-] total measurement including perturbations
-
Eigen::Vector3d accelScale#
(-) scale factor for acceleration axes
-
Eigen::Vector3d gyroScale#
(-) scale factors for acceleration axes
-
Discretize aDisc#
(-) instance of discretization utility for linear acceleration
-
Discretize oDisc#
(-) instance of idscretization utility for angular rate
-
Saturate aSat#
(-) instance of saturate utility for linear acceleration
-
Saturate oSat#
(-) instance of saturate utility for angular rate
-
BSKLogger bskLogger#
— BSK Logging
-
void reset(uint64_t currentSimNanos)#