Fawkes API
Fawkes Development Version
clock_thread.h
1
/***************************************************************************
2
* clock_thread.h - Thread to publish clock to ROS
3
*
4
* Created: Sun Jul 12 16:13:07 2015
5
* Copyright 2015 Tim Niemueller
6
****************************************************************************/
7
8
/* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Library General Public License for more details.
17
*
18
* Read the full text in the LICENSE.GPL file in the doc directory.
19
*/
20
21
#ifndef _PLUGINS_ROS_CLOCK_THREAD_H_
22
#define _PLUGINS_ROS_CLOCK_THREAD_H_
23
24
#include <aspect/blackboard.h>
25
#include <aspect/clock.h>
26
#include <aspect/configurable.h>
27
#include <aspect/logging.h>
28
#include <core/threading/thread.h>
29
#include <plugins/ros/aspect/ros.h>
30
#include <ros/node_handle.h>
31
32
namespace
fawkes
{
33
class
TimeWait;
34
}
35
36
class
RosClockThread
:
public
fawkes::Thread
,
37
public
fawkes::LoggingAspect
,
38
public
fawkes::ConfigurableAspect
,
39
public
fawkes::BlackBoardAspect
,
40
public
fawkes::ClockAspect
,
41
public
fawkes::ROSAspect
42
{
43
public
:
44
RosClockThread
();
45
46
virtual
void
init
();
47
virtual
void
loop
();
48
virtual
void
finalize
();
49
50
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
51
protected
:
52
virtual
void
53
run
()
54
{
55
Thread::run();
56
}
57
58
private
:
59
void
publish_clock();
60
61
private
:
62
ros::Publisher pub_;
63
bool
set_local_;
64
unsigned
int
cfg_freq_;
65
66
fawkes::TimeWait
*time_wait_;
67
};
68
69
#endif
RosClockThread::RosClockThread
RosClockThread()
Constructor.
Definition:
clock_thread.cpp:34
RosClockThread
Definition:
clock_thread.h:36
fawkes::BlackBoardAspect
Definition:
blackboard.h:38
fawkes
fawkes::LoggingAspect
Definition:
logging.h:38
RosClockThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
clock_thread.h:53
fawkes::ROSAspect
Definition:
ros.h:38
RosClockThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
clock_thread.cpp:56
fawkes::Thread
Definition:
thread.h:45
fawkes::TimeWait
Definition:
wait.h:38
fawkes::ConfigurableAspect
Definition:
configurable.h:38
fawkes::ClockAspect
Definition:
clock.h:40
RosClockThread::init
virtual void init()
Initialize the thread.
Definition:
clock_thread.cpp:40
RosClockThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
clock_thread.cpp:85
src
plugins
ros
clock_thread.h
Generated by
1.8.17