Skip to content

Class inertialsim::sensors::IMUSpecification::DataInterface

ClassList > inertialsim > sensors > IMUSpecification > DataInterface

IMU unified data interface specification.More...

  • #include <imu_specification.h>

Public Functions

Type Name
DataInterface (GyroSpecification::DataInterface & gyro, AccelerometerSpecification::DataInterface & accel, int axes)
Construct with references to child interfaces.
std::pair< std::optional< Parameter< SpecificationArray > >, std::optional< Parameter< SpecificationArray > > > delta_quantization () const
Get delta output quantization for gyro and accelerometer.
Parameter< double > delta_sample_rate () const
Get the common delta sample rate.
int delta_stride () const
Get the delta stride.
std::pair< std::optional< Parameter< SpecificationArray > >, std::optional< Parameter< SpecificationArray > > > quantization () const
Get rate output quantization for gyro and accelerometer.
Parameter< double > sample_rate () const
Get the common sample rate.
void set_delta_quantization (const Parameter< T > & gyro, const Parameter< T > & accel)
Set delta output quantization for gyro and accelerometer.
void set_delta_quantization (const Parameter< T > & gyro, std::nullopt_t)
void set_delta_quantization (std::nullopt_t, const Parameter< T > & accel)
void set_delta_quantization (std::nullopt_t, std::nullopt_t)
void set_delta_sample_rate (const Parameter< double > & param)
Set common delta sample rate for both gyro and accelerometer.
void set_quantization (const Parameter< T > & gyro, const Parameter< T > & accel)
Set rate output quantization for gyro and accelerometer.
void set_quantization (const Parameter< T > & gyro, std::nullopt_t)
void set_quantization (std::nullopt_t, const Parameter< T > & accel)
void set_quantization (std::nullopt_t, std::nullopt_t)
void set_sample_rate (const Parameter< double > & param)
Set common sample rate for both gyro and accelerometer.

Detailed Description

The data interface includes a common sample rate and delta sample rate for both gyro and accelerometer, with independent quantization settings for each sensor type.

Public Functions Documentation

function DataInterface

Construct with references to child interfaces.

inertialsim::sensors::IMUSpecification::DataInterface::DataInterface (
    GyroSpecification::DataInterface & gyro,
    AccelerometerSpecification::DataInterface & accel,
    int axes
) 

Parameters:

  • gyro Reference to the contained gyro data interface.
  • accel Reference to the contained accelerometer data interface.
  • axes Number of IMU axes.

function delta_quantization

Get delta output quantization for gyro and accelerometer.

std::pair< std::optional< Parameter < SpecificationArray > >, std::optional< Parameter < SpecificationArray > > > inertialsim::sensors::IMUSpecification::DataInterface::delta_quantization () const

Returns:

Pair of (gyro delta quantization, accelerometer delta quantization).


function delta_sample_rate

Get the common delta sample rate.

Parameter < double > inertialsim::sensors::IMUSpecification::DataInterface::delta_sample_rate () const

Returns:

Delta sample rate parameter in Hz.


function delta_stride

Get the delta stride.

int inertialsim::sensors::IMUSpecification::DataInterface::delta_stride () const

Returns:

Integer number of rate outputs per delta output.


function quantization

Get rate output quantization for gyro and accelerometer.

std::pair< std::optional< Parameter < SpecificationArray > >, std::optional< Parameter < SpecificationArray > > > inertialsim::sensors::IMUSpecification::DataInterface::quantization () const

Returns:

Pair of (gyro quantization, accelerometer quantization).


function sample_rate

Get the common sample rate.

Parameter < double > inertialsim::sensors::IMUSpecification::DataInterface::sample_rate () const

Returns:

Sample rate parameter in Hz.


function set_delta_quantization [¼]

Set delta output quantization for gyro and accelerometer.

template<typename T>
inline void inertialsim::sensors::IMUSpecification::DataInterface::set_delta_quantization (
    const Parameter < T > & gyro,
    const Parameter < T > & accel
) 

Sets delta quantization independently for each sensor type. Gyro delta angle units: "rad/LSB" or "deg/LSB" Accelerometer delta velocity units: "m/s/LSB" or "ft/s/LSB" Pass std::nullopt to disable delta quantization for that sensor.

Accepts Parameter<double>, Parameter<SpecificationArray>, std::nullopt, or std::optional<Parameter<T>> for each parameter. Scalar parameters are automatically broadcast to all axes.

Parameters:

  • gyro_param Gyro delta quantization parameter or std::nullopt.
  • accel_param Accelerometer delta quantization parameter or std::nullopt.

Exception:

  • std::invalid_argument if units are invalid for sensor type.

function set_delta_quantization [2/4]

template<typename T>
inline void inertialsim::sensors::IMUSpecification::DataInterface::set_delta_quantization (
    const Parameter < T > & gyro,
    std::nullopt_t
) 

function set_delta_quantization [¾]

template<typename T>
inline void inertialsim::sensors::IMUSpecification::DataInterface::set_delta_quantization (
    std::nullopt_t,
    const Parameter < T > & accel
) 

function set_delta_quantization [4/4]

inline void inertialsim::sensors::IMUSpecification::DataInterface::set_delta_quantization (
    std::nullopt_t,
    std::nullopt_t
) 

function set_delta_sample_rate

Set common delta sample rate for both gyro and accelerometer.

void inertialsim::sensors::IMUSpecification::DataInterface::set_delta_sample_rate (
    const Parameter < double > & param
) 

Delta sample rate must be an integer divisor of the sample rate. Set to 0 Hz to disable delta outputs. Units must be "Hz".

Parameters:

  • param Delta sample rate parameter (must be >= 0 Hz).

Exception:

  • std::invalid_argument if units are not "Hz", value < 0, or not an integer divisor of sample_rate.

function set_quantization [¼]

Set rate output quantization for gyro and accelerometer.

template<typename T>
inline void inertialsim::sensors::IMUSpecification::DataInterface::set_quantization (
    const Parameter < T > & gyro,
    const Parameter < T > & accel
) 

Sets quantization independently for each sensor type. Gyro units: "rad/s/LSB" or "deg/s/LSB" Accelerometer units: "m/s/s/LSB", "g/LSB", or "ft/s/s/LSB" Pass std::nullopt to disable quantization for that sensor.

Accepts Parameter<double>, Parameter<SpecificationArray>, std::nullopt, or std::optional<Parameter<T>> for each parameter. Scalar parameters are automatically broadcast to all axes.

Parameters:

  • gyro_param Gyro quantization parameter or std::nullopt.
  • accel_param Accelerometer quantization parameter or std::nullopt.

Exception:

  • std::invalid_argument if units are invalid for sensor type.

function set_quantization [2/4]

template<typename T>
inline void inertialsim::sensors::IMUSpecification::DataInterface::set_quantization (
    const Parameter < T > & gyro,
    std::nullopt_t
) 

function set_quantization [¾]

template<typename T>
inline void inertialsim::sensors::IMUSpecification::DataInterface::set_quantization (
    std::nullopt_t,
    const Parameter < T > & accel
) 

function set_quantization [4/4]

inline void inertialsim::sensors::IMUSpecification::DataInterface::set_quantization (
    std::nullopt_t,
    std::nullopt_t
) 

function set_sample_rate

Set common sample rate for both gyro and accelerometer.

void inertialsim::sensors::IMUSpecification::DataInterface::set_sample_rate (
    const Parameter < double > & param
) 

The sample rate is the frequency at which new data is transmitted. Units must be "Hz".

Parameters:

  • param Sample rate parameter (must be > 0 Hz).

Exception:

  • std::invalid_argument if units are not "Hz" or value <= 0.


The documentation for this class was generated from the following file cpp/include/inertialsim/sensors/imu_specification.h