mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
mars::MagnetometerInit Class Reference

#include </home/runner/work/mars_lib/mars_lib/source/mars/include/mars/sensors/mag/mag_utils.h>

+ Collaboration diagram for mars::MagnetometerInit:

Classes

class  MagImuData
 The MagImuData class keeps a pair of magnetometer and imu linear acceleration measurements. More...
 

Public Member Functions

 MagnetometerInit ()=default
 
void AddElement (const Eigen::Vector3d &mag_vector, const Eigen::Vector3d &imu_linear_acc_vector)
 AddElement Add magnetometer and imu measurement pairs to buffer IMU and Magnetometer vectors nee to be expressed in the IMU reference frame. More...
 
Eigen::Matrix3d get_rot () const
 get_rot Get the rotation matrix for the vector pairs in the buffer More...
 
Eigen::Quaterniond get_quat () const
 get_quat Same as 'get_rot' but as quaternion More...
 
int get_size () const
 get_size Get the current size of the buffer More...
 
void set_done ()
 set_done Set if the rotation initialization was done More...
 
bool IsDone () const
 IsDone Check if the initialization was done. More...
 
void Reset ()
 Reset Reset the initialization module. More...
 
MagImuData get_vec_mean () const
 get_vec_mean Get the mean of the Mag and IMU vectors in the measurement buffer More...
 

Static Public Member Functions

static Eigen::Vector3d mag_var_ang_to_vec (const double &dec, const double &inc, const double &r=1)
 mag_var_ang_to_vec Perform Spherical to Cartesian conversion for a vector in the GNSS world frame More...
 

Private Attributes

std::vector< MagImuDatarot_init_vec_
 rot_init_vec_ Measurement buffer More...
 
bool once_ { false }
 once_ Indicate if the intialization was done More...
 

Constructor & Destructor Documentation

◆ MagnetometerInit()

mars::MagnetometerInit::MagnetometerInit ( )
default

Member Function Documentation

◆ AddElement()

void mars::MagnetometerInit::AddElement ( const Eigen::Vector3d &  mag_vector,
const Eigen::Vector3d &  imu_linear_acc_vector 
)

AddElement Add magnetometer and imu measurement pairs to buffer IMU and Magnetometer vectors nee to be expressed in the IMU reference frame.

Parameters
mag_vectorMagnetic vector expressed in the IMU frame
imu_linear_acc_vectorLinear acceleration vector, assuming static conditions

◆ get_rot()

Eigen::Matrix3d mars::MagnetometerInit::get_rot ( ) const

get_rot Get the rotation matrix for the vector pairs in the buffer

Returns
Rotation of the IMU sensor w.r.t. the world frame

◆ get_quat()

Eigen::Quaterniond mars::MagnetometerInit::get_quat ( ) const

get_quat Same as 'get_rot' but as quaternion

Returns
Rotation of the IMU sensor w.r.t. the world frame

◆ get_size()

int mars::MagnetometerInit::get_size ( ) const

get_size Get the current size of the buffer

Returns
Size of the buffer

◆ set_done()

void mars::MagnetometerInit::set_done ( )

set_done Set if the rotation initialization was done

◆ IsDone()

bool mars::MagnetometerInit::IsDone ( ) const

IsDone Check if the initialization was done.

Returns
True if initialization was done

◆ Reset()

void mars::MagnetometerInit::Reset ( )

Reset Reset the initialization module.

Reset 'isDone' and clear the buffer

◆ mag_var_ang_to_vec()

static Eigen::Vector3d mars::MagnetometerInit::mag_var_ang_to_vec ( const double &  dec,
const double &  inc,
const double &  r = 1 
)
static

mag_var_ang_to_vec Perform Spherical to Cartesian conversion for a vector in the GNSS world frame

The GNSS world frame is rotated -90deg w.r.t. the magnetic world frame.

Parameters
decDeclination or azimuth (in degree) of the magnetic field vector
incInclination or elevation (in degree) of the magnetic field vector
rmagnitude of the magnetic field (defaults to 1)
Returns
Carthesian vector

◆ get_vec_mean()

MagImuData mars::MagnetometerInit::get_vec_mean ( ) const

get_vec_mean Get the mean of the Mag and IMU vectors in the measurement buffer

Returns
Return the mean as 'MagImuData' type

Member Data Documentation

◆ rot_init_vec_

std::vector<MagImuData> mars::MagnetometerInit::rot_init_vec_
private

rot_init_vec_ Measurement buffer

◆ once_

bool mars::MagnetometerInit::once_ { false }
private

once_ Indicate if the intialization was done


The documentation for this class was generated from the following file: