Skip to content
Snippets Groups Projects
Commit e8ea17f8 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

compiling and tests ok

parent 5fed25a8
No related branches found
No related tags found
3 merge requests!39release after RAL,!38After 2nd RAL submission,!3Resolve "Adapt to emplace API"
...@@ -12,8 +12,6 @@ FeatureIMU::FeatureIMU(const Eigen::VectorXs& _delta_preintegrated, ...@@ -12,8 +12,6 @@ FeatureIMU::FeatureIMU(const Eigen::VectorXs& _delta_preintegrated,
gyro_bias_preint_(_bias.tail<3>()), gyro_bias_preint_(_bias.tail<3>()),
jacobian_bias_(_dD_db_jacobians) jacobian_bias_(_dD_db_jacobians)
{ {
if (_cap_imu_ptr)
this->setCapture(_cap_imu_ptr);
} }
FeatureIMU::FeatureIMU(CaptureMotionPtr _cap_imu_ptr): FeatureIMU::FeatureIMU(CaptureMotionPtr _cap_imu_ptr):
...@@ -22,7 +20,6 @@ FeatureIMU::FeatureIMU(CaptureMotionPtr _cap_imu_ptr): ...@@ -22,7 +20,6 @@ FeatureIMU::FeatureIMU(CaptureMotionPtr _cap_imu_ptr):
gyro_bias_preint_(_cap_imu_ptr->getCalibrationPreint().tail<3>()), gyro_bias_preint_(_cap_imu_ptr->getCalibrationPreint().tail<3>()),
jacobian_bias_(_cap_imu_ptr->getJacobianCalib()) jacobian_bias_(_cap_imu_ptr->getJacobianCalib())
{ {
this->setCapture(_cap_imu_ptr);
} }
FeatureIMU::~FeatureIMU() FeatureIMU::~FeatureIMU()
......
...@@ -58,10 +58,15 @@ class FeatureIMU_test : public testing::Test ...@@ -58,10 +58,15 @@ class FeatureIMU_test : public testing::Test
MatrixXs P0; P0.setIdentity(9,9); MatrixXs P0; P0.setIdentity(9,9);
origin_frame = problem->setPrior(x0, P0, 0.0, 0.01); origin_frame = problem->setPrior(x0, P0, 0.0, 0.01);
// Create one capture to store the IMU data arriving from (sensor / callback / file / etc.) // Emplace one capture to store the IMU data arriving from (sensor / callback / file / etc.)
// give the capture a big covariance, otherwise it will be so small that it won't pass following assertions // give the capture a big covariance, otherwise it will be so small that it won't pass following assertions
imu_ptr = std::make_shared<CaptureIMU>(t, sensor_ptr, data_, Eigen::Matrix6s::Identity(), Eigen::Vector6s::Zero()); imu_ptr = std::static_pointer_cast<CaptureIMU>(
imu_ptr->setFrame(origin_frame); //to get ptr to Frm in processorIMU and then get biases CaptureBase::emplace<CaptureIMU>(origin_frame,
t,
sensor_ptr,
data_,
Eigen::Matrix6s::Identity(),
Eigen::Vector6s::Zero()) );
//process data //process data
data_ << 2, 0, 9.8, 0, 0, 0; data_ << 2, 0, 9.8, 0, 0, 0;
...@@ -74,23 +79,23 @@ class FeatureIMU_test : public testing::Test ...@@ -74,23 +79,23 @@ class FeatureIMU_test : public testing::Test
// process data in capture // process data in capture
sensor_ptr->process(imu_ptr); sensor_ptr->process(imu_ptr);
//create Frame //emplace Frame
ts = problem->getProcessorMotion()->getBuffer().get().back().ts_; ts = problem->getProcessorMotion()->getBuffer().get().back().ts_;
state_vec = problem->getProcessorMotion()->getCurrentState(); state_vec = problem->getProcessorMotion()->getCurrentState();
last_frame = problem->emplaceFrame(KEY, state_vec, ts); last_frame = problem->emplaceFrame(KEY, state_vec, ts);
//create a feature //emplace a feature
delta_preint = problem->getProcessorMotion()->getMotion().delta_integr_; delta_preint = problem->getProcessorMotion()->getMotion().delta_integr_;
delta_preint_cov = problem->getProcessorMotion()->getMotion().delta_integr_cov_ + MatrixXs::Identity(9,9)*1e-08; delta_preint_cov = problem->getProcessorMotion()->getMotion().delta_integr_cov_ + MatrixXs::Identity(9,9)*1e-08;
VectorXs calib_preint = problem->getProcessorMotion()->getBuffer().getCalibrationPreint(); VectorXs calib_preint = problem->getProcessorMotion()->getBuffer().getCalibrationPreint();
dD_db_jacobians = problem->getProcessorMotion()->getMotion().jacobian_calib_; dD_db_jacobians = problem->getProcessorMotion()->getMotion().jacobian_calib_;
feat_imu = std::make_shared<FeatureIMU>(delta_preint, feat_imu = std::static_pointer_cast<FeatureIMU>(
delta_preint_cov, FeatureBase::emplace<FeatureIMU>(imu_ptr,
calib_preint, delta_preint,
dD_db_jacobians, delta_preint_cov,
imu_ptr); calib_preint,
feat_imu->setCapture(imu_ptr); //associate the feature to a capture dD_db_jacobians,
imu_ptr) );
} }
virtual void TearDown() virtual void TearDown()
......
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