sbgECom Library  5.2.590-stable
Interface SBG Systems IMU/AHRS/INS
Loading...
Searching...
No Matches
sbgEComLogImu.h File Reference

Parse IMU (Inertial Measurement Unit) measurement logs. More...

Go to the source code of this file.

Data Structures

struct  _SbgEComLogImuLegacy
 Structure that stores data for the SBG_ECOM_LOG_IMU_DATA message. More...
 
struct  _SbgEComLogImuShort
 
struct  _SbgEComLogImuFastLegacy
 

Macros

#define SBG_ECOM_IMU_COM_OK   (0x00000001u << 0)
 
#define SBG_ECOM_IMU_STATUS_BIT   (0x00000001u << 1)
 
#define SBG_ECOM_IMU_ACCEL_X_BIT   (0x00000001u << 2)
 
#define SBG_ECOM_IMU_ACCEL_Y_BIT   (0x00000001u << 3)
 
#define SBG_ECOM_IMU_ACCEL_Z_BIT   (0x00000001u << 4)
 
#define SBG_ECOM_IMU_GYRO_X_BIT   (0x00000001u << 5)
 
#define SBG_ECOM_IMU_GYRO_Y_BIT   (0x00000001u << 6)
 
#define SBG_ECOM_IMU_GYRO_Z_BIT   (0x00000001u << 7)
 
#define SBG_ECOM_IMU_ACCELS_IN_RANGE   (0x00000001u << 8)
 
#define SBG_ECOM_IMU_GYROS_IN_RANGE   (0x00000001u << 9)
 
#define SBG_ECOM_IMU_GYROS_USE_HIGH_SCALE   (0x00000001u << 10)
 

Typedefs

typedef struct _SbgEComLogImuLegacy SbgEComLogImuLegacy
 Structure that stores data for the SBG_ECOM_LOG_IMU_DATA message.
 
typedef struct _SbgEComLogImuShort SbgEComLogImuShort
 
typedef struct _SbgEComLogImuFastLegacy SbgEComLogImuFastLegacy
 

Functions

SbgErrorCode sbgEComLogImuLegacyReadFromStream (SbgEComLogImuLegacy *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogImuLegacyWriteToStream (const SbgEComLogImuLegacy *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogImuShortReadFromStream (SbgEComLogImuShort *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogImuShortWriteToStream (const SbgEComLogImuShort *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogImuFastLegacyReadFromStream (SbgEComLogImuFastLegacy *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogImuFastLegacyWriteToStream (const SbgEComLogImuFastLegacy *pLogData, SbgStreamBuffer *pStreamBuffer)
 
float sbgEComLogImuShortGetDeltaAngle (const SbgEComLogImuShort *pImuShort, size_t idx)
 
void sbgEComLogImuShortSetDeltaAngle (SbgEComLogImuShort *pImuShort, const float *pArray, size_t arraySize)
 
float sbgEComLogImuShortGetDeltaVelocity (const SbgEComLogImuShort *pImuShort, size_t idx)
 
void sbgEComLogImuShortSetDeltaVelocity (SbgEComLogImuShort *pImuShort, const float *pArray, size_t arraySize)
 
float sbgEComLogImuShortGetTemperature (const SbgEComLogImuShort *pImuShort)
 
void sbgEComLogImuShortSetTemperature (SbgEComLogImuShort *pImuShort, float temperature)
 

Detailed Description

Parse IMU (Inertial Measurement Unit) measurement logs.

Author
SBG Systems
Date
25 February 2013
License

The MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Macro Definition Documentation

◆ SBG_ECOM_IMU_COM_OK

#define SBG_ECOM_IMU_COM_OK   (0x00000001u << 0)

Log inertial data status mask definitions Set to 1 if the communication with the IMU is ok.

◆ SBG_ECOM_IMU_STATUS_BIT

#define SBG_ECOM_IMU_STATUS_BIT   (0x00000001u << 1)

Set to 1 if the IMU passes general Built in Tests (calibration, CPU, ...).

◆ SBG_ECOM_IMU_ACCEL_X_BIT

#define SBG_ECOM_IMU_ACCEL_X_BIT   (0x00000001u << 2)

Set to 1 if the accelerometer X passes Built In Test.

◆ SBG_ECOM_IMU_ACCEL_Y_BIT

#define SBG_ECOM_IMU_ACCEL_Y_BIT   (0x00000001u << 3)

Set to 1 if the accelerometer Y passes Built In Test.

◆ SBG_ECOM_IMU_ACCEL_Z_BIT

#define SBG_ECOM_IMU_ACCEL_Z_BIT   (0x00000001u << 4)

Set to 1 if the accelerometer Z passes Built In Test.

◆ SBG_ECOM_IMU_GYRO_X_BIT

#define SBG_ECOM_IMU_GYRO_X_BIT   (0x00000001u << 5)

Set to 1 if the gyroscope X passes Built In Test.

◆ SBG_ECOM_IMU_GYRO_Y_BIT

#define SBG_ECOM_IMU_GYRO_Y_BIT   (0x00000001u << 6)

Set to 1 if the gyroscope Y passes Built In Test.

◆ SBG_ECOM_IMU_GYRO_Z_BIT

#define SBG_ECOM_IMU_GYRO_Z_BIT   (0x00000001u << 7)

Set to 1 if the gyroscope Z passes Built In Test.

◆ SBG_ECOM_IMU_ACCELS_IN_RANGE

#define SBG_ECOM_IMU_ACCELS_IN_RANGE   (0x00000001u << 8)

Set to 1 if all accelerometers are within operating range.

◆ SBG_ECOM_IMU_GYROS_IN_RANGE

#define SBG_ECOM_IMU_GYROS_IN_RANGE   (0x00000001u << 9)

Set to 1 if all gyroscopes are within operating range.

◆ SBG_ECOM_IMU_GYROS_USE_HIGH_SCALE

#define SBG_ECOM_IMU_GYROS_USE_HIGH_SCALE   (0x00000001u << 10)

Set if the gyroscope scale factor range is high. Applicable only for SBG_ECOM_LOG_IMU_SHORT logs.

Typedef Documentation

◆ SbgEComLogImuLegacy

Structure that stores data for the SBG_ECOM_LOG_IMU_DATA message.

This message provides synchronous IMU measurements aligned to UTC time.
Most SBG Systems INS, except ELLIPSE products, use IMUs with asynchronous measurements.

These measurements are extrapolated to match the EKF processing loop, which can introduce
artificial noise, particularly in high-frequency processing loops (e.g., 200Hz with up to 5ms extrapolation).

Note
This message is not suitable for post-processing due to the introduced noise. For accurate UTC/GPS-timestamped asynchronous IMU measurements, use SBG_ECOM_LOG_IMU_SHORT.
Warning
This message is not recommended for new designs and will be deprecated in sbgECom 5.x.

◆ SbgEComLogImuShort

Structure that stores data for the SBG_ECOM_LOG_IMU_SHORT message.

This message is sent asynchronously and must be used for post processing.

The delta angle values are scaled based on the gyroscopes output. If any output exceeds a predefined limit, the scale factor switches from standard to high range to prevent saturation.

◆ SbgEComLogImuFastLegacy

Structure that stores the data for SBG_ECOM_LOG_FAST_IMU_DATA message

Note
This message is not recommended for new designs and will be deprecated in sbgECom 5.x

Function Documentation

◆ sbgEComLogImuLegacyReadFromStream()

SbgErrorCode sbgEComLogImuLegacyReadFromStream ( SbgEComLogImuLegacy * pLogData,
SbgStreamBuffer * pStreamBuffer )

Parse data for the SBG_ECOM_LOG_IMU_DATA message and fill the corresponding structure.

Parameters
[out]pLogDataLog structure instance to fill.
[in]pStreamBufferInput stream buffer to read the log from.
Returns
SBG_NO_ERROR if a valid log has been read from the stream buffer.

◆ sbgEComLogImuLegacyWriteToStream()

SbgErrorCode sbgEComLogImuLegacyWriteToStream ( const SbgEComLogImuLegacy * pLogData,
SbgStreamBuffer * pStreamBuffer )

Write data for the SBG_ECOM_LOG_IMU_DATA message to the output stream buffer from the provided structure.

Parameters
[in]pLogDataLog structure instance to write.
[out]pStreamBufferOutput stream buffer to write the log to.
Returns
SBG_NO_ERROR if the log has been written to the stream buffer.

◆ sbgEComLogImuShortReadFromStream()

SbgErrorCode sbgEComLogImuShortReadFromStream ( SbgEComLogImuShort * pLogData,
SbgStreamBuffer * pStreamBuffer )

Parse data for the SBG_ECOM_LOG_IMU_SHORT message and fill the corresponding structure.

Parameters
[out]pLogDataLog structure instance to fill.
[in]pStreamBufferInput stream buffer to read the log from.
Returns
SBG_NO_ERROR if a valid log has been read from the stream buffer.

◆ sbgEComLogImuShortWriteToStream()

SbgErrorCode sbgEComLogImuShortWriteToStream ( const SbgEComLogImuShort * pLogData,
SbgStreamBuffer * pStreamBuffer )

Write data for the SBG_ECOM_LOG_IMU_SHORT message to the output stream buffer from the provided structure.

Parameters
[in]pLogDataLog structure instance to write.
[out]pStreamBufferOutput stream buffer to write the log to.
Returns
SBG_NO_ERROR if the log has been written to the stream buffer.

◆ sbgEComLogImuFastLegacyReadFromStream()

SbgErrorCode sbgEComLogImuFastLegacyReadFromStream ( SbgEComLogImuFastLegacy * pLogData,
SbgStreamBuffer * pStreamBuffer )

Parse data for the SBG_ECOM_LOG_FAST_IMU_DATA message and fill the corresponding structure.

Parameters
[out]pLogDataLog structure instance to fill.
[in]pStreamBufferInput stream buffer to read the log from.
Returns
SBG_NO_ERROR if a valid log has been read from the stream buffer.

◆ sbgEComLogImuFastLegacyWriteToStream()

SbgErrorCode sbgEComLogImuFastLegacyWriteToStream ( const SbgEComLogImuFastLegacy * pLogData,
SbgStreamBuffer * pStreamBuffer )

Write data for the SBG_ECOM_LOG_FAST_IMU_DATA message to the output stream buffer from the provided structure.

Parameters
[in]pLogDataLog structure instance to write.
[out]pStreamBufferOutput stream buffer to write the log to.
Returns
SBG_NO_ERROR if the log has been written to the stream buffer.

◆ sbgEComLogImuShortGetDeltaAngle()

float sbgEComLogImuShortGetDeltaAngle ( const SbgEComLogImuShort * pImuShort,
size_t idx )

Return from an IMU Short log, the X, Y or Z delta angle value in rad.s^-1

Parameters
[in]pImuShortInput IMU short message instance.
[in]idxThe component to return from 0 to 2.
Returns
The delta angle value converted in rad.s^-1.

◆ sbgEComLogImuShortSetDeltaAngle()

void sbgEComLogImuShortSetDeltaAngle ( SbgEComLogImuShort * pImuShort,
const float * pArray,
size_t arraySize )

Set the delta angle values.

Parameters
[in]pImuShortInput IMU short message instance.
[in]pArrayArray of delta angle values, in rad.s^-1.
[in]arraySizeSize of the array (should be 3).

◆ sbgEComLogImuShortGetDeltaVelocity()

float sbgEComLogImuShortGetDeltaVelocity ( const SbgEComLogImuShort * pImuShort,
size_t idx )

Return from an IMU Short log, the X, Y or Z delta velocity value in m.s^-2

Parameters
[in]pImuShortInput IMU short message instance.
[in]idxThe component to return from 0 to 2.
Returns
The delta velocity value converted in m.s^-2.

◆ sbgEComLogImuShortSetDeltaVelocity()

void sbgEComLogImuShortSetDeltaVelocity ( SbgEComLogImuShort * pImuShort,
const float * pArray,
size_t arraySize )

Set the delta velocity values.

Parameters
[in]pImuShortInput IMU short message instance.
[in]pArrayArray of delta velocity values, in m.s^-2.
[in]arraySizeSize of the array (should be 3).

◆ sbgEComLogImuShortGetTemperature()

float sbgEComLogImuShortGetTemperature ( const SbgEComLogImuShort * pImuShort)

Return from an IMU Short log, the temperature in °C

Parameters
[in]pImuShortInput IMU short message instance.
Returns
The converted temperature in °C

◆ sbgEComLogImuShortSetTemperature()

void sbgEComLogImuShortSetTemperature ( SbgEComLogImuShort * pImuShort,
float temperature )

Set the temperature.

Parameters
[in]pImuShortInput IMU short message instance.
[in]temperatureTemperature value to set, in °C.