diff --git a/include/core/processor/motion_buffer.h b/include/core/processor/motion_buffer.h index 6809c92eedd000c803961b3b8629920e17c5b449..9d7ae613ffa3d5e065c0fe96b319a78d1441c2ae 100644 --- a/include/core/processor/motion_buffer.h +++ b/include/core/processor/motion_buffer.h @@ -74,9 +74,7 @@ struct Motion */ class MotionBuffer{ public: - SizeEigen data_size_, delta_size_, cov_size_; - MotionBuffer() = delete; - MotionBuffer(SizeEigen _data_size, SizeEigen _delta_size, SizeEigen _cov_size); + MotionBuffer() ; std::list<Motion>& get(); const std::list<Motion>& get() const; const Motion& getMotion(const TimeStamp& _ts) const; diff --git a/src/capture/capture_motion.cpp b/src/capture/capture_motion.cpp index 9f1e2216665806f7c7ac51b53928f4ea0cd19016..90b282f2a5e5fdba4bcfd9fc209b8ff9f2c11e7e 100644 --- a/src/capture/capture_motion.cpp +++ b/src/capture/capture_motion.cpp @@ -20,7 +20,7 @@ CaptureMotion::CaptureMotion(const std::string & _type, CaptureBase(_type, _ts, _sensor_ptr), data_(_data), data_cov_(_sensor_ptr ? _sensor_ptr->getNoiseCov() : Eigen::MatrixXs::Zero(_data.rows(), _data.rows())), // Someone should test this zero and do something smart accordingly - buffer_(_data.size(), _delta_size, _delta_cov_size), + buffer_(), origin_frame_ptr_(_origin_frame_ptr) { // @@ -40,7 +40,7 @@ CaptureMotion::CaptureMotion(const std::string & _type, CaptureBase(_type, _ts, _sensor_ptr, _p_ptr, _o_ptr, _intr_ptr), data_(_data), data_cov_(_data_cov), - buffer_(_data.size(), _delta_size, _delta_cov_size), + buffer_(), origin_frame_ptr_(_origin_frame_ptr) { // diff --git a/src/processor/motion_buffer.cpp b/src/processor/motion_buffer.cpp index 635004edd7dfd33854acc33cdb7c69ba51263ad9..1a4aa63e0179e4bf859c890246b70d04c2e9fb27 100644 --- a/src/processor/motion_buffer.cpp +++ b/src/processor/motion_buffer.cpp @@ -62,12 +62,7 @@ void Motion::resize(SizeEigen _data_s, SizeEigen _delta_s, SizeEigen _delta_cov_ //////////////////////////////////////////////////////////////////////////////////////// -MotionBuffer::MotionBuffer(SizeEigen _data_size, - SizeEigen _delta_size, - SizeEigen _cov_size) : - data_size_(_data_size), - delta_size_(_delta_size), - cov_size_(_cov_size) +MotionBuffer::MotionBuffer() { container_.clear(); } diff --git a/test/gtest_motion_buffer.cpp b/test/gtest_motion_buffer.cpp index af262f1170bdcfffa0c633e858cebc5d9fc41562..e8d572d73a908af0b1df7a6d5fa455e6f3f266c9 100644 --- a/test/gtest_motion_buffer.cpp +++ b/test/gtest_motion_buffer.cpp @@ -40,7 +40,7 @@ Motion m4 = newMotion(t4, 4, 10, 1, .1, 1); TEST(MotionBuffer, QueryTimeStamps) { - MotionBuffer MB(1,1,1); + MotionBuffer MB; MB.get().push_back(m0); MB.get().push_back(m1); @@ -64,7 +64,7 @@ TEST(MotionBuffer, QueryTimeStamps) TEST(MotionBuffer, getMotion) { - MotionBuffer MB(1,1,1); + MotionBuffer MB; MB.get().push_back(m0); ASSERT_EQ(MB.getMotion(t0).delta_, m0.delta_); @@ -78,7 +78,7 @@ TEST(MotionBuffer, getMotion) TEST(MotionBuffer, getDelta) { - MotionBuffer MB(1,1,1); + MotionBuffer MB; MB.get().push_back(m0); @@ -92,7 +92,7 @@ TEST(MotionBuffer, getDelta) TEST(MotionBuffer, Split) { - MotionBuffer MB(1,1,1); + MotionBuffer MB; MB.get().push_back(m0); MB.get().push_back(m1); @@ -100,7 +100,7 @@ TEST(MotionBuffer, Split) MB.get().push_back(m3); MB.get().push_back(m4); // put 5 motions - MotionBuffer MB_old(1,1,1); + MotionBuffer MB_old; TimeStamp t = 1.5; // between m1 and m2 MB.split(t, MB_old); @@ -116,7 +116,7 @@ TEST(MotionBuffer, Split) // TEST(MotionBuffer, integrateCovariance) // { -// MotionBuffer MB(1,1,1,0); +// MotionBuffer MB; // // MB.get().push_back(m0); // MB.get().push_back(m1); @@ -131,7 +131,7 @@ TEST(MotionBuffer, Split) // // TEST(MotionBuffer, integrateCovariance_ts) // { -// MotionBuffer MB(1,1,1,0); +// MotionBuffer MB; // // MB.get().push_back(m0); // MB.get().push_back(m1); @@ -145,7 +145,7 @@ TEST(MotionBuffer, Split) // // TEST(MotionBuffer, integrateCovariance_ti_tf) // { -// MotionBuffer MB(1,1,1,0); +// MotionBuffer MB; // // MB.get().push_back(m0); // MB.get().push_back(m1); @@ -162,7 +162,7 @@ TEST(MotionBuffer, Split) TEST(MotionBuffer, print) { - MotionBuffer MB(1,1,1); + MotionBuffer MB; MB.get().push_back(m0); MB.get().push_back(m1);