Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
act_thread.h
1 
2 /***************************************************************************
3  * act_thread.h - Robotino act thread
4  *
5  * Created: Sun Nov 13 16:05:34 2011
6  * Copyright 2011 Tim Niemueller [www.niemueller.de]
7  *
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_ROBOTINO_ACT_THREAD_H_
24 #define __PLUGINS_ROBOTINO_ACT_THREAD_H_
25 
26 #include <core/threading/thread.h>
27 #include <aspect/blocked_timing.h>
28 #include <aspect/logging.h>
29 #include <aspect/configurable.h>
30 #include <aspect/blackboard.h>
31 #include <aspect/clock.h>
32 #ifdef HAVE_TF
33 # include <aspect/tf.h>
34 #endif
35 
36 #include <string>
37 
38 namespace rec {
39  namespace robotino {
40  namespace com {
41  class Com;
42  class OmniDrive;
43  }
44  }
45 }
46 
47 namespace fawkes {
48  class MotorInterface;
49 }
50 
52 
54 : public fawkes::Thread,
55  public fawkes::LoggingAspect,
57  public fawkes::ClockAspect,
58 #ifdef HAVE_TF
60 #endif
63 {
64  public:
66 
67  virtual void init();
68  virtual void loop();
69  virtual void finalize();
70 
71  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
72  protected: virtual void run() { Thread::run(); }
73 
74  private:
75  RobotinoSensorThread *sensor_thread_;
76  rec::robotino::com::Com *com_;
77  rec::robotino::com::OmniDrive *omni_drive_;
78  unsigned int last_seqnum_;
79  fawkes::MotorInterface *motor_if_;
80 };
81 
82 
83 #endif
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: act_thread.h:72
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:36
Thread class encapsulation of pthreads.
Definition: thread.h:42
RobotinoActThread(RobotinoSensorThread *sensor_thread)
Constructor.
Definition: act_thread.cpp:46
Thread aspect to access the transform system.
Definition: tf.h:38
Thread aspect to use blocked timing.
Robotino act hook integration thread.
Definition: act_thread.h:53
Thread aspect to log output.
Definition: logging.h:35
Robotino sensor hook integration thread.
Definition: sensor_thread.h:58
virtual void init()
Initialize the thread.
Definition: act_thread.cpp:58
Thread aspect to access configuration data.
Definition: configurable.h:35
virtual void loop()
Code to execute in the thread.
Definition: act_thread.cpp:92
virtual void finalize()
Finalize the thread.
Definition: act_thread.cpp:76
MotorInterface Fawkes BlackBoard Interface.