From 5680bc04c111773795c03ef0ef6191b4c408a42d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Sat, 12 Dec 2020 21:59:52 +0100
Subject: [PATCH] Remove API for Aux frames

---
 include/core/processor/processor_base.h | 27 -------------------------
 src/processor/processor_base.cpp        |  5 -----
 src/yaml/processor_odom_3d_yaml.cpp     |  1 -
 3 files changed, 33 deletions(-)

diff --git a/include/core/processor/processor_base.h b/include/core/processor/processor_base.h
index f6b5cc5fb..c8945c803 100644
--- a/include/core/processor/processor_base.h
+++ b/include/core/processor/processor_base.h
@@ -227,7 +227,6 @@ struct ParamsProcessorBase : public ParamsBase
     {
         time_tolerance      = _server.getParam<double>(prefix + _unique_name + "/time_tolerance");
         voting_active       = _server.getParam<bool>(prefix + _unique_name   + "/keyframe_vote/voting_active");
-        voting_aux_active   = _server.getParam<bool>(prefix + _unique_name   + "/keyframe_vote/voting_aux_active");
         apply_loss_function = _server.getParam<bool>(prefix + _unique_name   + "/apply_loss_function");
     }
 
@@ -239,12 +238,10 @@ struct ParamsProcessorBase : public ParamsBase
      */
     double time_tolerance;
     bool voting_active;         ///< Whether this processor is allowed to vote for a Key Frame or not
-    bool voting_aux_active;     ///< Whether this processor is allowed to vote for an Auxiliary Frame or not
     bool apply_loss_function;   ///< Whether this processor emplaces factors with loss function or not
 
     std::string print() const override
     {
-                + "voting_aux_active: "     + std::to_string(voting_aux_active)     + "\n"
         return    "voting_active: "         + std::to_string(voting_active)         + "\n"
                 + "time_tolerance: "        + std::to_string(time_tolerance)        + "\n"
                 + "apply_loss_function: "   + std::to_string(apply_loss_function)   + "\n";
@@ -337,19 +334,8 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce
          */
         virtual bool voteForKeyFrame() const = 0;
 
-        /** \brief Vote for Auxiliary Frame generation
-         *
-         * If a Auxiliary Frame criterion is validated, this function returns true,
-         * meaning that it wants to create a Auxiliary Frame at the \b last Capture.
-         *
-         * WARNING! This function only votes! It does not create Auxiliary Frames!
-         */
-        virtual bool voteForAuxFrame() const {return false;};
-
         virtual bool permittedKeyFrame() final;
 
-        virtual bool permittedAuxFrame() final;
-
         void setProblem(ProblemPtr) override;
 
     public:
@@ -377,8 +363,6 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce
 
         bool isVotingActive() const;
 
-        bool isVotingAuxActive() const;
-
         void setVotingActive(bool _voting_active = true);
 
         int getDim() const;
@@ -388,7 +372,6 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce
         void link(SensorBasePtr);
         template<typename classType, typename... T>
         static std::shared_ptr<classType> emplace(SensorBasePtr _sen_ptr, T&&... all);
-        void setVotingAuxActive(bool _voting_active = true);
 
         virtual void printHeader(int depth, //
                                  bool constr_by, //
@@ -439,21 +422,11 @@ inline bool ProcessorBase::isVotingActive() const
     return params_->voting_active;
 }
 
-inline bool ProcessorBase::isVotingAuxActive() const
-{
-    return params_->voting_aux_active;
-}
-
 inline void ProcessorBase::setVotingActive(bool _voting_active)
 {
     params_->voting_active = _voting_active;
 }
 
-inline void ProcessorBase::setVotingAuxActive(bool _voting_active)
-{
-    params_->voting_aux_active = _voting_active;
-}
-
 inline bool ProcessorBase::isMotion() const
 {
     // check if this inherits from IsMotion
diff --git a/src/processor/processor_base.cpp b/src/processor/processor_base.cpp
index 258e7c3d8..7e1015a4d 100644
--- a/src/processor/processor_base.cpp
+++ b/src/processor/processor_base.cpp
@@ -33,11 +33,6 @@ bool ProcessorBase::permittedKeyFrame()
     return isVotingActive() && getProblem()->permitKeyFrame(shared_from_this());
 }
 
-bool ProcessorBase::permittedAuxFrame()
-{
-    return isVotingAuxActive() && getProblem()->permitAuxFrame(shared_from_this());
-}
-
 void ProcessorBase::keyFrameCallback(FrameBasePtr _keyframe_ptr, const double& _time_tol_other)
 {
     assert(_keyframe_ptr != nullptr && "keyFrameCallback with a nullptr frame");
diff --git a/src/yaml/processor_odom_3d_yaml.cpp b/src/yaml/processor_odom_3d_yaml.cpp
index 9c21e3842..bd168ee20 100644
--- a/src/yaml/processor_odom_3d_yaml.cpp
+++ b/src/yaml/processor_odom_3d_yaml.cpp
@@ -34,7 +34,6 @@ static ParamsProcessorBasePtr createProcessorOdom3dParams(const std::string & _f
         YAML::Node keyframe_vote = config["keyframe_vote"];
 
         params->voting_active       = keyframe_vote["voting_active"]    .as<bool>();
-        params->voting_aux_active   = keyframe_vote["voting_aux_active"].as<bool>();
         params->max_time_span       = keyframe_vote["max_time_span"]    .as<double>();
         params->max_buff_length     = keyframe_vote["max_buff_length"]  .as<SizeEigen>();
         params->dist_traveled       = keyframe_vote["dist_traveled"]    .as<double>();
-- 
GitLab