|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
Functions | |
| float | dmsToDecimalDegrees (int degrees, int minutes, float seconds=0.0f) |
| Convert degrees-minutes-seconds to decimal degrees. | |
| float | dmsToRadians (int degrees, int minutes, float seconds=0.0f) |
| Convert degrees-minutes-seconds to radians. | |
| float | calculateHeading (const MagnetometerData &data, float declination=0.0f) |
| Calculate heading (yaw) angle from magnetometer data in radians. | |
| float | calculateHeadingDegrees (const MagnetometerData &data, float declination_deg=0.0f) |
| Calculate heading (yaw) angle from magnetometer data in degrees. | |
| float | calculateMagneticStrength (const MagnetometerData &data) |
| Calculate total magnetic field strength. | |
| float | gaussToMicroTesla (float gauss) |
| Converts Gauss to microTesla. | |
| float | microTeslaToGauss (float ut) |
| Converts microTesla to Gauss. | |
| float | rangeToGauss (MagFullScaleRange range) |
|
inline |
Calculate heading (yaw) angle from magnetometer data in radians.
This function computes the magnetic heading in the horizontal plane using the x and y components of the magnetometer. The result is corrected for magnetic declination (difference between true north and magnetic north).
| data | Magnetometer data structure containing magnetic field measurements |
| declination | Magnetic declination correction in radians (positive east) |
Definition at line 74 of file MagnetometerUtils.hpp.
References M_PI, mag(), and MagnetometerData::magnetic_field.
Referenced by SensorBMM150::readData(), SensorQMC5883L::readData(), SensorQMC6309::readData(), and SensorQSTMagnetic::readData().
|
inline |
Calculate heading (yaw) angle from magnetometer data in degrees.
This is a convenience wrapper that returns the heading in degrees (0-360).
| data | Magnetometer data structure containing magnetic field measurements |
| declination_deg | Magnetic declination correction in degrees (positive east) |
Definition at line 115 of file MagnetometerUtils.hpp.
References M_PI, mag(), and MagnetometerData::magnetic_field.
|
inline |
Calculate total magnetic field strength.
Computes the magnitude of the magnetic field vector from all three axes. This represents the total strength of the magnetic field at the sensor.
| data | Magnetometer data structure containing magnetic field measurements |
Definition at line 143 of file MagnetometerUtils.hpp.
References mag(), and MagnetometerData::magnetic_field.
Referenced by loop().
|
inline |
Convert degrees-minutes-seconds to decimal degrees.
| degrees | Whole degrees (can be negative) |
| minutes | Arc minutes (0-59) |
| seconds | Arc seconds (0-59.999...) |
Definition at line 46 of file MagnetometerUtils.hpp.
Referenced by dmsToRadians(), and setup().
|
inline |
Convert degrees-minutes-seconds to radians.
Definition at line 55 of file MagnetometerUtils.hpp.
References dmsToDecimalDegrees(), and M_PI.
|
inline |
Converts Gauss to microTesla.
| gauss | The magnetic field strength in Gauss. |
| The | magnetic field strength in microTesla. |
Definition at line 157 of file MagnetometerUtils.hpp.
Referenced by loop().
|
inline |
Converts microTesla to Gauss.
| ut | The magnetic field strength in microTesla. |
| The | magnetic field strength in Gauss. |
Definition at line 168 of file MagnetometerUtils.hpp.
Referenced by SensorBMM150::readData().
|
inline |