14 #include <Eigen/Dense>
30 void AddElement(
const Eigen::Vector3d& mag_vector,
const Eigen::Vector3d& imu_linear_acc_vector);
78 static Eigen::Vector3d
mag_var_ang_to_vec(
const double& dec,
const double& inc,
const double& r = 1);
The MagImuData class keeps a pair of magnetometer and imu linear acceleration measurements.
Definition: mag_utils.h:84
MagImuData(const Eigen::Vector3d &mag_vec, const Eigen::Vector3d &imu_vec)
MagImuData.
Definition: mag_utils.h:91
Eigen::Vector3d imu_vec_
imu_vec_ Single vector of an IMU linear acceleration measurement
Definition: mag_utils.h:102
Eigen::Vector3d mag_vec_
mag_vec_ Single vector of a magnetometer measurement
Definition: mag_utils.h:97
Definition: mag_utils.h:20
void Reset()
Reset Reset the initialization module.
Eigen::Matrix3d get_rot() const
get_rot Get the rotation matrix for the vector pairs in the buffer
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 b...
void set_done()
set_done Set if the rotation initialization was done
bool IsDone() const
IsDone Check if the initialization was done.
int get_size() const
get_size Get the current size of the buffer
MagImuData get_vec_mean() const
get_vec_mean Get the mean of the Mag and IMU vectors in the measurement buffer
std::vector< MagImuData > rot_init_vec_
rot_init_vec_ Measurement buffer
Definition: mag_utils.h:115
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
bool once_
once_ Indicate if the intialization was done
Definition: mag_utils.h:120
Eigen::Quaterniond get_quat() const
get_quat Same as 'get_rot' but as quaternion