From cb97b671e5d8900359648d74ed108cc73c298b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Wed, 14 Aug 2019 10:21:35 +0200 Subject: [PATCH] remove unused sizes in MotionBuffer --- include/core/processor/motion_buffer.h | 4 +--- src/capture/capture_motion.cpp | 4 ++-- src/processor/motion_buffer.cpp | 7 +------ test/gtest_motion_buffer.cpp | 18 +++++++++--------- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/include/core/processor/motion_buffer.h b/include/core/processor/motion_buffer.h index 6809c92ee..9d7ae613f 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 9f1e22166..90b282f2a 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 635004edd..1a4aa63e0 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 af262f117..e8d572d73 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); -- GitLab