Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
acquisition_thread.h
1
2
/***************************************************************************
3
* acquisition_thread.h - Thread that retrieves the laser data
4
*
5
* Created: Wed Oct 08 13:41:02 2008
6
* Copyright 2006-2008 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_LASER_ACQUISITION_THREAD_H_
24
#define __PLUGINS_LASER_ACQUISITION_THREAD_H_
25
26
#include <core/threading/thread.h>
27
#include <aspect/logging.h>
28
#include <aspect/configurable.h>
29
#include <aspect/clock.h>
30
31
namespace
fawkes {
32
class
Mutex;
33
class
Configuration;
34
class
Logger;
35
}
36
37
class
LaserAcquisitionThread
38
:
public
fawkes::Thread
,
39
public
fawkes::LoggingAspect
,
40
public
fawkes::ConfigurableAspect
,
41
public
fawkes::ClockAspect
42
{
43
public
:
44
LaserAcquisitionThread
(
const
char
*thread_name);
45
virtual
~
LaserAcquisitionThread
();
46
47
bool
lock_if_new_data
();
48
void
unlock
();
49
50
virtual
void
pre_init
(
fawkes::Configuration
*
config
,
51
fawkes::Logger
*
logger
) = 0;
52
53
const
float
*
get_distance_data
();
54
const
float
*
get_echo_data
();
55
56
unsigned
int
get_distance_data_size
();
57
unsigned
int
get_echo_data_size
();
58
59
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
60
protected
:
virtual
void
run
() { Thread::run(); }
61
62
protected
:
63
void
alloc_distances
(
unsigned
int
num_distances);
64
void
alloc_echoes
(
unsigned
int
num_echoes);
65
66
protected
:
67
fawkes::Mutex
*
_data_mutex
;
68
69
bool
_new_data
;
70
float
*
_distances
;
71
float
*
_echoes
;
72
73
unsigned
int
_distances_size
;
74
unsigned
int
_echoes_size
;
75
76
};
77
78
79
#endif
src
plugins
laser
acquisition_thread.h
Generated by
1.8.3.1