Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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  ****************************************************************************/
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 __PLUGINS_STATIC_TRANSFORMS_STATIC_TRANSFORMS_THREAD_H_
23 #define __PLUGINS_STATIC_TRANSFORMS_STATIC_TRANSFORMS_THREAD_H_
24 
25 #include <core/threading/thread.h>
26 #include <aspect/blocked_timing.h>
27 #include <aspect/clock.h>
28 #include <aspect/configurable.h>
29 #include <aspect/logging.h>
30 #include <aspect/blackboard.h>
31 #include <aspect/tf.h>
32 
33 namespace fawkes {
34  class Time;
35 }
36 
38 : public fawkes::Thread,
39  public fawkes::ClockAspect,
40  public fawkes::LoggingAspect,
45 {
46  public:
48  virtual ~StaticTransformsThread();
49 
50  virtual void init();
51  virtual void loop();
52  virtual void finalize();
53 
54  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
55  protected: virtual void run() { Thread::run(); }
56 
57  private:
58  /** Static transform entry to publish. */
59  typedef struct {
60  std::string name; /**< Transform name */
61  fawkes::tf::StampedTransform *transform; /**< Transform. */
62  } Entry;
63 
64  std::list<Entry> __entries;
65 
66  float __cfg_update_interval;
67  fawkes::Time *__last_update;
68 };
69 
70 #endif