MAV'RIC
|
Driver for HMC5883L magnetometer. More...
#include <hmc5883l.hpp>
Public Member Functions | |
Hmc5883l (I2c &i2c) | |
Constructor. | |
bool | init (void) |
Initialise the sensor. | |
bool | update (void) |
Main update function Reads new values from sensor. | |
const float & | last_update_us (void) const |
Get last update time in microseconds. | |
const std::array< float, 3 > & | mag (void) const |
Get X, Y and Z components of magnetic field. | |
const float & | mag_X (void) const |
Get X component of magnetic field. | |
const float & | mag_Y (void) const |
Get Y component of magnetic field. | |
const float & | mag_Z (void) const |
Get Z component of magnetic field. | |
const float & | temperature (void) const |
Get sensor temperature. |
Driver for HMC5883L magnetometer.
This driver does not support temperature
Hmc5883l::Hmc5883l | ( | I2c & | i2c | ) |
Constructor.
i2c | Reference to I2C device |
bool Hmc5883l::init | ( | void | ) | [virtual] |
Initialise the sensor.
Implements Magnetometer.
const float & Hmc5883l::last_update_us | ( | void | ) | const [virtual] |
const std::array< float, 3 > & Hmc5883l::mag | ( | void | ) | const [virtual] |
Get X, Y and Z components of magnetic field.
This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations
Implements Magnetometer.
const float & Hmc5883l::mag_X | ( | void | ) | const [virtual] |
Get X component of magnetic field.
This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations
Implements Magnetometer.
const float & Hmc5883l::mag_Y | ( | void | ) | const [virtual] |
Get Y component of magnetic field.
This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations
Implements Magnetometer.
const float & Hmc5883l::mag_Z | ( | void | ) | const [virtual] |
Get Z component of magnetic field.
This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations
Implements Magnetometer.
const float & Hmc5883l::temperature | ( | void | ) | const [virtual] |
bool Hmc5883l::update | ( | void | ) | [virtual] |
Main update function Reads new values from sensor.
Implements Magnetometer.