55 "The IMU state (bias, scale factor, misalignment) must be constant over the whole increment period.");
63 Eigen::Vector3d b_deltaRot = imuPos.
b_quat_p()
69 Eigen::Vector3d b_accel = (imuPos.
b_quat_p()
80 Eigen::Matrix3d J_r_rot =
math::J_r(b_deltaRot);
81 Eigen::Quaterniond bkp1_quat_bk = bk_quat_bkp1.conjugate();
94 A.block<3, 3>(0, 0) = bkp1_quat_bk.toRotationMatrix();
95 A.block<3, 3>(3, 0) = -i_R_k * b_accelSkew * meas.
meas.
dt;
96 A.block<3, 3>(3, 3).setIdentity();
97 A.block<3, 3>(6, 0) = 0.5 * A.block<3, 3>(3, 0) * meas.
meas.
dt;
98 A.block<3, 3>(6, 3).diagonal().setConstant(meas.
meas.
dt);
99 A.block<3, 3>(6, 6).setIdentity();
101 Eigen::Matrix<double, 9, 6> B = Eigen::Matrix<double, 9, 6>::Zero();
102 B.block<3, 3>(0, 0) = J_r_rot * meas.
meas.
dt;
103 B.block<3, 3>(3, 3) = i_R_k * meas.
meas.
dt;
104 B.block<3, 3>(6, 3) = 0.5 * B.block<3, 3>(3, 3) * meas.
meas.
dt;
135 bool changed =
false;
140 ImGui::Combo(fmt::format(
"Integration Frame##{}", label).c_str(), &integrationFrame,
"ECEF\0NED\0\0"))
148 ImGui::SetNextItemOpen(
false, ImGuiCond_FirstUseEver);
149 if (ImGui::TreeNode(fmt::format(
"Compensation models##{}", label).c_str()))
151 ImGui::TextUnformatted(
"Acceleration compensation");
208 if (j.contains(
"integrationFrame")) { j.at(
"integrationFrame").get_to(data.
_integrationFrame); }
209 if (j.contains(
"gravitationModel")) { j.at(
"gravitationModel").get_to(data.
_gravitationModel); }
210 if (j.contains(
"lockIntegrationFrame")) { j.at(
"lockIntegrationFrame").get_to(data.
_lockIntegrationFrame); }
#define INS_ASSERT_USER_ERROR(_EXP, _MSG)
Assert function with message.
nlohmann::json json
json namespace
Text Help Marker (?) with Tooltip.
Inertial Measurement Preintegrator.
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
const Eigen::Quaterniond & b_quat_p() const
Quaternion from IMU platform frame to body frame.
const Eigen::Matrix9d & getCovMatrix() const
Get the Covariance Matrix of the preintegrated measurements (3x attitude, 3x velocity,...
std::optional< Eigen::Matrix6d > _imuNoiseScale_W
Noise scale matrix of the IMU.
Eigen::Matrix3d _pAtt_pOmega
Partial derivative of the attitude increment after the angular rate bias.
double _timeIncrement
Time accumulated for each increment.
void addInertialMeasurement(const Measurement &meas, const ImuPos &imuPos, const std::string &nameId)
Adds a inertial measurement to the relative motion increments.
bool _lockIntegrationFrame
Wether to lock the integration frame.
Eigen::Matrix3d _pVel_pOmega
Partial derivative of the velocity increment after the angular rate bias.
void reset()
Clears all internal data.
Eigen::Matrix3d _pPos_pOmega
Partial derivative of the position increment after the angular rate bias.
Eigen::Matrix9d _covMatrix
Incremental covariance matrix (3x attitude, 3x velocity, 3x position)
InertialPreIntegrator()=default
Default Constructor.
IntegrationFrame _integrationFrame
Frame to integrate the observations in.
GenericMeasurement< double > Measurement
Inertial measurements.
Eigen::Vector3d _positionIncrement
Relative motion increment for the position.
IntegrationFrame
Available Integration Frames.
@ NED
Local North-East-Down frame.
@ ECEF
Earth-Centered Earth-Fixed frame.
Eigen::Quaterniond _attitudeIncrement
Relative motion increment for the attitude bi_q_bj.
Eigen::Matrix3d _pVel_pAccel
Partial derivative of the velocity increment after the acceleration bias.
void setImuNoiseScaleMatrix(const Eigen::Matrix6d &W)
Set the IMU Noise Scale Matrix.
ImuState< double > _imuState
IMU state used to calculate the increments.
IntegrationFrame getIntegrationFrame() const
Returns the selected integration frame.
Eigen::Matrix3d _pPos_pAccel
Partial derivative of the position increment after the acceleration bias.
GravitationModel _gravitationModel
Gravity Model to use.
Eigen::Vector3d _velocityIncrement
Relative motion increment for the velocity.
static float windowFontRatio()
Ratio to multiply for GUI window elements.
Matrix< double, 6, 6 > Matrix6d
Double 6x6 Eigen::Matrix.
Matrix< double, 9, 9 > Matrix9d
Double 9x9 Eigen::Matrix.
Eigen::Quaternion< typename Derived::Scalar > expMapQuat(const Eigen::MatrixBase< Derived > &v)
Calculates the quaternionic exponential map of the given vector.
Eigen::Matrix3< typename Derived::Scalar > J_r(const Eigen::MatrixBase< Derived > &phi)
Calculates the right Jacobian of SO(3) which relates additive increments in the tangent space to mult...
Eigen::Matrix< typename Derived::Scalar, 3, 3 > skewSymmetricMatrix(const Eigen::MatrixBase< Derived > &a)
Calculates the skew symmetric matrix of the given vector. This is needed to perform the cross product...
bool InertialPreIntegratorGui(const char *label, InertialPreIntegrator &integrator, float width)
Shows a GUI for advanced configuration of the InertialPreIntegrator.
void to_json(json &j, const Node &node)
Converts the provided node into a json object.
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
bool ComboGravitationModel(const char *label, GravitationModel &gravitationModel)
Shows a ComboBox to select the gravitation model.
void from_json(const json &j, Node &node)
Converts the provided json object into a node object.
ImuMeasurement meas
IMU measurement.
ImuState< T > imu
IMU state.
Eigen::Vector3d p_angularRate
Angular rate in platform frame coordinates in [rad/s].
double dt
Time since previous observation in [s].
Eigen::Vector3d p_acceleration
Acceleration in platform frame coordinates in [m/s^2].
Eigen::Vector3< T > p_biasAngularRate
Angular rate bias in platform frame coordinates in [rad/s].
Eigen::Vector3< T > p_biasAcceleration
Acceleration bias in platform frame coordinates in [m/s^2].