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
laser_pointcloud_thread.h
1
2
/***************************************************************************
3
* laser_pointcloud_thread.h - Convert laser data to pointclouds
4
*
5
* Created: Thu Nov 17 10:21:40 2011
6
* Copyright 2011 Tim Niemueller [www.niemueller.de]
7
****************************************************************************/
8
9
/* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU Library General Public License for more details.
18
*
19
* Read the full text in the LICENSE.GPL file in the doc directory.
20
*/
21
22
#ifndef __PLUGINS_LASER_POINTCLOUDS_LASER_POINTCLOUD_THREAD_H_
23
#define __PLUGINS_LASER_POINTCLOUDS_LASER_POINTCLOUD_THREAD_H_
24
25
#include <core/threading/thread.h>
26
#include <aspect/blocked_timing.h>
27
#include <aspect/logging.h>
28
#include <aspect/blackboard.h>
29
#include <aspect/pointcloud.h>
30
#include <blackboard/interface_listener.h>
31
#include <blackboard/interface_observer.h>
32
#include <core/utils/lock_list.h>
33
34
#include <pcl/point_cloud.h>
35
#include <pcl/point_types.h>
36
37
namespace
fawkes {
38
class
Interface;
39
class
Laser360Interface;
40
class
Laser720Interface;
41
}
42
43
class
LaserPointCloudThread
44
:
public
fawkes::Thread
,
45
public
fawkes::LoggingAspect
,
46
public
fawkes::BlackBoardAspect
,
47
public
fawkes::BlockedTimingAspect
,
48
public
fawkes::PointCloudAspect
,
49
public
fawkes::BlackBoardInterfaceObserver
,
50
public
fawkes::BlackBoardInterfaceListener
51
{
52
public
:
53
LaserPointCloudThread
();
54
virtual
~LaserPointCloudThread
();
55
56
virtual
void
init
();
57
virtual
void
loop
();
58
virtual
void
finalize
();
59
60
// for BlackBoardInterfaceObserver
61
virtual
void
bb_interface_created
(
const
char
*type,
const
char
*
id
)
throw
();
62
63
// for BlackBoardInterfaceListener
64
virtual
void
bb_interface_writer_removed
(
fawkes::Interface
*interface,
65
unsigned
int
instance_serial)
throw
();
66
virtual
void
bb_interface_reader_removed
(
fawkes::Interface
*interface,
67
unsigned
int
instance_serial)
throw
();
68
69
private
:
70
void
conditional_close(
fawkes::Interface
*interface)
throw
();
71
std::string interface_to_pcl_name(
const
char
*interface_id);
72
73
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
74
protected
:
virtual
void
run
() { Thread::run(); }
75
76
private
:
77
/// @cond INTERNALS
78
typedef
struct
{
79
std::string id;
80
bool
is_360;
81
union
{
82
fawkes::Laser360Interface
*as360;
83
fawkes::Laser720Interface
*as720;
84
} interface_typed;
85
fawkes::Interface
*interface;
86
87
fawkes::RefPtr<pcl::PointCloud<pcl::PointXYZ>
> cloud;
88
} InterfaceCloudMapping;
89
/// @endcond
90
91
fawkes::LockList<InterfaceCloudMapping>
__mappings;
92
93
float
sin_angles360[360];
94
float
cos_angles360[360];
95
float
sin_angles720[720];
96
float
cos_angles720[720];
97
};
98
99
#endif
src
plugins
laser-pointclouds
laser_pointcloud_thread.h
Generated by
1.8.3.1