diff --git a/include/core/common/node_state_blocks.h b/include/core/common/node_state_blocks.h index 9dc0f134afb61c8eef96b522c291f68b00f4027a..b472e80211eb1c9111ca23c0f7b7bb3fa8897195 100644 --- a/include/core/common/node_state_blocks.h +++ b/include/core/common/node_state_blocks.h @@ -88,18 +88,16 @@ class NodeStateBlocks : public NodeBase, public std::enable_shared_from_this<Nod * \param _fixed If the new state is fixed (i.e. not estimated). **/ StateBlockPtr emplaceStateBlock(const char key, - const std::string& _type, - const Eigen::VectorXd& _vector, - const bool& _fixed); - /** \brief Emplace a state block with zero state - * - * \param _key Key of the new state. - * \param _type Types of the new state. - * \param _fixed If the new state is fixed (i.e. not estimated). - **/ - StateBlockPtr emplaceStateBlockZero(const char key, - const std::string& _type, - const bool& _fixed); + const std::string& _type, + const Eigen::VectorXd& _vector, + const bool& _fixed); + /** \brief Emplace a state block with zero state + * + * \param _key Key of the new state. + * \param _type Types of the new state. + * \param _fixed If the new state is fixed (i.e. not estimated). + **/ + StateBlockPtr emplaceStateBlockZero(const char key, const std::string& _type, const bool& _fixed); protected: virtual void removeStateBlock(const char& _sb_key); diff --git a/include/core/processor/processor_base.h b/include/core/processor/processor_base.h index 73bf60933c51fc1c12ffbc35a9cf63b9252c3a0f..6c8b0ffa399f574df3a7824a9b585a82525020e9 100644 --- a/include/core/processor/processor_base.h +++ b/include/core/processor/processor_base.h @@ -152,7 +152,7 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce virtual void remove(); bool hasChildren() const override; const TypeComposite& getStateTypes() const; - StateKeys getStateKeys() const; + StateKeys getStateKeys() const; unsigned int id() const; @@ -232,11 +232,11 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce } public: - YAML::Node getParams() const; - bool isMotionProvider() const; - bool applyLossFunction() const; - bool isVotingActive() const; - double getTimeTolerance() const; + YAML::Node getParams() const; + bool isMotionProvider() const; + bool applyLossFunction() const; + bool isVotingActive() const; + double getTimeTolerance() const; void setApplyLossFunction(bool _apply_loss_function); void setVotingActive(bool _voting_active); diff --git a/include/core/processor/processor_landmark_external.h b/include/core/processor/processor_landmark_external.h index 969502b2c4c28f3cf2225c61f6a7a071b669caa1..2198fabea708b402e3d4f786cfda6fd7b2ba3a25 100644 --- a/include/core/processor/processor_landmark_external.h +++ b/include/core/processor/processor_landmark_external.h @@ -38,7 +38,7 @@ class ProcessorLandmarkExternal : public ProcessorTracker // Factory method for high level API WOLF_PROCESSOR_CREATE(ProcessorLandmarkExternal); - void configure(SensorBasePtr _sensor) override {}; + void configure(SensorBasePtr _sensor) override{}; protected: TrackMatrix track_matrix_; @@ -103,7 +103,7 @@ class ProcessorLandmarkExternal : public ProcessorTracker * * It does nothing for now */ - void postProcess() override {}; + void postProcess() override{}; void advanceDerived() override; void resetDerived() override; @@ -155,6 +155,6 @@ inline ProcessorLandmarkExternal::ProcessorLandmarkExternal(const YAML::Node& _p match_dist_th_unknown_(_params["match_dist_th_unknown"].as<double>()), track_length_th_(_params["track_length_th"].as<unsigned int>()), close_loops_by_id_(_params["close_loops_by_id"].as<bool>()), - close_loops_by_type_(_params["close_loops_by_type"].as<bool>()) {}; + close_loops_by_type_(_params["close_loops_by_type"].as<bool>()){}; } // namespace wolf diff --git a/include/core/processor/processor_tracker.h b/include/core/processor/processor_tracker.h index 147f3caccd8133a5f53166d4064c7d9b24c8df9c..cc47be5faaf9d0ecd351133b9a049461f5095152 100644 --- a/include/core/processor/processor_tracker.h +++ b/include/core/processor/processor_tracker.h @@ -96,7 +96,7 @@ class ProcessorTracker : public ProcessorBase FeatureBasePtrList known_features_last_; ///< list of the known features in previous captures successfully tracked in \b last FeatureBasePtrList - known_features_incoming_; ///< list of the known features in \b last successfully tracked in \b incoming + known_features_incoming_; ///< list of the known features in \b last successfully tracked in \b incoming // PARAMS unsigned int min_features_for_keyframe_; ///< minimum nbr. of features to vote for keyframe @@ -181,7 +181,7 @@ class ProcessorTracker : public ProcessorBase * - initializing counters, flags, or any derived variables * - initializing algorithms needed for processing the derived data */ - virtual void preProcess() {}; + virtual void preProcess(){}; /** Post-process * @@ -193,7 +193,7 @@ class ProcessorTracker : public ProcessorBase * - resetting and/or clearing variables and/or algorithms at the end of processing * - drawing / printing / logging the results of the processing */ - virtual void postProcess() {}; + virtual void postProcess(){}; /** \brief Tracker function * \return The number of successful tracks. diff --git a/include/core/state_block/state_block.h b/include/core/state_block/state_block.h index f0739a87ada759e2e7b87f9d7a7ef1cdb55b820a..bc19f53fccfb396397743e7def12fdbe422253c9 100644 --- a/include/core/state_block/state_block.h +++ b/include/core/state_block/state_block.h @@ -116,8 +116,8 @@ class StateBlock : public std::enable_shared_from_this<StateBlock> bool _transformable = true); ///< Explicitly not copyable/movable - StateBlock(const StateBlock& o) = delete; - StateBlock(StateBlock&& o) = delete; + StateBlock(const StateBlock& o) = delete; + StateBlock(StateBlock&& o) = delete; StateBlock& operator=(const StateBlock& o) = delete; /** \brief Destructor diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 2c5d981e15d701e0b65d581555a504dd0cd0df47..a744c222d91986ca9ba35df0cbf26314c6968998 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -474,8 +474,9 @@ FrameBasePtr Problem::emplaceFrame(const TimeStamp& _time_stamp, const StateKeys FrameBasePtr Problem::emplaceFrame(const TimeStamp& _time_stamp, const VectorComposite& _frame_state) { if (not frame_types_.has(_frame_state.getKeys())) - throw std::runtime_error("Problem::emplaceFrame: any unknown type. given vectors for keys " + _frame_state.getKeys() + - " but problem only know the types of " + frame_types_.getKeys()); + throw std::runtime_error("Problem::emplaceFrame: any unknown type. given vectors for keys " + + _frame_state.getKeys() + " but problem only know the types of " + + frame_types_.getKeys()); return Problem::emplaceFrame(_time_stamp, getFrameTypes(_frame_state.getKeys()), _frame_state); } @@ -625,7 +626,7 @@ VectorComposite Problem::getState(const TimeStamp& _ts, const StateKeys& _keys) { if (not frame_types_.has(_keys)) throw std::runtime_error("Problem::getState: unknown key! Asked for " + _keys + - " but installed processors only work with " + frame_types_.getKeys()); + " but installed processors only work with " + frame_types_.getKeys()); WOLF_WARN_COND(_keys.empty(), "Empty keys provided. Returning empty state."); if (_keys.empty()) return VectorComposite(); @@ -691,7 +692,7 @@ VectorComposite Problem::getOdometry(const StateKeys& _keys) const { if (not frame_types_.has(_keys)) throw std::runtime_error("Problem::getState: unknown key! Asked for " + _keys + - " but installed processors only work with " + frame_types_.getKeys()); + " but installed processors only work with " + frame_types_.getKeys()); WOLF_WARN_COND(_keys.empty(), "Empty keys provided. Returning empty state."); if (_keys.empty()) return VectorComposite(); diff --git a/src/processor/processor_loop_closure.cpp b/src/processor/processor_loop_closure.cpp index cad2e26f876b1649cb0271bc92d203d91579025f..f30443fb0006c3d352935fb2ef7a8865351395a0 100644 --- a/src/processor/processor_loop_closure.cpp +++ b/src/processor/processor_loop_closure.cpp @@ -20,7 +20,9 @@ namespace wolf { -ProcessorLoopClosure::ProcessorLoopClosure(const std::string& _type, const TypeComposite& _state_types, const YAML::Node& _params) +ProcessorLoopClosure::ProcessorLoopClosure(const std::string& _type, + const TypeComposite& _state_types, + const YAML::Node& _params) : ProcessorBase(_type, _state_types, _params) { // diff --git a/test/dummy/processor_motion_provider_dummy_pov.cpp b/test/dummy/processor_motion_provider_dummy_pov.cpp index 4cb0850a3c9f48cebf4be207e7a79ffbe1b16adf..322e9cd6cc4476bc5a9ca3b90e55d4ea61d1a511 100644 --- a/test/dummy/processor_motion_provider_dummy_pov.cpp +++ b/test/dummy/processor_motion_provider_dummy_pov.cpp @@ -21,7 +21,9 @@ namespace wolf { ProcessorMotionProviderDummyPOV::ProcessorMotionProviderDummyPOV(const YAML::Node& _params) - : ProcessorBase("ProcessorMotionProviderDummyPOV", {{'P', "StatePoint2d"}, {'O', "StateAngle"}, {'V', "StateVector2d"}}, _params), + : ProcessorBase("ProcessorMotionProviderDummyPOV", + {{'P', "StatePoint2d"}, {'O', "StateAngle"}, {'V', "StateVector2d"}}, + _params), MotionProvider({{'P', "StatePoint2d"}, {'O', "StateAngle"}, {'V', "StateVector2d"}}, _params) { } diff --git a/test/gtest_problem.cpp b/test/gtest_problem.cpp index 737b19422c4452b7f238f3bbc58d3a89db5140ae..407ed00f982bc232a3a8570834aa31ed8f5cc08a 100644 --- a/test/gtest_problem.cpp +++ b/test/gtest_problem.cpp @@ -90,7 +90,7 @@ TEST(Problem, emplaceFirstFrame_PO_2d) TimeStamp t0(0); VectorComposite first_frame_values{{'P', Vector2d(1, 2)}, {'O', Vector1d(3)}}; PriorComposite first_frame_priors{{'P', Prior("factor", Vector2d::Constant(sqrt(0.1)))}, - {'O', Prior("factor", Vector1d::Constant(sqrt(0.1)))}}; + {'O', Prior("factor", Vector1d::Constant(sqrt(0.1)))}}; P->emplaceFirstFrame(t0, {{'P', "StatePoint2d"}, {'O', "StateAngle"}}, first_frame_values, first_frame_priors); WOLF_INFO("printing..."); @@ -144,7 +144,7 @@ TEST(Problem, emplaceFirstFrame_PO_3d) TimeStamp t0(0); VectorComposite first_frame_values{{'P', Vector3d(1, 2, 3)}, {'O', Vector4d(4, 5, 6, 7).normalized()}}; PriorComposite first_frame_priors{{'P', Prior("factor", Vector3d::Constant(sqrt(0.1)))}, - {'O', Prior("factor", Vector3d::Constant(sqrt(0.1)))}}; + {'O', Prior("factor", Vector3d::Constant(sqrt(0.1)))}}; P->emplaceFirstFrame( t0, {{'P', "StatePoint3d"}, {'O', "StateQuaternion"}}, first_frame_values, first_frame_priors); diff --git a/test/gtest_processor_landmark_external.cpp b/test/gtest_processor_landmark_external.cpp index 5b82bb2acd1ce0d696507cd9c3105a2909ceba01..b5fa629e2efa0aac60ac3eedb377dbf75fdae7f6 100644 --- a/test/gtest_processor_landmark_external.cpp +++ b/test/gtest_processor_landmark_external.cpp @@ -59,7 +59,7 @@ class ProcessorLandmarkExternalTest : public testing::Test VectorComposite state_robot, state_sensor; std::vector<VectorComposite> state_landmarks; - virtual void SetUp() {}; + virtual void SetUp(){}; void initProblem(int _dim, bool _orientation, int _mode, diff --git a/test/gtest_processor_tracker_feature_dummy.cpp b/test/gtest_processor_tracker_feature_dummy.cpp index 72505e093bbd5c59e696f7bc286ea5d00a7d3397..bf68d7ffaf11352a7899482a7a6ca2e622732557 100644 --- a/test/gtest_processor_tracker_feature_dummy.cpp +++ b/test/gtest_processor_tracker_feature_dummy.cpp @@ -164,12 +164,12 @@ TEST_F(ProcessorTrackerFeatureDummyTest, processKnown) TEST_F(ProcessorTrackerFeatureDummyTest, emplaceFactor) { - FrameBasePtr frm = problem->emplaceFrame(0, problem->stateZero("P")); + FrameBasePtr frm = problem->emplaceFrame(0, problem->stateZero("P")); CaptureBasePtr cap = CaptureBase::emplace<CaptureVoid>(frm, 0, sensor); FeatureBasePtr ftr = FeatureBase::emplace<FeatureBase>(cap, "DUMMY FEATURE", Eigen::Vector1d::Ones(), Eigen::MatrixXd::Ones(1, 1)); - FrameBasePtr frm_other = problem->emplaceFrame(1, problem->stateZero("P")); + FrameBasePtr frm_other = problem->emplaceFrame(1, problem->stateZero("P")); CaptureBasePtr cap_other = CaptureBase::emplace<CaptureVoid>(frm_other, 1, sensor); FeatureBasePtr ftr_other = FeatureBase::emplace<FeatureBase>( cap_other, "DUMMY FEATURE", Eigen::Vector1d::Ones(), Eigen::MatrixXd::Ones(1, 1)); @@ -191,12 +191,12 @@ TEST_F(ProcessorTrackerFeatureDummyTest, emplaceFactor) TEST_F(ProcessorTrackerFeatureDummyTest, establishFactors) { // Put a capture on last_ptr_ - FrameBasePtr last_frm = problem->emplaceFrame(0, problem->stateZero("P")); + FrameBasePtr last_frm = problem->emplaceFrame(0, problem->stateZero("P")); CaptureBasePtr last_cap = CaptureBase::emplace<CaptureVoid>(last_frm, 0, sensor); processor->setLast(last_cap); // Put a capture on incoming_ptr_ - FrameBasePtr inc_frm = problem->emplaceFrame(1, problem->stateZero("P")); + FrameBasePtr inc_frm = problem->emplaceFrame(1, problem->stateZero("P")); CaptureBasePtr inc_cap = CaptureBase::emplace<CaptureVoid>(inc_frm, 1, sensor); processor->setInc(inc_cap); @@ -280,7 +280,7 @@ TEST_F(ProcessorTrackerFeatureDummyTest, process) ASSERT_TRUE(problem->check(0)); problem->print(4, 1, 0, 0); - + // 5TH TIME -> KF in cap4 (tracked features < 7 (params->min_features_for_keyframe)) WOLF_INFO("Fifth time..."); CaptureBasePtr cap5 = std::make_shared<CaptureVoid>(4, sensor); diff --git a/test/gtest_tree_manager_sliding_window_dual_rate.cpp b/test/gtest_tree_manager_sliding_window_dual_rate.cpp index 0fb4ef3d889df64228d5dae599de5fe366e9a3f9..61165b54c5d070195314648ffbd2b12557bfaf2a 100644 --- a/test/gtest_tree_manager_sliding_window_dual_rate.cpp +++ b/test/gtest_tree_manager_sliding_window_dual_rate.cpp @@ -1172,15 +1172,17 @@ TEST(TreeManagerSlidingWindowDualRate, slidingWindowWithProcessor) WOLF_INFO("state: ", problem->getState("PO").vector("PO").transpose()); - ASSERT_POSE3d_APPROX( - problem->getState("PO").vector("PO").transpose(), problem_bl->getState("PO").vector("PO").transpose(), 1e-12); + ASSERT_POSE3d_APPROX(problem->getState("PO").vector("PO").transpose(), + problem_bl->getState("PO").vector("PO").transpose(), + 1e-12); // Solve solver->solve(); solver_bl->solve(); - ASSERT_POSE3d_APPROX( - problem->getState("PO").vector("PO").transpose(), problem_bl->getState("PO").vector("PO").transpose(), 1e-12); + ASSERT_POSE3d_APPROX(problem->getState("PO").vector("PO").transpose(), + problem_bl->getState("PO").vector("PO").transpose(), + 1e-12); ASSERT_TRUE(problem->check()); }