diff --git a/include/imu/processor/processor_imu.h b/include/imu/processor/processor_imu.h index 6a9855ec3c0b2f3fbb9ff103472e3c4168cb5520..080fb3dcb51017f1c065a586acd04bb683b28c80 100644 --- a/include/imu/processor/processor_imu.h +++ b/include/imu/processor/processor_imu.h @@ -149,7 +149,7 @@ class ProcessorImu : public ProcessorMotion{ protected: ParamsProcessorImuPtr params_motion_Imu_; - std::list<FactorBasePtr> list_fac_inactive_bootstrap_; ///< List of all IMU factors created while IMU is bootstrapping + std::list<FactorBasePtr> bootstrap_factor_list_; ///< List of all IMU factors created while IMU is bootstrapping }; } diff --git a/src/processor/processor_imu.cpp b/src/processor/processor_imu.cpp index 6caa60c5e4a3a32d79318841a25a1aa05c823086..2fe42636bf35da2a9b285e1214542e2941777d70 100644 --- a/src/processor/processor_imu.cpp +++ b/src/processor/processor_imu.cpp @@ -34,7 +34,7 @@ ProcessorImu::ProcessorImu(ParamsProcessorImuPtr _params_motion_imu) : params_motion_Imu_(_params_motion_imu) { bootstrapping_ = params_motion_Imu_->bootstrap_enable; - list_fac_inactive_bootstrap_.clear(); + bootstrap_factor_list_.clear(); } ProcessorImu::~ProcessorImu() @@ -126,7 +126,7 @@ FactorBasePtr ProcessorImu::emplaceFactor(FeatureBasePtr _feature_motion, Captur if (bootstrapping_) { fac_imu->setStatus(FAC_INACTIVE); - list_fac_inactive_bootstrap_.push_back(fac_imu); + bootstrap_factor_list_.push_back(fac_imu); } return fac_imu; @@ -276,12 +276,12 @@ void ProcessorImu::bootstrap() VectorXd delta_int = bootstrapDelta(); // compute local g and transformation to global g - double dt = t_current - first_capture->getTimeStamp(); // - const auto& dv = delta_int.segment(7, 3); // - Vector3d g_l = -(q_l_s * dv / dt); // See eq. (20) - const auto& g_w = gravity(); // - const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin - Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); // + double dt = t_current - first_capture->getTimeStamp(); // + const auto& dv = delta_int.segment(7, 3); // + Vector3d g_l = -(q_l_s * dv / dt); // See eq. (20) + const auto& g_w = gravity(); // + const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin + Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); // transfo_w_l.at('P') = p_w_l; // transfo_w_l.at('O') = q_w_l.coeffs(); // @@ -300,10 +300,10 @@ void ProcessorImu::bootstrap() // - zero-displaecement odom3d factors (between KFs) // Activate factors that were inactive during bootstrap - while (not list_fac_inactive_bootstrap_.empty()) + while (not bootstrap_factor_list_.empty()) { - list_fac_inactive_bootstrap_.front()->setStatus(FAC_ACTIVE); - list_fac_inactive_bootstrap_.pop_front(); + bootstrap_factor_list_.front()->setStatus(FAC_ACTIVE); + bootstrap_factor_list_.pop_front(); } // Clear bootstrapping flag. This marks the end of the bootstrapping process @@ -325,12 +325,12 @@ void ProcessorImu::bootstrap() VectorXd delta_int = bootstrapDelta(); // compute local g and transformation to global g - double dt = t_current - first_capture->getTimeStamp(); // - const auto& dv_l = delta_int.segment(7, 3); // - Vector3d g_l = -(q_l_s * dv_l / dt); // See eq. (20) - const auto& g_w = gravity(); // - const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin - Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); // + double dt = t_current - first_capture->getTimeStamp(); // + const auto& dv_l = delta_int.segment(7, 3); // + Vector3d g_l = -(q_l_s * dv_l / dt); // See eq. (20) + const auto& g_w = gravity(); // + const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin + Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); // transfo_w_l.at('P') = p_w_l; // transfo_w_l.at('O') = q_w_l.coeffs(); // @@ -345,10 +345,10 @@ void ProcessorImu::bootstrap() } // Activate factors that were inactive during bootstrap - while (not list_fac_inactive_bootstrap_.empty()) + while (not bootstrap_factor_list_.empty()) { - list_fac_inactive_bootstrap_.front()->setStatus(FAC_ACTIVE); - list_fac_inactive_bootstrap_.pop_front(); + bootstrap_factor_list_.front()->setStatus(FAC_ACTIVE); + bootstrap_factor_list_.pop_front(); } // Clear bootstrapping flag. This marks the end of the bootstrapping process @@ -380,10 +380,10 @@ void ProcessorImu::bootstrapEnable(bool _bootstrap_enable) CaptureBasePtr ProcessorImu::bootstrapOrigin() const { - if (list_fac_inactive_bootstrap_.empty()) + if (bootstrap_factor_list_.empty()) return origin_ptr_; else - return std::static_pointer_cast<CaptureMotion>(list_fac_inactive_bootstrap_.front()->getCapture()) + return std::static_pointer_cast<CaptureMotion>(bootstrap_factor_list_.front()->getCapture()) ->getOriginCapture(); } @@ -393,7 +393,7 @@ VectorXd ProcessorImu::bootstrapDelta() const // first, integrate all deltas in previous factors VectorXd delta_int = deltaZero(); double dt; - for (const auto& fac : list_fac_inactive_bootstrap_) + for (const auto& fac : bootstrap_factor_list_) // here, we take advantage of the list of IMU factors to recover all deltas { dt = fac->getCapture()->getTimeStamp() - fac->getCaptureOther()->getTimeStamp(); @@ -416,7 +416,7 @@ bool ProcessorImu::recomputeStates() const std::static_pointer_cast<const ProcessorMotion>(shared_from_this()))) { WOLF_DEBUG("Recomputing IMU keyframe states..."); - for (const auto& fac : list_fac_inactive_bootstrap_) + for (const auto& fac : bootstrap_factor_list_) { const auto& ftr = fac->getFeature(); const auto& cap = std::static_pointer_cast<CaptureMotion>(ftr->getCapture());