Skip to content
Snippets Groups Projects
Commit 55e2a639 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Rename list_fac_inactive_bootstrap_ --> bootstrap_factor_list_

parent 2e8c29ca
No related branches found
No related tags found
1 merge request!54devel->main
...@@ -149,7 +149,7 @@ class ProcessorImu : public ProcessorMotion{ ...@@ -149,7 +149,7 @@ class ProcessorImu : public ProcessorMotion{
protected: protected:
ParamsProcessorImuPtr params_motion_Imu_; 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
}; };
} }
......
...@@ -34,7 +34,7 @@ ProcessorImu::ProcessorImu(ParamsProcessorImuPtr _params_motion_imu) : ...@@ -34,7 +34,7 @@ ProcessorImu::ProcessorImu(ParamsProcessorImuPtr _params_motion_imu) :
params_motion_Imu_(_params_motion_imu) params_motion_Imu_(_params_motion_imu)
{ {
bootstrapping_ = params_motion_Imu_->bootstrap_enable; bootstrapping_ = params_motion_Imu_->bootstrap_enable;
list_fac_inactive_bootstrap_.clear(); bootstrap_factor_list_.clear();
} }
ProcessorImu::~ProcessorImu() ProcessorImu::~ProcessorImu()
...@@ -126,7 +126,7 @@ FactorBasePtr ProcessorImu::emplaceFactor(FeatureBasePtr _feature_motion, Captur ...@@ -126,7 +126,7 @@ FactorBasePtr ProcessorImu::emplaceFactor(FeatureBasePtr _feature_motion, Captur
if (bootstrapping_) if (bootstrapping_)
{ {
fac_imu->setStatus(FAC_INACTIVE); fac_imu->setStatus(FAC_INACTIVE);
list_fac_inactive_bootstrap_.push_back(fac_imu); bootstrap_factor_list_.push_back(fac_imu);
} }
return fac_imu; return fac_imu;
...@@ -276,12 +276,12 @@ void ProcessorImu::bootstrap() ...@@ -276,12 +276,12 @@ void ProcessorImu::bootstrap()
VectorXd delta_int = bootstrapDelta(); VectorXd delta_int = bootstrapDelta();
// compute local g and transformation to global g // compute local g and transformation to global g
double dt = t_current - first_capture->getTimeStamp(); // double dt = t_current - first_capture->getTimeStamp(); //
const auto& dv = delta_int.segment(7, 3); // const auto& dv = delta_int.segment(7, 3); //
Vector3d g_l = -(q_l_s * dv / dt); // See eq. (20) Vector3d g_l = -(q_l_s * dv / dt); // See eq. (20)
const auto& g_w = gravity(); // const auto& g_w = gravity(); //
const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin
Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); // Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); //
transfo_w_l.at('P') = p_w_l; // transfo_w_l.at('P') = p_w_l; //
transfo_w_l.at('O') = q_w_l.coeffs(); // transfo_w_l.at('O') = q_w_l.coeffs(); //
...@@ -300,10 +300,10 @@ void ProcessorImu::bootstrap() ...@@ -300,10 +300,10 @@ void ProcessorImu::bootstrap()
// - zero-displaecement odom3d factors (between KFs) // - zero-displaecement odom3d factors (between KFs)
// Activate factors that were inactive during 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); bootstrap_factor_list_.front()->setStatus(FAC_ACTIVE);
list_fac_inactive_bootstrap_.pop_front(); bootstrap_factor_list_.pop_front();
} }
// Clear bootstrapping flag. This marks the end of the bootstrapping process // Clear bootstrapping flag. This marks the end of the bootstrapping process
...@@ -325,12 +325,12 @@ void ProcessorImu::bootstrap() ...@@ -325,12 +325,12 @@ void ProcessorImu::bootstrap()
VectorXd delta_int = bootstrapDelta(); VectorXd delta_int = bootstrapDelta();
// compute local g and transformation to global g // compute local g and transformation to global g
double dt = t_current - first_capture->getTimeStamp(); // double dt = t_current - first_capture->getTimeStamp(); //
const auto& dv_l = delta_int.segment(7, 3); // const auto& dv_l = delta_int.segment(7, 3); //
Vector3d g_l = -(q_l_s * dv_l / dt); // See eq. (20) Vector3d g_l = -(q_l_s * dv_l / dt); // See eq. (20)
const auto& g_w = gravity(); // const auto& g_w = gravity(); //
const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin const auto& p_w_l = Vector3d::Zero(); // will pivot around the origin
Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); // Quaterniond q_w_l = Quaterniond::FromTwoVectors(g_l, g_w); //
transfo_w_l.at('P') = p_w_l; // transfo_w_l.at('P') = p_w_l; //
transfo_w_l.at('O') = q_w_l.coeffs(); // transfo_w_l.at('O') = q_w_l.coeffs(); //
...@@ -345,10 +345,10 @@ void ProcessorImu::bootstrap() ...@@ -345,10 +345,10 @@ void ProcessorImu::bootstrap()
} }
// Activate factors that were inactive during 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); bootstrap_factor_list_.front()->setStatus(FAC_ACTIVE);
list_fac_inactive_bootstrap_.pop_front(); bootstrap_factor_list_.pop_front();
} }
// Clear bootstrapping flag. This marks the end of the bootstrapping process // Clear bootstrapping flag. This marks the end of the bootstrapping process
...@@ -380,10 +380,10 @@ void ProcessorImu::bootstrapEnable(bool _bootstrap_enable) ...@@ -380,10 +380,10 @@ void ProcessorImu::bootstrapEnable(bool _bootstrap_enable)
CaptureBasePtr ProcessorImu::bootstrapOrigin() const CaptureBasePtr ProcessorImu::bootstrapOrigin() const
{ {
if (list_fac_inactive_bootstrap_.empty()) if (bootstrap_factor_list_.empty())
return origin_ptr_; return origin_ptr_;
else 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(); ->getOriginCapture();
} }
...@@ -393,7 +393,7 @@ VectorXd ProcessorImu::bootstrapDelta() const ...@@ -393,7 +393,7 @@ VectorXd ProcessorImu::bootstrapDelta() const
// first, integrate all deltas in previous factors // first, integrate all deltas in previous factors
VectorXd delta_int = deltaZero(); VectorXd delta_int = deltaZero();
double dt; 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 // here, we take advantage of the list of IMU factors to recover all deltas
{ {
dt = fac->getCapture()->getTimeStamp() - fac->getCaptureOther()->getTimeStamp(); dt = fac->getCapture()->getTimeStamp() - fac->getCaptureOther()->getTimeStamp();
...@@ -416,7 +416,7 @@ bool ProcessorImu::recomputeStates() const ...@@ -416,7 +416,7 @@ bool ProcessorImu::recomputeStates() const
std::static_pointer_cast<const ProcessorMotion>(shared_from_this()))) std::static_pointer_cast<const ProcessorMotion>(shared_from_this())))
{ {
WOLF_DEBUG("Recomputing IMU keyframe states..."); 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& ftr = fac->getFeature();
const auto& cap = std::static_pointer_cast<CaptureMotion>(ftr->getCapture()); const auto& cap = std::static_pointer_cast<CaptureMotion>(ftr->getCapture());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment