11 #ifndef CORESTATETYPE_H
12 #define CORESTATETYPE_H
15 #include <Eigen/Dense>
23 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
27 Eigen::Vector3d
p_wi_{ Eigen::Vector3d::Zero() };
28 Eigen::Vector3d
v_wi_{ Eigen::Vector3d::Zero() };
29 Eigen::Quaternion<double>
q_wi_{ Eigen::Quaternion<double>::Identity() };
30 Eigen::Vector3d
b_w_{ Eigen::Vector3d::Zero() };
31 Eigen::Vector3d
b_a_{ Eigen::Vector3d::Zero() };
34 Eigen::Vector3d
w_m_{ Eigen::Vector3d::Zero() };
35 Eigen::Vector3d
a_m_{ Eigen::Vector3d::Zero() };
47 Eigen::Matrix<double, CoreStateType::size_error_, 1> correction)
55 corrected_state.
p_wi_ = state_prior.
p_wi_ + correction.block(0, 0, 3, 1);
56 corrected_state.
v_wi_ = state_prior.
v_wi_ + correction.block(3, 0, 3, 1);
68 corrected_state.
b_w_ = state_prior.
b_w_ + correction.block(9, 0, 3, 1);
69 corrected_state.
b_a_ = state_prior.
b_a_ + correction.block(12, 0, 3, 1);
72 corrected_state.
a_m_ = state_prior.
a_m_;
73 corrected_state.
w_m_ = state_prior.
w_m_;
75 return corrected_state;
82 out <<
"p_wi:\t[ " << data.
p_wi_.transpose() <<
" ]" << std::endl
83 <<
"v_wi:\t[ " << data.
v_wi_.transpose() <<
" ]" << std::endl
84 <<
"q_wi:\t[ " << data.
q_wi_.w() <<
" " << data.
q_wi_.vec().transpose() <<
" ]" << std::endl
85 <<
"b_w:\t[ " << data.
b_w_.transpose() <<
" ]" << std::endl
86 <<
"b_a:\t[ " << data.
b_a_.transpose() <<
" ]" << std::endl
87 <<
"w_m:\t[ " << data.
w_m_.transpose() <<
" ]" << std::endl
88 <<
"a_m:\t[ " << data.
a_m_.transpose() <<
" ]" << std::endl;
97 os <<
"w_m_x, w_m_y, w_m_z, ";
98 os <<
"a_m_x, a_m_y, a_m_z, ";
99 os <<
"p_wi_x, p_wi_y, p_wi_z, ";
100 os <<
"v_wi_x, v_wi_y, v_wi_z, ";
101 os <<
"q_wi_w, q_wi_x, q_wi_y, q_wi_z, ";
102 os <<
"b_w_x, b_w_y, b_w_z, ";
103 os <<
"b_a_x, b_a_y, b_a_z";
115 std::stringstream os;
119 os <<
", " <<
w_m_(0) <<
", " <<
w_m_(1) <<
", " <<
w_m_(2);
120 os <<
", " <<
a_m_(0) <<
", " <<
a_m_(1) <<
", " <<
a_m_(2);
124 Eigen::Vector4d q_wi =
q_wi_.coeffs();
125 os <<
", " << q_wi(3) <<
", " << q_wi(0) <<
", " << q_wi(1) <<
", " << q_wi(2);
127 os <<
", " <<
b_w_(0) <<
", " <<
b_w_(1) <<
", " <<
b_w_(2);
128 os <<
", " <<
b_a_(0) <<
", " <<
b_a_(1) <<
", " <<
b_a_(2);
134 using CoreStateMatrix = Eigen::Matrix<double, CoreStateType::size_error_, CoreStateType::size_error_>;
Definition: core_state_type.h:21
Eigen::Vector3d w_m_
Definition: core_state_type.h:34
static constexpr int size_true_
Definition: core_state_type.h:37
static constexpr int size_error_
Definition: core_state_type.h:38
Eigen::Vector3d v_wi_
Definition: core_state_type.h:28
Eigen::Vector3d b_a_
Definition: core_state_type.h:31
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CoreStateType()=default
Eigen::Vector3d b_w_
Definition: core_state_type.h:30
Eigen::Vector3d p_wi_
Definition: core_state_type.h:27
friend std::ostream & operator<<(std::ostream &out, const CoreStateType &data)
Definition: core_state_type.h:78
std::string to_csv_string(const double ×tamp) const
to_csv_string export state to single csv string
Definition: core_state_type.h:113
static std::string get_csv_state_header_string()
Definition: core_state_type.h:93
Eigen::Quaternion< double > q_wi_
Definition: core_state_type.h:29
static CoreStateType ApplyCorrection(CoreStateType state_prior, Eigen::Matrix< double, CoreStateType::size_error_, 1 > correction)
ApplyCorrection.
Definition: core_state_type.h:46
Eigen::Vector3d a_m_
Definition: core_state_type.h:35
static Eigen::Quaterniond ApplySmallAngleQuatCorr(const Eigen::Quaterniond &q_prior, const Eigen::Vector3d &correction)
ApplySmallAngleQuatCorr.
Eigen::Matrix< double, CoreStateType::size_error_, 1 > CoreStateVector
Definition: core_state_type.h:135
Eigen::Matrix< double, CoreStateType::size_error_, CoreStateType::size_error_ > CoreStateMatrix
Definition: core_state_type.h:134