Fawkes API  Fawkes Development Version
static_transforms_thread.h
1 
2 /***************************************************************************
3  * static_transform_thread.h - Static transform publisher thread
4  *
5  * Created: Tue Oct 25 16:32:04 2011
6  * Copyright 2011 Tim Niemueller [www.niemueller.de]
7  * 2014 Tobias Neumann
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_STATIC_TRANSFORMS_STATIC_TRANSFORMS_THREAD_H_
24 #define _PLUGINS_STATIC_TRANSFORMS_STATIC_TRANSFORMS_THREAD_H_
25 
26 #include <aspect/blackboard.h>
27 #include <aspect/blocked_timing.h>
28 #include <aspect/clock.h>
29 #include <aspect/configurable.h>
30 #include <aspect/logging.h>
31 #include <aspect/tf.h>
32 #include <config/change_handler.h>
33 #include <core/threading/thread.h>
34 
35 namespace fawkes {
36 class Time;
37 }
38 
40  public fawkes::ClockAspect,
41  public fawkes::LoggingAspect,
46 {
47 public:
49  virtual ~StaticTransformsThread();
50 
51  virtual void init();
52  virtual void loop();
53  virtual void finalize();
54 
55  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
56 protected:
57  virtual void
58  run()
59  {
60  Thread::run();
61  }
62 
63 private:
64  /** Static transform entry to publish. */
65  typedef struct
66  {
67  std::string name; /**< Transform name */
68  fawkes::tf::StampedTransform *transform; /**< Transform. */
69  } Entry;
70 
71  std::list<Entry> entries_;
72 
73  void entries_delete();
74  void entries_get_from_config();
75 
76  virtual void config_tag_changed(const char *new_tag){};
77  virtual void config_comment_changed(const fawkes::Configuration::ValueIterator *v){};
78  virtual void config_value_changed(const fawkes::Configuration::ValueIterator *v);
79  virtual void config_value_erased(const char *path){};
80 };
81 
82 #endif
fawkes::tf::StampedTransform
Transform that contains a timestamp and frame IDs.
Definition: types.h:98
StaticTransformsThread::loop
virtual void loop()
Code to execute in the thread.
Definition: static_transforms_thread.cpp:242
fawkes::ConfigurationChangeHandler
Definition: change_handler.h:35
fawkes::Thread::name
const char * name() const
Definition: thread.h:99
StaticTransformsThread::StaticTransformsThread
StaticTransformsThread()
Constructor.
Definition: static_transforms_thread.cpp:44
fawkes::Configuration::ValueIterator
Definition: config.h:75
StaticTransformsThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: static_transforms_thread.h:57
fawkes::BlackBoardAspect
Definition: blackboard.h:36
fawkes
fawkes::LoggingAspect
Definition: logging.h:36
StaticTransformsThread::init
virtual void init()
Initialize the thread.
Definition: static_transforms_thread.cpp:57
fawkes::TransformAspect
Definition: tf.h:41
fawkes::Thread
Definition: thread.h:44
StaticTransformsThread::~StaticTransformsThread
virtual ~StaticTransformsThread()
Destructor.
Definition: static_transforms_thread.cpp:52
fawkes::ConfigurableAspect
Definition: configurable.h:36
StaticTransformsThread
Definition: static_transforms_thread.h:38
fawkes::ClockAspect
Definition: clock.h:38
StaticTransformsThread::finalize
virtual void finalize()
Finalize the thread.
Definition: static_transforms_thread.cpp:65