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
32namespace fawkes {
33class TimeWait;
34}
35
42{
43public:
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() */
51protected:
52 virtual void
54 {
55 Thread::run();
56 }
57
58private:
59 void publish_clock();
60
61private:
62 ros::Publisher pub_;
63 bool set_local_;
64 unsigned int cfg_freq_;
65
66 fawkes::TimeWait *time_wait_;
67};
68
69#endif
Thread to publish clock to ROS.
Definition: clock_thread.h:42
RosClockThread()
Constructor.
virtual void loop()
Code to execute in the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: clock_thread.h:53
virtual void init()
Initialize the thread.
virtual void finalize()
Finalize the thread.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:34
Thread aspect to access configuration data.
Definition: configurable.h:33
Thread aspect to log output.
Definition: logging.h:33
Thread aspect to get access to a ROS node handle.
Definition: ros.h:39
Thread class encapsulation of pthreads.
Definition: thread.h:46
Time wait utility.
Definition: wait.h:33
Fawkes library namespace.