Fawkes API
Fawkes Development Version
node_thread.h
1
2
/***************************************************************************
3
* node_thread.h - ROS node handle providing thread
4
*
5
* Created: Thu May 05 18:35:12 2011
6
* Copyright 2006-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_ROS_NODE_THREAD_H_
24
#define _PLUGINS_ROS_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 <core/utils/lockptr.h>
33
#include <plugins/ros/aspect/ros_inifin.h>
34
#include <sys/types.h>
35
#include <utils/time/time.h>
36
37
namespace
ros {
38
class
NodeHandle;
39
class
AsyncSpinner;
40
}
// namespace ros
41
42
class
ROSNodeThread
:
public
fawkes::Thread
,
43
public
fawkes::BlockedTimingAspect
,
44
public
fawkes::LoggingAspect
,
45
public
fawkes::ConfigurableAspect
,
46
public
fawkes::ClockAspect
,
47
public
fawkes::AspectProviderAspect
48
{
49
public
:
50
ROSNodeThread
();
51
virtual
~ROSNodeThread
();
52
53
virtual
void
init
();
54
virtual
void
loop
();
55
virtual
void
finalize
();
56
57
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
58
protected
:
59
virtual
void
60
run
()
61
{
62
Thread::run();
63
}
64
65
private
:
66
bool
cfg_async_spinning_;
67
unsigned
int
cfg_async_num_threads_;
68
69
fawkes::LockPtr<ros::NodeHandle>
rosnode_;
70
fawkes::ROSAspectIniFin
ros_aspect_inifin_;
71
72
ros::AsyncSpinner *async_spinner_;
73
};
74
75
#endif
ROSNodeThread::~ROSNodeThread
virtual ~ROSNodeThread()
Destructor.
Definition:
node_thread.cpp:47
ROSNodeThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
node_thread.h:60
fawkes::LockPtr< ros::NodeHandle >
ROSNodeThread::ROSNodeThread
ROSNodeThread()
Constructor.
Definition:
node_thread.cpp:39
fawkes::AspectProviderAspect
Definition:
aspect_provider.h:41
fawkes::BlockedTimingAspect
Definition:
blocked_timing.h:56
fawkes::LoggingAspect
Definition:
logging.h:38
ROSNodeThread::init
virtual void init()
Initialize the thread.
Definition:
node_thread.cpp:52
ROSNodeThread
Definition:
node_thread.h:42
fawkes::ROSAspectIniFin
Definition:
ros_inifin.h:38
fawkes::Thread
Definition:
thread.h:45
ROSNodeThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
node_thread.cpp:99
fawkes::ConfigurableAspect
Definition:
configurable.h:38
fawkes::ClockAspect
Definition:
clock.h:40
ROSNodeThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
node_thread.cpp:112
src
plugins
ros
node_thread.h
Generated by
1.8.17