diff --git a/include/core/problem/prior_problem.h b/include/core/problem/prior_problem.h deleted file mode 100644 index a3fcbf94260e5ff1c734ffcd01ff90a6e039af86..0000000000000000000000000000000000000000 --- a/include/core/problem/prior_problem.h +++ /dev/null @@ -1,66 +0,0 @@ -//--------LICENSE_START-------- -// -// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informà tica Industrial, CSIC-UPC. -// Authors: Joan Solà Ortega (jsola@iri.upc.edu) -// All rights reserved. -// -// This file is part of WOLF -// WOLF is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// -//--------LICENSE_END-------- -#pragma once - -#include "core/state_block/prior.h" - -namespace wolf -{ - -class PriorProblem : public Prior -{ - protected: - double time_tolerance_; // time tolerance of the first frame - - public: - PriorProblem() = default; - PriorProblem(const std::string& _type, - const Eigen::VectorXd& _state, - const double& _time_tolerance, - const std::string& _mode = "fix", - const Eigen::VectorXd& _noise_std = Eigen::VectorXd(0)); - - PriorProblem(const YAML::Node& _n); - - virtual ~PriorProblem() = default; - - double getTimeTolerance() const; - - using Prior::check; - - std::string print() const override; -}; - -typedef std::unordered_map<char, PriorProblem> StdMapPriorProblem; - -class PriorProblemMap : public StdMapPriorProblem -{ - public: - using StdMapPriorProblem::StdMapPriorProblem; - - PriorProblemMap(const YAML::Node& _n); - virtual ~PriorProblemMap() = default; -}; - -inline double PriorProblem::getTimeTolerance() const { return time_tolerance_; } - -} // namespace wolf \ No newline at end of file diff --git a/src/problem/prior_problem.cpp b/src/problem/prior_problem.cpp deleted file mode 100644 index 3fe7d416b2e20a34e966f2835178c068508bc0b8..0000000000000000000000000000000000000000 --- a/src/problem/prior_problem.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//--------LICENSE_START-------- -// -// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informà tica Industrial, CSIC-UPC. -// Authors: Joan Solà Ortega (jsola@iri.upc.edu) -// All rights reserved. -// -// This file is part of WOLF -// WOLF is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// -//--------LICENSE_END-------- - -#include "core/problem/prior_problem.h" -#include "core/state_block/factory_state_block.h" -#include "core/common/params_base.h" // toString() - -namespace wolf -{ - -PriorProblemMap::PriorProblemMap(const YAML::Node& priors_node) -{ - if (not priors_node.IsMap()) - { - throw std::runtime_error("PriorProblemMap: constructor with a non-map yaml node"); - } - for (auto prior_pair : priors_node) - { - this->emplace(prior_pair.first.as<char>(), PriorProblem(prior_pair.second)); - } -} - -PriorProblem::PriorProblem(const std::string& _type, - const Eigen::VectorXd& _state, - const double& _time_tolerance, - const std::string& _mode, - const Eigen::VectorXd& _noise_std) : - Prior(_type, _state, _mode, _noise_std), - time_tolerance_(_time_tolerance) -{ - check(); -} - -PriorProblem::PriorProblem(const YAML::Node& prior_node) : - Prior(prior_node) -{ - time_tolerance_ = prior_node["time_tolerance"].as<double>(); - - check(); -} - -std::string PriorProblem::print() const -{ - return Prior::print() + - "time_tolerance: " + toString(time_tolerance_) + "\n"; -} - -} // namespace wolf \ No newline at end of file