From 5395080f255c37dd9518bdb5a14995df5bd81446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Fri, 26 Jan 2018 13:02:28 +0100 Subject: [PATCH] Rename FeatureFix -> FeaturePose --- src/CMakeLists.txt | 4 ++-- src/examples/test_analytic_odom_constraint.cpp | 4 ++-- src/examples/test_wolf_autodiffwrapper.cpp | 4 ++-- src/examples/test_wolf_imported_graph.cpp | 4 ++-- src/examples/test_wolf_prunning.cpp | 4 ++-- src/feature_fix.cpp | 17 ----------------- src/feature_pose.cpp | 17 +++++++++++++++++ src/{feature_fix.h => feature_pose.h} | 14 +++++++------- src/test/gtest_constraint_absolute.cpp | 12 ++++++------ 9 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 src/feature_fix.cpp create mode 100644 src/feature_pose.cpp rename src/{feature_fix.h => feature_pose.h} (55%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c15217fa4..22d70f19a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -259,9 +259,9 @@ SET(HDRS feature_gps_fix.h feature_gps_pseudorange.h feature_imu.h - feature_fix.h feature_odom_2D.h feature_polyline_2D.h + feature_pose.h landmark_corner_2D.h landmark_container.h landmark_line_2D.h @@ -332,9 +332,9 @@ SET(SRCS feature_gps_fix.cpp feature_gps_pseudorange.cpp feature_imu.cpp - feature_fix.cpp feature_odom_2D.cpp feature_polyline_2D.cpp + feature_pose.cpp landmark_corner_2D.cpp landmark_container.cpp landmark_line_2D.cpp diff --git a/src/examples/test_analytic_odom_constraint.cpp b/src/examples/test_analytic_odom_constraint.cpp index 93fb031c5..029b0280b 100644 --- a/src/examples/test_analytic_odom_constraint.cpp +++ b/src/examples/test_analytic_odom_constraint.cpp @@ -238,7 +238,7 @@ int main(int argc, char** argv) bNum.clear(); // add capture, feature and constraint to problem - FeatureBasePtr feature_ptr_autodiff = new FeatureBase("FIX", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_autodiff = new FeatureBase("POSE", edge_vector, edge_information.inverse()); CaptureVoid* capture_ptr_autodiff = new CaptureVoid(TimeStamp(0), sensor); assert(index_2_frame_ptr_autodiff.find(edge_old) != index_2_frame_ptr_autodiff.end() && "edge from vertex not added!"); FrameBasePtr frame_old_ptr_autodiff = index_2_frame_ptr_autodiff[edge_old]; @@ -251,7 +251,7 @@ int main(int argc, char** argv) //std::cout << "Added autodiff edge! " << constraint_ptr_autodiff->id() << " from vertex " << constraint_ptr_autodiff->getCapturePtr()->getFramePtr()->id() << " to " << constraint_ptr_autodiff->getFrameOtherPtr()->id() << std::endl; // add capture, feature and constraint to problem - FeatureBasePtr feature_ptr_analytic = new FeatureBase("FIX", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_analytic = new FeatureBase("POSE", edge_vector, edge_information.inverse()); CaptureVoid* capture_ptr_analytic = new CaptureVoid(TimeStamp(0), sensor); assert(index_2_frame_ptr_analytic.find(edge_old) != index_2_frame_ptr_analytic.end() && "edge from vertex not added!"); FrameBasePtr frame_old_ptr_analytic = index_2_frame_ptr_analytic[edge_old]; diff --git a/src/examples/test_wolf_autodiffwrapper.cpp b/src/examples/test_wolf_autodiffwrapper.cpp index 318f085ab..5728739a8 100644 --- a/src/examples/test_wolf_autodiffwrapper.cpp +++ b/src/examples/test_wolf_autodiffwrapper.cpp @@ -225,8 +225,8 @@ int main(int argc, char** argv) bNum.clear(); // add capture, feature and constraint to problem - FeatureBasePtr feature_ptr_ceres_diff = new FeatureBase("FIX", edge_vector, edge_information.inverse()); - FeatureBasePtr feature_ptr_wolf_diff = new FeatureBase("FIX", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_ceres_diff = new FeatureBase("POSE", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_wolf_diff = new FeatureBase("POSE", edge_vector, edge_information.inverse()); CaptureVoid* capture_ptr_ceres_diff = new CaptureVoid(TimeStamp(0), sensor); CaptureVoid* capture_ptr_wolf_diff = new CaptureVoid(TimeStamp(0), sensor); assert(index_2_frame_ptr_ceres_diff.find(edge_old) != index_2_frame_ptr_ceres_diff.end() && "edge from vertex not added!"); diff --git a/src/examples/test_wolf_imported_graph.cpp b/src/examples/test_wolf_imported_graph.cpp index baa9cc7ce..fc8129dc5 100644 --- a/src/examples/test_wolf_imported_graph.cpp +++ b/src/examples/test_wolf_imported_graph.cpp @@ -246,8 +246,8 @@ int main(int argc, char** argv) bNum.clear(); // add capture, feature and constraint to problem - FeatureBasePtr feature_ptr_full = new FeatureBase("FIX", edge_vector, edge_information.inverse()); - FeatureBasePtr feature_ptr_prun = new FeatureBase("FIX", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_full = new FeatureBase("POSE", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_prun = new FeatureBase("POSE", edge_vector, edge_information.inverse()); CaptureVoid* capture_ptr_full = new CaptureVoid(TimeStamp(0), sensor); CaptureVoid* capture_ptr_prun = new CaptureVoid(TimeStamp(0), sensor); assert(index_2_frame_ptr_full.find(edge_old) != index_2_frame_ptr_full.end() && "edge from vertex not added!"); diff --git a/src/examples/test_wolf_prunning.cpp b/src/examples/test_wolf_prunning.cpp index 92fcc6d98..3191326c0 100644 --- a/src/examples/test_wolf_prunning.cpp +++ b/src/examples/test_wolf_prunning.cpp @@ -263,8 +263,8 @@ int main(int argc, char** argv) //std::cout << "Adding edge... " << std::endl; // add capture, feature and constraint to problem - FeatureBasePtr feature_ptr_full = new FeatureBase("FIX", edge_vector, edge_information.inverse()); - FeatureBasePtr feature_ptr_prun = new FeatureBase("FIX", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_full = new FeatureBase("POSE", edge_vector, edge_information.inverse()); + FeatureBasePtr feature_ptr_prun = new FeatureBase("POSE", edge_vector, edge_information.inverse()); CaptureVoid* capture_ptr_full = new CaptureVoid(TimeStamp(0), sensor); CaptureVoid* capture_ptr_prun = new CaptureVoid(TimeStamp(0), sensor); assert(index_2_frame_ptr_full.find(edge_old) != index_2_frame_ptr_full.end() && "edge from vertex not added!"); diff --git a/src/feature_fix.cpp b/src/feature_fix.cpp deleted file mode 100644 index 5497695a4..000000000 --- a/src/feature_fix.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "feature_fix.h" - - -namespace wolf { - -FeatureFix::FeatureFix(const Eigen::VectorXs& _measurement, const Eigen::MatrixXs& _meas_covariance) : - FeatureBase("FIX", _measurement, _meas_covariance) -{ - // -} - -FeatureFix::~FeatureFix() -{ - // -} - -} // namespace wolf diff --git a/src/feature_pose.cpp b/src/feature_pose.cpp new file mode 100644 index 000000000..35193d2b0 --- /dev/null +++ b/src/feature_pose.cpp @@ -0,0 +1,17 @@ +#include "feature_pose.h" + + +namespace wolf { + +FeaturePose::FeaturePose(const Eigen::VectorXs& _measurement, const Eigen::MatrixXs& _meas_covariance) : + FeatureBase("POSE", _measurement, _meas_covariance) +{ + // +} + +FeaturePose::~FeaturePose() +{ + // +} + +} // namespace wolf diff --git a/src/feature_fix.h b/src/feature_pose.h similarity index 55% rename from src/feature_fix.h rename to src/feature_pose.h index d7649bcc3..f4d7ba061 100644 --- a/src/feature_fix.h +++ b/src/feature_pose.h @@ -1,5 +1,5 @@ -#ifndef FEATURE_FIX_H_ -#define FEATURE_FIX_H_ +#ifndef FEATURE_POSE_H_ +#define FEATURE_POSE_H_ //Wolf includes @@ -10,10 +10,10 @@ namespace wolf { -WOLF_PTR_TYPEDEFS(FeatureFix); +WOLF_PTR_TYPEDEFS(FeaturePose); -//class FeatureFix -class FeatureFix : public FeatureBase +//class FeaturePose +class FeaturePose : public FeatureBase { public: @@ -23,8 +23,8 @@ class FeatureFix : public FeatureBase * \param _meas_covariance the noise of the measurement * */ - FeatureFix(const Eigen::VectorXs& _measurement, const Eigen::MatrixXs& _meas_covariance); - virtual ~FeatureFix(); + FeaturePose(const Eigen::VectorXs& _measurement, const Eigen::MatrixXs& _meas_covariance); + virtual ~FeaturePose(); }; } // namespace wolf diff --git a/src/test/gtest_constraint_absolute.cpp b/src/test/gtest_constraint_absolute.cpp index 0f190fef2..52adcd099 100644 --- a/src/test/gtest_constraint_absolute.cpp +++ b/src/test/gtest_constraint_absolute.cpp @@ -51,7 +51,7 @@ CaptureBasePtr cap0 = frm0->addCapture(std::make_shared<CaptureMotion>(0, nullpt TEST(ConstraintBlockAbs, ctr_block_abs_p_check) { - FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("FIX", pose10.head<3>(), data_cov.topLeftCorner<3,3>())); + FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("POSE", pose10.head<3>(), data_cov.topLeftCorner<3,3>())); ConstraintBlockAbsolutePtr ctr0 = std::static_pointer_cast<ConstraintBlockAbsolute>( fea0->addConstraint(std::make_shared<ConstraintBlockAbsolute>(fea0->getFramePtr()->getPPtr())) ); @@ -60,7 +60,7 @@ TEST(ConstraintBlockAbs, ctr_block_abs_p_check) TEST(ConstraintBlockAbs, ctr_block_abs_p_solve) { - FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("FIX", pose10.head<3>(), data_cov.topLeftCorner<3,3>())); + FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("POSE", pose10.head<3>(), data_cov.topLeftCorner<3,3>())); ConstraintBlockAbsolutePtr ctr0 = std::static_pointer_cast<ConstraintBlockAbsolute>( fea0->addConstraint(std::make_shared<ConstraintBlockAbsolute>(fea0->getFramePtr()->getPPtr())) ); @@ -78,7 +78,7 @@ TEST(ConstraintBlockAbs, ctr_block_abs_p_solve) TEST(ConstraintBlockAbs, ctr_block_abs_v_check) { - FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("FIX", pose10.tail<3>(), data_cov.bottomRightCorner<3,3>())); + FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("POSE", pose10.tail<3>(), data_cov.bottomRightCorner<3,3>())); ConstraintBlockAbsolutePtr ctr0 = std::static_pointer_cast<ConstraintBlockAbsolute>( fea0->addConstraint(std::make_shared<ConstraintBlockAbsolute>(fea0->getFramePtr()->getVPtr())) ); @@ -87,7 +87,7 @@ TEST(ConstraintBlockAbs, ctr_block_abs_v_check) TEST(ConstraintBlockAbs, ctr_block_abs_v_solve) { - FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("FIX", pose10.tail<3>(), data_cov.bottomRightCorner<3,3>())); + FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("POSE", pose10.tail<3>(), data_cov.bottomRightCorner<3,3>())); ConstraintBlockAbsolutePtr ctr0 = std::static_pointer_cast<ConstraintBlockAbsolute>( fea0->addConstraint(std::make_shared<ConstraintBlockAbsolute>(fea0->getFramePtr()->getVPtr())) ); @@ -105,7 +105,7 @@ TEST(ConstraintBlockAbs, ctr_block_abs_v_solve) TEST(ConstraintQuatAbs, ctr_block_abs_o_check) { - FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("FIX", pose10.segment<4>(3), data_cov.block<3,3>(3,3))); + FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("POSE", pose10.segment<4>(3), data_cov.block<3,3>(3,3))); ConstraintBlockAbsolutePtr ctr0 = std::static_pointer_cast<ConstraintBlockAbsolute>( fea0->addConstraint(std::make_shared<ConstraintQuaternionAbsolute>(fea0->getFramePtr()->getOPtr())) ); @@ -114,7 +114,7 @@ TEST(ConstraintQuatAbs, ctr_block_abs_o_check) TEST(ConstraintQuatAbs, ctr_block_abs_o_solve) { - FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("FIX", pose10.segment<4>(3), data_cov.block<3,3>(3,3))); + FeatureBasePtr fea0 = cap0->addFeature(std::make_shared<FeatureBase>("POSE", pose10.segment<4>(3), data_cov.block<3,3>(3,3))); ConstraintBlockAbsolutePtr ctr0 = std::static_pointer_cast<ConstraintBlockAbsolute>( fea0->addConstraint(std::make_shared<ConstraintQuaternionAbsolute>(fea0->getFramePtr()->getOPtr())) ); -- GitLab