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 <aspect/blackboard.h>
27 #include <aspect/blocked_timing.h>
28 #include <aspect/configurable.h>
29 #include <aspect/logging.h>
30 #include <aspect/tf.h>
31 #include <core/threading/thread.h>
32 #include <interfaces/NavigatorInterface.h>
33 
34 #include <string>
35 
36 namespace ros {
37 class Subscriber;
38 }
39 
40 namespace fawkes {
41 class NavigatorInterface;
42 }
43 
44 class ColliThread;
45 
46 class ColliActThread : public fawkes::Thread,
48  public fawkes::LoggingAspect,
52 {
53 public:
54  ColliActThread(ColliThread *colli_thread);
55  virtual ~ColliActThread();
56 
57  virtual void init();
58  virtual void loop();
59  virtual void finalize();
60 
61 private:
62  ColliThread *thread_colli_;
63 
65 
66  ros::Subscriber *sub_;
67 
68  std::string cfg_iface_navi_;
69 
70  std::string cfg_frame_odom_;
71 
72  // default parameters, read from config
73  float cfg_security_distance_;
74  float cfg_max_velocity_;
75  float cfg_max_rotation_;
76  float cfg_escaping_enabled_;
77  bool cfg_stop_at_target_;
80 
81  // methods mainly transfered from libmonaco
82  bool colli_final();
83  void colli_stop();
84  void colli_relgoto(float x, float y, float ori);
85  void colli_goto(float x, float y, float ori);
86 };
87 
88 #endif
fawkes::BlockedTimingAspect
Definition: blocked_timing.h:54
ColliThread
Definition: colli_thread.h:55
fawkes::NavigatorInterface::DriveMode
DriveMode
Drive modes enum.
Definition: NavigatorInterface.h:63
fawkes::BlackBoardAspect
Definition: blackboard.h:36
fawkes
fawkes::LoggingAspect
Definition: logging.h:36
fawkes::TransformAspect
Definition: tf.h:41
ColliActThread::loop
virtual void loop()
Code to execute in the thread.
Definition: act_thread.cpp:122
fawkes::NavigatorInterface::OrientationMode
OrientationMode
Orientation mode enum.
Definition: NavigatorInterface.h:73
fawkes::Thread
Definition: thread.h:44
fawkes::ConfigurableAspect
Definition: configurable.h:36
ColliActThread
Definition: act_thread.h:45
ColliActThread::finalize
virtual void finalize()
Finalize the thread.
Definition: act_thread.cpp:116
ColliActThread::~ColliActThread
virtual ~ColliActThread()
Desctructor.
Definition: act_thread.cpp:53
fawkes::NavigatorInterface
Definition: NavigatorInterface.h:37
ColliActThread::ColliActThread
ColliActThread(ColliThread *colli_thread)
Constructor.
Definition: act_thread.cpp:45
ColliActThread::init
virtual void init()
Initialize the thread.
Definition: act_thread.cpp:58