Fawkes API  Fawkes Development Version
act_thread.h
1 
2 /***************************************************************************
3  * act_thread.h - Colli Act Thread
4  *
5  * Created: Thu Oct 17 16:58:00 2013
6  * Copyright 2013-2014 Bahram Maleki-Fard
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_COLLI_ACT_THREAD_H_
24 #define __PLUGINS_COLLI_ACT_THREAD_H_
25 
26 #include <core/threading/thread.h>
27 #include <aspect/blocked_timing.h>
28 #include <aspect/logging.h>
29 #include <aspect/blackboard.h>
30 #include <aspect/configurable.h>
31 #include <aspect/tf.h>
32 
33 #include <interfaces/NavigatorInterface.h>
34 
35 #include <string>
36 
37 namespace ros {
38  class Subscriber;
39 }
40 
41 namespace fawkes
42 {
43  class NavigatorInterface;
44 }
45 
46 class ColliThread;
47 
49 : public fawkes::Thread,
51  public fawkes::LoggingAspect,
55 {
56  public:
57  ColliActThread(ColliThread* colli_thread);
58  virtual ~ColliActThread();
59 
60  virtual void init();
61  virtual void loop();
62  virtual void finalize();
63 
64  private:
65 
66  ColliThread* thread_colli_;
67 
69 
70  ros::Subscriber* sub_;
71 
72  std::string cfg_iface_navi_;
73 
74  std::string cfg_frame_odom_;
75 
76  // default parameters, read from config
77  float cfg_security_distance_;
78  float cfg_max_velocity_;
79  float cfg_max_rotation_;
80  float cfg_escaping_enabled_;
81  bool cfg_stop_at_target_;
84 
85  // methods mainly transfered from libmonaco
86  bool colli_final();
87  void colli_stop();
88  void colli_relgoto(float x, float y, float ori);
89  void colli_goto(float x, float y, float ori);
90 };
91 
92 #endif
93 
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Fawkes library namespace.
OrientationMode
Orientation mode enum.
Thread class encapsulation of pthreads.
Definition: thread.h:42
This thread hooks onto Fawkes main loop at the ACT hook.
Definition: act_thread.h:48
Thread aspect to access the transform system.
Definition: tf.h:42
Thread aspect to use blocked timing.
Thread that performs the navigation and collision avoidance algorithms.
Definition: colli_thread.h:58
Definition: act_thread.h:37
Thread aspect to log output.
Definition: logging.h:35
Thread aspect to access configuration data.
Definition: configurable.h:35
NavigatorInterface Fawkes BlackBoard Interface.