Fawkes API
Fawkes Development Version
node_thread.h
1
2
/***************************************************************************
3
* node_thread.h - Gazebo node handle providing thread
4
*
5
* Created: Fri Aug 24 11:04:04 2012
6
* Author Bastian Klingen, Frederik Zwilling
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_GAZEBO_NODE_THREAD_H_
24
#define _PLUGINS_GAZEBO_NODE_THREAD_H_
25
26
#include <aspect/aspect_provider.h>
27
#include <aspect/blocked_timing.h>
28
#include <aspect/clock.h>
29
#include <aspect/configurable.h>
30
#include <aspect/logging.h>
31
#include <core/threading/thread.h>
32
#include <plugins/gazebo/aspect/gazebo_inifin.h>
33
#include <sys/types.h>
34
#include <utils/time/time.h>
35
36
#include <string.h>
37
38
namespace
gazebo {
39
namespace
transport {
40
class
Node;
41
}
42
}
// namespace gazebo
43
44
class
GazeboNodeThread
:
public
fawkes::Thread
,
45
public
fawkes::BlockedTimingAspect
,
46
public
fawkes::LoggingAspect
,
47
public
fawkes::ConfigurableAspect
,
48
public
fawkes::ClockAspect
,
49
public
fawkes::AspectProviderAspect
50
{
51
public
:
52
GazeboNodeThread
();
53
virtual
~GazeboNodeThread
();
54
55
virtual
void
init
();
56
virtual
void
loop
();
57
virtual
void
finalize
();
58
59
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
60
protected
:
61
virtual
void
62
run
()
63
{
64
Thread::run();
65
}
66
67
private
:
68
//Node for communication to gazebo-robot-plugins
69
gazebo::transport::NodePtr gazebonode_;
70
//Node to control the gazebo world (e.g. spawn visual objects)
71
gazebo::transport::NodePtr gazebo_world_node_;
72
//Publisher to send Messages:
73
gazebo::transport::PublisherPtr visual_publisher_, model_publisher_, request_publisher_,
74
light_publisher_;
75
76
fawkes::GazeboAspectIniFin
gazebo_aspect_inifin_;
77
78
//channel of a specified robot for the gazebo node communication
79
std::string robot_channel, world_name;
80
};
81
82
#endif
GazeboNodeThread
Definition:
node_thread.h:44
fawkes::AspectProviderAspect
Definition:
aspect_provider.h:41
fawkes::BlockedTimingAspect
Definition:
blocked_timing.h:56
GazeboNodeThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
node_thread.h:62
fawkes::LoggingAspect
Definition:
logging.h:38
GazeboNodeThread::~GazeboNodeThread
virtual ~GazeboNodeThread()
Destructor.
Definition:
node_thread.cpp:53
GazeboNodeThread::GazeboNodeThread
GazeboNodeThread()
Constructor.
Definition:
node_thread.cpp:45
GazeboNodeThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
node_thread.cpp:99
fawkes::Thread
Definition:
thread.h:45
fawkes::GazeboAspectIniFin
Definition:
gazebo_inifin.h:41
fawkes::ConfigurableAspect
Definition:
configurable.h:38
GazeboNodeThread::init
virtual void init()
Initialize the thread.
Definition:
node_thread.cpp:58
GazeboNodeThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
node_thread.cpp:88
fawkes::ClockAspect
Definition:
clock.h:40
src
plugins
gazebo
node_thread.h
Generated by
1.8.17