Class inertialsim::sensors::Sensor¶
ClassList > inertialsim > sensors > Sensor
Abstract base class for sensors. More...
#include <sensor.h>
Inherited by the following classes: inertialsim::sensors::InertialSensor, inertialsim::sensors::Magnetometer
Public Functions¶
| Type | Name |
|---|---|
| Sensor (const SensorModel & model, const SensorSpecification & specification, std::optional< uint64_t > seed=std::nullopt, SimulationMode mode=SimulationMode::BATCH, std::optional< double > max_duration=std::nullopt) Construct a Sensor . |
|
| virtual const SensorModel & | model () const Get the sensor model. |
| const std::mt19937_64 & | rng () const Get the rng generator. |
| virtual const SensorSpecification & | specification () const Get the sensor specification. |
| virtual SensorState & | state () Get the sensor state. |
| virtual const SensorState & | state () const |
| virtual | ~Sensor () = default |
Public Static Functions¶
| Type | Name |
|---|---|
| Array | ApplyQuantization (const Array & signal, const SpecificationArray & quantization) Apply quantization to a signal. |
Detailed Description¶
Sensors inherit common attributes and methods for simulating measurement errors including:
- Misalignment (fixed axis orientation errors)
- Input limits (minimum/maximum range constraints)
- Bias (fixed + random + temperature-dependent)
- Noise (white Gaussian, quantization, random walk, etc.)
- Scale factor errors (fixed + random)
- Quantization effects
The sensor simulation follows industry-standard error models documented in Standard [05] and related references.
Public Functions Documentation¶
function Sensor¶
Construct a Sensor .
inertialsim::sensors::Sensor::Sensor (
const SensorModel & model,
const SensorSpecification & specification,
std::optional< uint64_t > seed=std::nullopt,
SimulationMode mode=SimulationMode::BATCH,
std::optional< double > max_duration=std::nullopt
)
Initializes all error models based on the model and specification. Error sources are initialized in the following order: * Misalignment (6-axis model per Standard [05]) * Input limits * Bias (fixed + random initialization) * Noise (pre-computed buffer for efficiency) * Scale factor * Quantization
Parameters:
modelModel options specifying which errors to simulate.specificationSensor specification with error magnitudes.seedRandom number generator seed. If not provided (std::nullopt), the RNG is seeded with fresh randomness from std::random_device.modeSimulation mode:- BATCH: Process all data at once (more efficient)
-
REALTIME: Process data incrementally (for online simulation)
-
max_durationMaximum simulation duration in seconds. Required for REALTIME mode to pre-allocate noise buffers.
function model¶
Get the sensor model.
Returns:
Sensor model.
function rng¶
Get the rng generator.
Returns:
Random number generator.
function specification¶
Get the sensor specification.
Returns:
Sensor specification.
function state [1/2]¶
Get the sensor state.
Returns:
Current sensor state.
function state [2/2]¶
function ~Sensor¶
Public Static Functions Documentation¶
function ApplyQuantization¶
Apply quantization to a signal.
static Array inertialsim::sensors::Sensor::ApplyQuantization (
const Array & signal,
const SpecificationArray & quantization
)
Parameters:
signalInput signal (axes x samples).quantizationQuantization value per axis.
Returns:
Quantized signal.
The documentation for this class was generated from the following file cpp/include/inertialsim/sensors/sensor.h