Fawkes API
Fawkes Development Version
sensor_thread.h
1
2
/***************************************************************************
3
* sensor_thread.h - Robotino sensor thread
4
*
5
* Created: Sun Nov 13 15:33:04 2011
6
* Copyright 2011-2012 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_ROBOTINO_SENSOR_THREAD_H_
24
#define _PLUGINS_ROBOTINO_SENSOR_THREAD_H_
25
26
#include <aspect/blackboard.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
33
#include <string>
34
#include <vector>
35
36
class
RobotinoComThread
;
37
class
RobotinoActThread
;
38
39
namespace
fawkes
{
40
class
BatteryInterface;
41
class
RobotinoSensorInterface;
42
class
IMUInterface;
43
}
// namespace fawkes
44
45
class
RobotinoSensorThread
:
public
fawkes::Thread
,
46
public
fawkes::BlockedTimingAspect
,
47
public
fawkes::LoggingAspect
,
48
public
fawkes::ClockAspect
,
49
public
fawkes::ConfigurableAspect
,
50
public
fawkes::BlackBoardAspect
51
{
52
friend
RobotinoActThread
;
53
54
public
:
55
RobotinoSensorThread
(
RobotinoComThread
*com_thread);
56
57
virtual
void
init
();
58
virtual
void
loop
();
59
virtual
void
finalize
();
60
61
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
62
protected
:
63
virtual
void
64
run
()
65
{
66
Thread::run();
67
}
68
69
private
:
// methods
70
void
process_sensor_msgs();
71
void
update_distances(
float
*voltages);
72
73
// Voltage to distance data points
74
static
const
std::vector<std::pair<double, double>> voltage_to_dist_dps_;
75
76
private
:
// members
77
RobotinoComThread
*com_;
78
79
bool
cfg_enable_gyro_;
80
std::string cfg_imu_iface_id_;
81
82
fawkes::BatteryInterface
* batt_if_;
83
fawkes::RobotinoSensorInterface
*sens_if_;
84
fawkes::IMUInterface
* imu_if_;
85
};
86
87
#endif
RobotinoSensorThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
sensor_thread.cpp:84
fawkes::IMUInterface
Definition:
IMUInterface.h:39
RobotinoSensorThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
sensor_thread.h:64
fawkes::BlockedTimingAspect
Definition:
blocked_timing.h:56
RobotinoSensorThread::init
virtual void init()
Initialize the thread.
Definition:
sensor_thread.cpp:66
RobotinoSensorThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
sensor_thread.cpp:92
fawkes::BlackBoardAspect
Definition:
blackboard.h:38
fawkes
fawkes::LoggingAspect
Definition:
logging.h:38
RobotinoActThread
Definition:
act_thread.h:48
fawkes::RobotinoSensorInterface
Definition:
RobotinoSensorInterface.h:39
RobotinoComThread
Definition:
com_thread.h:38
fawkes::BatteryInterface
Definition:
BatteryInterface.h:39
RobotinoSensorThread
Definition:
sensor_thread.h:45
fawkes::Thread
Definition:
thread.h:45
fawkes::ConfigurableAspect
Definition:
configurable.h:38
fawkes::ClockAspect
Definition:
clock.h:40
RobotinoSensorThread::RobotinoSensorThread
RobotinoSensorThread(RobotinoComThread *com_thread)
Constructor.
Definition:
sensor_thread.cpp:58
src
plugins
robotino
sensor_thread.h
Generated by
1.8.17