Class ImuDynamics

Inheritance Relationships

Base Type

Class Documentation

class ImuDynamics : public lupnt::Dynamics

IMU bias random-walk propagation model.

Propagates an ImuState (gyro bias b_w and accelerometer bias b_a, each 3-element) as a random walk driven by the bias-instability noise parameters of the configured ImuModel (see devices/imu.hImu::GetParameters). Used by devices/imu.hImu to evolve the “true” IMU bias state that corrupts simulated IMU measurements consumed by attitude/inertial-navigation filters.

Public Functions

ImuDynamics()

Construct with an undefined IMU model.

ImuDynamics(Config &config)

Construct from a YAML configuration node.

Reads the optional model (ImuModel) field.

void SetModel(ImuModel imu_model)

Set the IMU noise/bias model used to generate process noise.

ImuModel GetModel() const

Return the configured IMU noise/bias model.

inline void SetSeed(int seed)

Set the random-number-generator seed used for bias-noise sampling.

Reseeds the internal Mersenne Twister RNG (rng_).

virtual State Propagate(const State &x0, Real t0, Real tf, const State *u = nullptr) override

Propagate the IMU gyro/accelerometer bias state as a random walk over [t0, tf].

For each of the 3 gyro-bias and 3 accelerometer-bias components, draws a new value from a normal distribution centered on the previous bias with standard deviation sigma_*_bias / sqrt(1/(tf-t0)) (i.e. scaled by sqrt(tf-t0)), using imu_model_’s noise parameters (Imu::GetParameters) and the internal RNG (rng_).

Parameters:
  • x0 – Initial IMU bias state (ImuState, 6-element: b_w then b_a) at time t0.

  • t0 – Initial epoch [s].

  • tf – Final epoch [s].

  • u – Unused; must be nullptr (IMU bias dynamics has no control input).

Returns:

Propagated IMU bias state at time tf.

inline virtual StateType GetStateType() const override

Return ImuState::TYPE, the gyro/accelerometer bias state type propagated by this model.

virtual State Propagate(const State &x0, Real t0, Real tf, const State *u, MatXd *stm)

Propagate the state and compute the state transition matrix (STM) d(xf)/d(x0) via automatic differentiation.

Default implementation: if stm == nullptr, forwards to the no-STM Propagate overload; otherwise wraps Propagate(x0, t0, tf, u) in an autodiff Jacobian (jacobian(...)) with respect to x0. Used by filters (filters/) that need the linearized state transition for covariance propagation (e.g. EKF/UKF time updates).

Parameters:
  • x0 – Initial state at time t0.

  • t0 – Initial epoch [s, TDB since J2000].

  • tf – Final epoch [s, TDB since J2000].

  • u – Optional control/forcing input; nullptr if unused.

  • stm – Output: state transition matrix d(xf)/d(x0); left unmodified if nullptr.

Returns:

Propagated state at time tf.

virtual MatX Propagate(const State &x0, const VecX &tfs, const State *u = nullptr)

Propagate the state to a sequence of output epochs.

Repeatedly calls Propagate(x0, t0, tf, u) between consecutive entries of tfs, accumulating each result as a row of the returned matrix. Used by applications/ and analysis scripts to generate a full trajectory time history in one call, with optional progress-bar output (see SetPrintProgress).

Parameters:
  • x0 – Initial state at tfs(0).

  • tfs – Vector of output epochs [s, TDB since J2000], including the initial epoch as tfs(0).

  • u – Optional control/forcing input applied at every step; nullptr if unused.

Returns:

Matrix whose i-th row is the propagated state at tfs(i).

Protected Attributes

ImuModel imu_model_
int seed_ = 0
Ptr<std::mt19937> rng_ = nullptr