Fawkes API  Fawkes Development Version
dynamic_reconfigure_thread.h
1 
2 /***************************************************************************
3  * dynamic_reconfigure_thread.h - Robotino ROS Dynamic Reconfigure Thread
4  *
5  * Created: Fri May 05 20:07:27 2017
6  * Copyright 2017 Christoph Henke
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef _ROS_DYNAMIC_RECONFIGURE_THREAD_H_
23 #define _ROS_DYNAMIC_RECONFIGURE_THREAD_H_
24 
25 #include <aspect/blackboard.h>
26 #include <aspect/blocked_timing.h>
27 #include <aspect/configurable.h>
28 #include <aspect/logging.h>
29 #include <core/threading/thread.h>
30 #include <interfaces/DynamicReconfigureInterface.h>
31 #include <plugins/ros/aspect/ros.h>
32 #include <ros/ros.h>
33 
34 namespace fawkes {
35 class DynamicReconfigureInterface;
36 }
37 
40  public fawkes::LoggingAspect,
43  public fawkes::ROSAspect
44 {
45 public:
47 
48  virtual void init();
49  virtual void finalize();
50  virtual void loop();
51 
52  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
53 protected:
54  virtual void
55  run()
56  {
57  Thread::run();
58  }
59 
60 private:
61  // set methods for dynamic reconfiguration of different types
62  bool set_dynreconf_value(const std::string &service,
63  const std::string &parameter,
64  const std::string &value);
65  bool
66  set_dynreconf_value(const std::string &service, const std::string &parameter, const bool value);
67  bool
68  set_dynreconf_value(const std::string &service, const std::string &parameter, const int value);
69  bool
70  set_dynreconf_value(const std::string &service, const std::string &parameter, const double value);
71 
72  // method for resetting the dynamic reconfigure interface
73  void reset_dynamic_reconfigure_interface();
74 
75 private:
77 };
78 
79 #endif /* ROS_DYNAMIC_RECONFIGURE_THREAD_H__ */
Performing dynamic reconfiguration between Fawkes and ROS.
virtual void loop()
Code to execute in the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
virtual void finalize()
Method for finalization.
virtual void init()
Method for initialization.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect to use blocked timing.
Thread aspect to access configuration data.
Definition: configurable.h:33
DynamicReconfigureInterface Fawkes BlackBoard Interface.
Thread aspect to log output.
Definition: logging.h:33
Thread aspect to get access to a ROS node handle.
Definition: ros.h:39
Thread class encapsulation of pthreads.
Definition: thread.h:46
Fawkes library namespace.