Class Imu

Inheritance Relationships

Base Type

Class Documentation

class Imu : public lupnt::Device

Onboard inertial measurement unit (IMU) device: simulates gyro (angular rate) and accelerometer measurements with bias and noise driven by ImuDynamics.

Attached to a satellite/rover Agent (e.g. as the "imu" device) to generate ImuMeasurements that feed ImuDynamics-based attitude/state propagation and navigation filters (EKF/UKF) for inertial state estimation.

Public Functions

Imu()
Imu(Config &config)
virtual void Step(Real t) override

Propagate the IMU’s bias/state from the last step to time t and generate a new ImuMeasurement (gyro + accelerometer reading).

Called periodically by the Simulation event scheduler (per Device::Setup) at the IMU’s configured frequency_. Propagates state_ via dynamics_->Propagate, looks up noise parameters for model_ via GetParameters, samples gyro angular-rate w [rad/s] and accelerometer specific-force a [m/s^2] about the current bias with white-noise scaled by 1/sqrt(t - time_), updates time_, and logs the result. Overrides Device::Step.

Parameters:

tSimulation time of this step [s]; must be >= the time of the previous Step

virtual void Setup() override

IMU device setup; currently a no-op.

ImuMeasurement GetMeasurement(Real t)

Get the IMU measurement (gyro angular rate [rad/s] and accelerometer specific force [m/s^2]) at time t.

inline std::vector<ImuMeasurement> GetData() const

Get all ImuMeasurements accumulated since the last EmptyData call.

inline void EmptyData()

Clear the buffered IMU measurement history.

virtual void Log(Real time) override

Log the IMU’s current state/measurement to the simulation’s DataLogger output. Overrides Device::Log; currently a no-op.

Public Static Functions

static ImuParameters GetParameters(ImuModel imu_model)

Look up the noise/bias-stability parameters (accelerometer and gyroscope white-noise and bias-random-walk standard deviations) for a given ImuModel (e.g. LN200S), used by Step to sample measurement noise.

Parameters:

imu_model – IMU hardware model to look up

Returns:

Noise parameters: sigma_a [m/s^2 /sqrt(Hz)], sigma_a_bias [m/s^2 sqrt(Hz)], sigma_w [rad/s /sqrt(Hz)], sigma_w_bias [rad/s sqrt(Hz)]

Protected Attributes

ImuModel model_
Real time_ = 0.0
ImuState state_
std::vector<ImuMeasurement> data_
Ptr<ImuDynamics> dynamics_
Vec3 position_ = Vec3::Zero()
Mat3 orientation_ = Mat3::Identity()