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
36namespace ros {
37class Subscriber;
38}
39
40namespace fawkes {
41class NavigatorInterface;
42}
43
44class ColliThread;
45
52{
53public:
54 ColliActThread(ColliThread *colli_thread);
55 virtual ~ColliActThread();
56
57 virtual void init();
58 virtual void loop();
59 virtual void finalize();
60
61private:
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
This thread hooks onto Fawkes main loop at the ACT hook.
Definition: act_thread.h:52
virtual void finalize()
Finalize the thread.
Definition: act_thread.cpp:116
ColliActThread(ColliThread *colli_thread)
Constructor.
Definition: act_thread.cpp:45
virtual void init()
Initialize the thread.
Definition: act_thread.cpp:58
virtual ~ColliActThread()
Desctructor.
Definition: act_thread.cpp:53
virtual void loop()
Code to execute in the thread.
Definition: act_thread.cpp:122
Thread that performs the navigation and collision avoidance algorithms.
Definition: colli_thread.h:62
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect to use blocked timing.
Thread aspect to access configuration data.
Definition: configurable.h:33
Thread aspect to log output.
Definition: logging.h:33
NavigatorInterface Fawkes BlackBoard Interface.
OrientationMode
Orientation mode enum.
Thread class encapsulation of pthreads.
Definition: thread.h:46
Thread aspect to access the transform system.
Definition: tf.h:39
Fawkes library namespace.