Skip to content
Snippets Groups Projects
Commit a021417f authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

removed useless code

parent f0590eba
No related branches found
No related tags found
1 merge request!448Draft: Resolve "Implementation of new nodes creation"
Pipeline #13529 failed
//--------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
//--------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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment