sbgECom Library
4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
|
Magnetometer aiding module configuration & on-board magnetic calibration commands. More...
Go to the source code of this file.
Data Structures | |
struct | _SbgEComMagRejectionConf |
struct | _SbgEComMagCalibResults |
Macros | |
#define | SBG_ECOM_MAG_CALIB_NOT_ENOUGH_POINTS (0x0001u) |
#define | SBG_ECOM_MAG_CALIB_TOO_MUCH_DISTORTIONS (0x0002u) |
#define | SBG_ECOM_MAG_CALIB_X_MOTION_ISSUE (0x0004u) |
#define | SBG_ECOM_MAG_CALIB_Y_MOTION_ISSUE (0x0008u) |
#define | SBG_ECOM_MAG_CALIB_Z_MOTION_ISSUE (0x0010u) |
#define | SBG_ECOM_MAG_CALIB_ALIGNMENT_ISSUE (0x0020u) |
Typedefs | |
typedef enum _SbgEComMagCalibMode | SbgEComMagCalibMode |
typedef enum _SbgEComMagCalibBandwidth | SbgEComMagCalibBandwidth |
typedef enum _SbgEComMagCalibQuality | SbgEComMagCalibQuality |
typedef enum _SbgEComMagCalibConfidence | SbgEComMagCalibConfidence |
typedef enum _SbgEComMagModelsStdIds | SbgEComMagModelsStdId |
typedef struct _SbgEComMagRejectionConf | SbgEComMagRejectionConf |
typedef struct _SbgEComMagCalibResults | SbgEComMagCalibResults |
Enumerations | |
enum | _SbgEComMagCalibMode { SBG_ECOM_MAG_CALIB_MODE_2D = 1 , SBG_ECOM_MAG_CALIB_MODE_3D = 2 } |
enum | _SbgEComMagCalibBandwidth { SBG_ECOM_MAG_CALIB_LOW_BW = 0 , SBG_ECOM_MAG_CALIB_MEDIUM_BW = 1 , SBG_ECOM_MAG_CALIB_HIGH_BW = 2 } |
enum | _SbgEComMagCalibQuality { SBG_ECOM_MAG_CALIB_QUAL_OPTIMAL = 0 , SBG_ECOM_MAG_CALIB_QUAL_GOOD = 1 , SBG_ECOM_MAG_CALIB_QUAL_POOR = 2 , SBG_ECOM_MAG_CALIB_QUAL_INVALID = 3 } |
enum | _SbgEComMagCalibConfidence { SBG_ECOM_MAG_CALIB_TRUST_HIGH = 0 , SBG_ECOM_MAG_CALIB_TRUST_MEDIUM = 1 , SBG_ECOM_MAG_CALIB_TRUST_LOW = 2 } |
enum | _SbgEComMagModelsStdIds { SBG_ECOM_MAG_MODEL_NORMAL = 201 , SBG_ECOM_MAG_MODEL_NOISY_MAG_TOLERANT = 202 } |
Functions | |
SbgErrorCode | sbgEComCmdMagSetModelId (SbgEComHandle *pHandle, SbgEComMagModelsStdId modelId) |
SbgErrorCode | sbgEComCmdMagGetModelId (SbgEComHandle *pHandle, SbgEComMagModelsStdId *pModelId) |
SbgErrorCode | sbgEComCmdMagGetRejection (SbgEComHandle *pHandle, SbgEComMagRejectionConf *pRejectConf) |
SbgErrorCode | sbgEComCmdMagSetRejection (SbgEComHandle *pHandle, const SbgEComMagRejectionConf *pRejectConf) |
SbgErrorCode | sbgEComCmdMagSetCalibData (SbgEComHandle *pHandle, const float *pOffset, const float *pMatrix) |
SbgErrorCode | sbgEComCmdMagStartCalib (SbgEComHandle *pHandle, SbgEComMagCalibMode mode, SbgEComMagCalibBandwidth bandwidth) |
SbgErrorCode | sbgEComCmdMagComputeCalib (SbgEComHandle *pHandle, SbgEComMagCalibResults *pCalibResults) |
Magnetometer aiding module configuration & on-board magnetic calibration commands.
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.
#define SBG_ECOM_MAG_CALIB_NOT_ENOUGH_POINTS (0x0001u) |
Status bit masks used to report advanced information on the on-board magnetic calibration. Not enough valid magnetic points have been acquired.
#define SBG_ECOM_MAG_CALIB_TOO_MUCH_DISTORTIONS (0x0002u) |
Unable to compute a magnetic calibration due to magnetic interferences or incorrect data set distribution.
#define SBG_ECOM_MAG_CALIB_X_MOTION_ISSUE (0x0004u) |
For a 3D calibration: not enough motion on X axis. For a 2D calibration; too much motion on X axis.
#define SBG_ECOM_MAG_CALIB_Y_MOTION_ISSUE (0x0008u) |
For a 3D calibration: not enough motion on Y axis. For a 2D calibration; too much motion on Y axis.
#define SBG_ECOM_MAG_CALIB_Z_MOTION_ISSUE (0x0010u) |
For a 3D or 2D calibration: not enough motion on Z axis.
#define SBG_ECOM_MAG_CALIB_ALIGNMENT_ISSUE (0x0020u) |
For a 3D calibration: the alignment between the magnetometers and the inertial frame seems to be invalid.
typedef enum _SbgEComMagCalibMode SbgEComMagCalibMode |
Define if the on-board magnetic calibration should acquire points for a 3D or 2D calibration.
typedef enum _SbgEComMagCalibBandwidth SbgEComMagCalibBandwidth |
Used to select the expected dynamics during the magnetic calibration.
typedef enum _SbgEComMagCalibQuality SbgEComMagCalibQuality |
General quality indicator of an on-board magnetic calibration.
typedef enum _SbgEComMagCalibConfidence SbgEComMagCalibConfidence |
Confidence indicator on results of an on-bard magnetic calibration.
typedef enum _SbgEComMagModelsStdIds SbgEComMagModelsStdId |
This enum defines the different magnetometer model IDs available in standard
typedef struct _SbgEComMagRejectionConf SbgEComMagRejectionConf |
Holds all necessary information for Magnetometer module data rejection.
typedef struct _SbgEComMagCalibResults SbgEComMagCalibResults |
Helper structure to retrieve on-board magnetic calibration results.
enum _SbgEComMagCalibMode |
Define if the on-board magnetic calibration should acquire points for a 3D or 2D calibration.
Used to select the expected dynamics during the magnetic calibration.
General quality indicator of an on-board magnetic calibration.
Confidence indicator on results of an on-bard magnetic calibration.
SbgErrorCode sbgEComCmdMagSetModelId | ( | SbgEComHandle * | pHandle, |
SbgEComMagModelsStdId | modelId | ||
) |
Set magnetometer error model id.
[in] | pHandle | A valid sbgECom handle |
[in] | modelId | Magnetometer model id to set |
SbgErrorCode sbgEComCmdMagGetModelId | ( | SbgEComHandle * | pHandle, |
SbgEComMagModelsStdId * | pModelId | ||
) |
Retrieve magnetometer error model id
[in] | pHandle | A valid sbgECom handle |
[out] | pModelId | Retrieved magnetometer model id |
SbgErrorCode sbgEComCmdMagGetRejection | ( | SbgEComHandle * | pHandle, |
SbgEComMagRejectionConf * | pRejectConf | ||
) |
Retrieve the rejection configuration of the magnetometer module.
[in] | pHandle | A valid sbgECom handle. |
[out] | pRejectConf | Pointer to a SbgEComMagRejectionConf struct to hold rejection configuration of the magnetometer module. |
SbgErrorCode sbgEComCmdMagSetRejection | ( | SbgEComHandle * | pHandle, |
const SbgEComMagRejectionConf * | pRejectConf | ||
) |
Set the rejection configuration of the magnetometer module.
[in] | pHandle | A valid sbgECom handle. |
[in] | pRejectConf | Pointer to a SbgEComMagRejectionConf struct holding rejection configuration for the magnetometer module. |
SbgErrorCode sbgEComCmdMagSetCalibData | ( | SbgEComHandle * | pHandle, |
const float * | pOffset, | ||
const float * | pMatrix | ||
) |
Send a command that set the magnetometers calibration parameters.
[in] | pHandle | A valid sbgECom handle. |
[in] | pOffset | Magnetometers calibration offset vector. |
[in] | pMatrix | Magnetometers calibration 3x3 matrix. |
SbgErrorCode sbgEComCmdMagStartCalib | ( | SbgEComHandle * | pHandle, |
SbgEComMagCalibMode | mode, | ||
SbgEComMagCalibBandwidth | bandwidth | ||
) |
Start the magnetic calibration process.
As soon as this command is sent, the device will start logging magnetic field data internally. This set of data will be used later by the magnetic calibration algorithms to map the surrounding magnetic field.
[in] | pHandle | A valid sbgECom handle. |
[in] | mode | Define which magnetic calibration type to perform. It could be 3D or 2D. |
[in] | bandwidth | Tell the device that we should have low, medium or high dynamics during the magnetic calibration process. |
SbgErrorCode sbgEComCmdMagComputeCalib | ( | SbgEComHandle * | pHandle, |
SbgEComMagCalibResults * | pCalibResults | ||
) |
This command computes a magnetic calibration solution based on the magnetic field logged since the last call to the command SBG_ECOM_CMD_START_MAG_CALIB (15).
As soon as the computations are done, the device will answer with quality indicators, status flags and if possible a valid magnetic calibration matrix and offset.
[in] | pHandle | A valid sbgECom handle. |
[out] | pCalibResults | Pointer on a SbgEComMagCalibResults structure that can hold on-board magnetic calibration results and status. |