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

Update gtest_processor_motion_intrinsics_update.cpp

parent 46f21215
No related branches found
No related tags found
3 merge requests!39release after RAL,!38After 2nd RAL submission,!26Motion intrinsics update gtest
......@@ -66,7 +66,6 @@ class ProcessorImuTest : public testing::Test
// params and processor
params_ = std::make_shared<ParamsProcessorImu>();
params_->voting_active = true;
params_->voting_aux_active = false;
params_->max_time_span = 0.9999; // create one KF every second
params_->max_buff_length = 1000000000;
params_->dist_traveled = 100000000000;
......@@ -150,8 +149,12 @@ TEST_F(ProcessorImuTest, test1)
}
/**
* SET TO TRUE TO PRODUCE CSV FILE
* SET TO FALSE TO STOP PRODUCING CSV FILE
*/
#define WRITE_CSV_FILE false
//#define WRITE_CSV_FILE // COMMENT OUT THIS LINE TO AVOID PRODUCING CSV FILE
TEST_F(ProcessorImuTest, getState)
{
Matrix6d data_cov; data_cov. setIdentity();
......@@ -166,7 +169,7 @@ TEST_F(ProcessorImuTest, getState)
double dt(0.1);
int nb_kf = 1;
#ifdef WRITE_CSV_FILE
#if WRITE_CSV_FILE
std::fstream file_est;
file_est.open("./est.csv", std::fstream::out);
// std::string header_est = "t,px,py,pz,qx,qy,qz,qw,vx,vy,vz,bax_est,bax_preint\n";
......@@ -182,7 +185,7 @@ TEST_F(ProcessorImuTest, getState)
std::cout << "t " << t << "; cap id " << sensor_->findLastCaptureBefore(t) << "; cap ts " << sensor_->findLastCaptureBefore(t)->getTimeStamp() << std::endl;
#ifdef WRITE_CSV_FILE
#if WRITE_CSV_FILE
// pre-solve print to CSV
VectorComposite state = problem_->getState(t);
VectorXd calib_estim = sensor_->getIntrinsic(t)->getState();
......@@ -205,7 +208,7 @@ TEST_F(ProcessorImuTest, getState)
nb_kf = problem_->getTrajectory()->getFrameMap().size();
#ifdef WRITE_CSV_FILE
#if WRITE_CSV_FILE
// post-solve print to CSV with time-stamp shifted by dt/2 to separate from pre-solve result
state = problem_->getState(t);
calib_estim = sensor_->getIntrinsic(t)->getState();
......@@ -221,7 +224,7 @@ TEST_F(ProcessorImuTest, getState)
t += dt;
}
#ifdef WRITE_CSV_FILE
#if WRITE_CSV_FILE
file_est.close();
#endif
}
......
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