Skip to content
Snippets Groups Projects

Removed loading of packages from Problem

Merged Joan Vallvé Navarro requested to merge devel into master
6 files
+ 308
0
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 115
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--------
#ifndef WOLF_DUMMY_OBJECT_H_
#define WOLF_DUMMY_OBJECT_H_
/**************************
* WOLF includes *
**************************/
#include "core/common/wolf.h"
#include <core/utils/params_server.h>
#include "factory_dummy_object.h"
namespace wolf {
WOLF_PTR_TYPEDEFS(DummyObject);
/*
* Macro for defining Autoconf DummyObject creator for WOLF's high level API.
*
* Place a call to this macro inside your class declaration (in the DummyObject_class.h file),
* preferably just after the constructors.
*
* In order to use this macro, the derived DummyObject class, DummyObjectClass,
* must have a constructor available with the API:
*
* DummyObjectClass(const std::string& _unique_name,
* const ParamsServer& _server);
*/
#define WOLF_DUMMY_OBJECT_CREATE(DummyObjectClass) \
static DummyObjectPtr create(const std::string& _unique_name, \
const ParamsServer& _server) \
{ \
DummyObjectPtr sub = std::make_shared<DummyObjectClass>(_unique_name, _server); \
return sub; \
} \
class DummyObject
{
protected:
//wolf
std::string prefix_;
std::string name_;
std::string topic_;
public:
DummyObject(const std::string& _unique_name,
const ParamsServer& _server) :
prefix_("ROS DummyObject/" + _unique_name),
name_(_unique_name)
{
//topic_ = _server.getParam<std::string>(prefix_ + "/topic");
}
virtual ~DummyObject(){};
//std::string getTopic() const;
std::string getName() const;
virtual void print() const = 0;
protected:
template<typename T>
T getParamWithDefault(const ParamsServer &_server,
const std::string &_param_name,
const T _default_value) const;
};
// inline std::string DummyObject::getTopic() const
// {
// return topic_;
// }
inline std::string DummyObject::getName() const
{
return name_;
}
// template<typename T>
// inline T DummyObject::getParamWithDefault(const ParamsServer &_server,
// const std::string &_param_name,
// const T _default_value) const
// {
// try
// {
// return _server.getParam<T>(_param_name);
// }
// catch (...)
// {
// WOLF_INFO("DummyObject: Parameter ", _param_name, " is missing. Taking default value: ", _default_value);
// return _default_value;
// }
// }
}
#endif
Loading