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¶ - #include <imu_sensor.h>
IMU sensor class.
Public Functions
-
ImuSensor
()¶
-
~ImuSensor
()¶
-
void
CrossInit
()¶ cross initialization
-
void
SelfInit
()¶ self initialization
-
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 spacecraftPlus 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 spacecraftPlus 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 spacecraftPlus 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 spacecraftPlus 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
-
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
¶ 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
-
IMUSensorIntMsg
trueValues
¶ [-] total measurement without perturbations
-
IMUSensorIntMsg
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
-
BSKLogger
bskLogger
¶ BSK Logging
Private Members
-
int64_t
InputStateID
¶ Connect to input time message
-
int64_t
OutputDataID
¶ Connect to output CSS data
-
uint64_t
PreviousTime
¶ Timestamp from previous frame
-
int64_t
numStates
¶ Number of States for Gauss Markov Models
-
SCPlusStatesSimMsg
StatePrevious
¶ Previous state to delta in IMU
-
SCPlusStatesSimMsg
StateCurrent
¶ Current SSBI-relative state
-
GaussMarkov
errorModelAccel
¶ [-] Gauss-markov error states
-
GaussMarkov
errorModelGyro
¶ [-] Gauss-markov error states
-
Eigen::MRPd
previous_sigma_BN
¶ sigma_BN from the previous spacecraft message
-
Eigen::MRPd
current_sigma_BN
¶ sigma_BN from the most recent spacecraft message
-
Eigen::Vector3d
previous_omega_BN_B
¶ omega_BN_B from the previous spacecraft message
-
Eigen::Vector3d
current_omega_BN_B
¶ omega_BN_B from the current spacecraft message
-
Eigen::Vector3d
current_nonConservativeAccelpntB_B
¶ nonConservativeAccelpntB_B from the current message
-
Eigen::Vector3d
current_omegaDot_BN_B
¶ omegaDot_BN_B from the curret spacecraft message
-
Eigen::Vector3d
previous_TotalAccumDV_BN_B
¶ TotalAccumDV_BN_B from the previous spacecraft message
-
Eigen::Vector3d
current_TotalAccumDV_BN_B
¶ TotalAccumDV_BN_B from the current spacecraft message
-
Eigen::Vector3d
accel_SN_P_out
¶ rDotDot_SN_P for either next method or output messages
-
Eigen::Vector3d
DV_SN_P_out
¶ time step deltaV for either next method or output messages
-
Eigen::Vector3d
omega_PN_P_out
¶ omega_PN_P for either next method or output messages
-
Eigen::Vector3d
prv_PN_out
¶ time step PRV_PN for either next method or output messages
-