Module: imu_sensor

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.


class ImuSensor : public SysModel

Public Functions

ImuSensor()
~ImuSensor()
void CrossInit()
void SelfInit()
void UpdateState(uint64_t CurrentSimNanos)
void readInputMessages()
void writeOutputMessages(uint64_t Clock)
void setBodyToPlatformDCM(double yaw, double pitch, double roll)
void computePlatformDR()
void computePlatformDV(uint64_t CurrentTime)
void applySensorErrors(uint64_t CurrentTime)
void applySensorDiscretization(uint64_t CurrentTime)
void applySensorSaturation(uint64_t CurrentTime)
void computeSensorErrors()
void scaleTruth()
void setLSBs(double LSBa, double LSBo)
void setCarryError(bool aCarry, bool oCarry)
void setRoundDirection(roundDirection_t aRound, roundDirection_t oRound)
void set_oSatBounds(Eigen::MatrixXd oSatBounds)
void set_aSatBounds(Eigen::MatrixXd aSatBounds)

Public Members

std::string InputStateMsg

Message name for spacecraft state

std::string OutputDataMsg

Message name for CSS output data

Eigen::Vector3d sensorPos_B

[m] IMU sensor location in body

Eigen::Matrix3d dcm_PB
Eigen::Vector3d senRotBias

Transform from body to platform

Eigen::Vector3d senTransBias

[r/s] Rotational Sensor bias value

double senRotMax

[m/s2] Translational acceleration sen bias

double senTransMax

[r/s] Gyro saturation value

uint64_t OutputBufferCount

[m/s2] Accelerometer saturation value

bool NominalReady

number of output msgs stored

Eigen::Matrix3d PMatrixAccel

Flag indicating that system is in run

[-] Covariance matrix used to perturb state

Eigen::Matrix3d AMatrixAccel

[-] AMatrix that we use for error propagation

Eigen::Vector3d walkBoundsAccel

[-] “3-sigma” errors to permit for states

Eigen::Vector3d navErrorsAccel

[-] Current navigation errors applied to truth

Eigen::Matrix3d PMatrixGyro

[-] Covariance matrix used to perturb state

Eigen::Matrix3d AMatrixGyro

[-] AMatrix that we use for error propagation

Eigen::Vector3d walkBoundsGyro

[-] “3-sigma” errors to permit for states

Eigen::Vector3d navErrorsGyro

[-] Current navigation errors applied to truth

IMUSensorIntMsg trueValues

[-] total measurement without perturbations

IMUSensorIntMsg sensedValues

[-] total measurement including perturbations

Eigen::Vector3d accelScale
Eigen::Vector3d gyroScale

(-) scale factor for acceleration axes

Discretize aDisc

(-) scale factors for acceleration axes

Discretize oDisc

(-) instance of discretization utility for linear acceleration

Saturate aSat

(-) instance of idscretization utility for angular rate

Saturate oSat

(-) instance of saturate utility for linear acceleration

BSKLogger bskLogger

(-) instance of saturate utility for angular rate

BSK Logging

Private Members

int64_t InputStateID
int64_t OutputDataID

Connect to input time message

uint64_t PreviousTime

Connect to output CSS data

int64_t numStates

Timestamp from previous frame

SCPlusStatesSimMsg StatePrevious

Number of States for Gauss Markov Models

SCPlusStatesSimMsg StateCurrent

Previous state to delta in IMU

GaussMarkov errorModelAccel

Current SSBI-relative state

GaussMarkov errorModelGyro

!< [-] Gauss-markov error states

Eigen::MRPd previous_sigma_BN

!< [-] Gauss-markov error states

Eigen::MRPd current_sigma_BN

sigma_BN from the previous spacecraft message

Eigen::Vector3d previous_omega_BN_B

sigma_BN from the most recent spacecraft message

Eigen::Vector3d current_omega_BN_B

omega_BN_B from the previous spacecraft message

Eigen::Vector3d current_nonConservativeAccelpntB_B

omega_BN_B from the current spacecraft message

Eigen::Vector3d current_omegaDot_BN_B

nonConservativeAccelpntB_B from the current message

Eigen::Vector3d previous_TotalAccumDV_BN_B

omegaDot_BN_B from the curret spacecraft message

Eigen::Vector3d current_TotalAccumDV_BN_B

TotalAccumDV_BN_B from the previous spacecraft message

Eigen::Vector3d accel_SN_P_out

TotalAccumDV_BN_B from the current spacecraft message

Eigen::Vector3d DV_SN_P_out

rDotDot_SN_P for either next method or output messages

Eigen::Vector3d omega_PN_P_out

time step deltaV for either next method or output messages

Eigen::Vector3d prv_PN_out

omega_PN_P for either next method or output messages