Class inertialsim::sensors::IMU¶
ClassList > inertialsim > sensors > IMU
Simulate an Inertial Measurement Unit (IMU ).More...
#include <imu.h>
Public Functions¶
| Type | Name |
|---|---|
| IMU (const IMUModel & model, const IMUSpecification & specification, std::optional< uint64_t > gyro_seed=std::nullopt, std::optional< uint64_t > accelerometer_seed=std::nullopt, SimulationMode mode=SimulationMode::BATCH, std::optional< double > max_duration=std::nullopt) Construct an IMU from a model and specification. |
|
| IMUData | Simulate (const geometry::Vector & angular_rate, const geometry::Vector & specific_force, const std::optional< Scalar1D > & temperature=std::nullopt) Simulate IMU measurements from angular rate and specific force. |
| IMUData | Simulate (const geometry::Vector & angular_rate, const geometry::Vector & acceleration, const geodesy::GlobalPose & global_pose, const std::optional< Scalar1D > & temperature=std::nullopt) Simulate IMU measurements from angular rate, acceleration, and global pose. |
| IMUData | Simulate (const geodesy::GlobalPose & global_pose, const std::optional< Scalar1D > & temperature=std::nullopt) Simulate IMU measurements from global pose. |
| const Accelerometer & | accelerometer () const Get the accelerometer. |
| const Gyro & | gyro () const Get the gyro. |
| SimulationMode | mode () const Get the simulation mode. |
| const IMUModel & | model () const Get the IMU model. |
| const IMUSpecification & | specification () const Get the IMU specification. |
| ~IMU () = default |
Protected Static Functions¶
| Type | Name |
|---|---|
| std::pair< std::optional< Measurement >, std::optional< Measurement > > | Preintegrate (const Measurement & angular_rate, const Measurement & specific_force, int stride) Pre-integrate measurements to delta angle and velocity. |
Detailed Description¶
An IMU combines a gyro and an accelerometer to measure angular rate and specific force. This class provides a unified interface for simulating both sensors with a common data interface.
Public Functions Documentation¶
function IMU¶
Construct an IMU from a model and specification.
inertialsim::sensors::IMU::IMU (
const IMUModel & model,
const IMUSpecification & specification,
std::optional< uint64_t > gyro_seed=std::nullopt,
std::optional< uint64_t > accelerometer_seed=std::nullopt,
SimulationMode mode=SimulationMode::BATCH,
std::optional< double > max_duration=std::nullopt
)
Parameters:
modelIMU model options.specificationIMU specification.gyro_seedRandom number generator seed for gyro (0 for random).accelerometer_seedRandom number generator seed for accelerometer. If gyro_seed is non-zero and accelerometer_seed is 0, accelerometer_seed defaults to gyro_seed + 1.modeSimulation mode (batch or real-time).max_durationMaximum simulation duration in seconds (required for real-time mode).
function Simulate [⅓]¶
Simulate IMU measurements from angular rate and specific force.
IMUData inertialsim::sensors::IMU::Simulate (
const geometry::Vector & angular_rate,
const geometry::Vector & specific_force,
const std::optional< Scalar1D > & temperature=std::nullopt
)
Parameters:
angular_rateAngular rate relative to inertial space.specific_forceSpecific force Vector in sensor frame.temperatureOptional temperature array.
Returns:
IMUData with gyro and accelerometer measurements.
function Simulate [⅔]¶
Simulate IMU measurements from angular rate, acceleration, and global pose.
IMUData inertialsim::sensors::IMU::Simulate (
const geometry::Vector & angular_rate,
const geometry::Vector & acceleration,
const geodesy::GlobalPose & global_pose,
const std::optional< Scalar1D > & temperature=std::nullopt
)
The global pose is used to add Earth rate to the angular rate and correct for gravity in the acceleration.
Parameters:
angular_rateAngular rate Vector relative to navigation frame.accelerationAcceleration Vector in sensor frame.global_poseGlobalPose for Earth effects compensation.temperatureOptional temperature array.
Returns:
IMUData with gyro and accelerometer measurements.
function Simulate [3/3]¶
Simulate IMU measurements from global pose.
IMUData inertialsim::sensors::IMU::Simulate (
const geodesy::GlobalPose & global_pose,
const std::optional< Scalar1D > & temperature=std::nullopt
)
Angular rate and specific force are computed from the pose.
Parameters:
global_poseGlobalPose with attitude, position, velocity, and time.temperatureOptional temperature array.
Returns:
IMUData with gyro and accelerometer measurements.
function accelerometer¶
Get the accelerometer.
Returns:
Reference to internal accelerometer.
function gyro¶
Get the gyro.
Returns:
Reference to internal gyro.
function mode¶
Get the simulation mode.
Returns:
Simulation mode.
function model¶
Get the IMU model.
Returns:
IMU model.
function specification¶
Get the IMU specification.
Returns:
IMU specification.
function ~IMU¶
Protected Static Functions Documentation¶
function Preintegrate¶
Pre-integrate measurements to delta angle and velocity.
static std::pair< std::optional< Measurement >, std::optional< Measurement > > inertialsim::sensors::IMU::Preintegrate (
const Measurement & angular_rate,
const Measurement & specific_force,
int stride
)
Static method for batch pre-integration.
Parameters:
angular_rateAngular rate measurement.specific_forceSpecific force measurement.strideIntegration stride.
Returns:
Pair of (delta_angle, delta_velocity) or nullopt if insufficient.
The documentation for this class was generated from the following file cpp/include/inertialsim/sensors/imu.h