MVSim
Lightweight simulator for 2.5D vehicles and robots
ImuNoiseModel.h
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2026 Jose Luis Blanco Claraco |
5  | Distributed under 3-clause BSD License |
6  | See COPYING |
7  +-------------------------------------------------------------------------+ */
8 
9 #pragma once
10 
11 #include <mrpt/math/TPoint3D.h>
12 #include <mrpt/random.h>
13 
14 namespace mvsim
15 {
52 {
53  public:
56  {
58  double white_noise_std = 0.0;
59 
62  double random_walk_std = 0.0;
63  };
64 
67 
70 
72  void reset();
73 
81  mrpt::math::TVector3D applyGyroscope(const mrpt::math::TVector3D& trueVal, double dt);
82 
90  mrpt::math::TVector3D applyAccelerometer(const mrpt::math::TVector3D& trueVal, double dt);
91 
93  const mrpt::math::TVector3D& gyroBias() const { return gyroBias_; }
94 
96  const mrpt::math::TVector3D& accelBias() const { return accelBias_; }
97 
98  private:
107  mrpt::math::TVector3D applyChannel(
108  const mrpt::math::TVector3D& trueVal, double dt, const ChannelParams& params,
109  mrpt::math::TVector3D& bias);
110 
111  mrpt::math::TVector3D gyroBias_{0.0, 0.0, 0.0};
112  mrpt::math::TVector3D accelBias_{0.0, 0.0, 0.0};
113 
114  mrpt::random::CRandomGenerator rng_;
115 };
116 
117 } // namespace mvsim
Stochastic IMU error model based on Forster et al. (2016).
Definition: ImuNoiseModel.h:52
void reset()
Reset the internal bias states to zero.
const mrpt::math::TVector3D & accelBias() const
Definition: ImuNoiseModel.h:96
ChannelParams accelerometer
Definition: ImuNoiseModel.h:69
mrpt::math::TVector3D applyAccelerometer(const mrpt::math::TVector3D &trueVal, double dt)
Corrupt a true accelerometer reading with noise.
ChannelParams gyroscope
Definition: ImuNoiseModel.h:66
mrpt::math::TVector3D applyGyroscope(const mrpt::math::TVector3D &trueVal, double dt)
Corrupt a true gyroscope reading with noise.
const mrpt::math::TVector3D & gyroBias() const
Definition: ImuNoiseModel.h:93
Parameters for a single 3-axis IMU channel.
Definition: ImuNoiseModel.h:56
double white_noise_std
Definition: ImuNoiseModel.h:58
double random_walk_std
Definition: ImuNoiseModel.h:62