HokuyoAIST
3.0.1
Main Page
Namespaces
Classes
Files
File List
File Members
include
hokuyoaist
scan_data.h
Go to the documentation of this file.
1
/* HokuyoAIST
2
*
3
* Header file for the scan data object.
4
*
5
* Copyright 2008-2011 Geoffrey Biggs geoffrey.biggs@aist.go.jp
6
* RT-Synthesis Research Group
7
* Intelligent Systems Research Institute,
8
* National Institute of Advanced Industrial Science and Technology (AIST),
9
* Japan
10
* All rights reserved.
11
*
12
* This file is part of HokuyoAIST.
13
*
14
* HokuyoAIST is free software; you can redistribute it and/or modify it
15
* under the terms of the GNU Lesser General Public License as published
16
* by the Free Software Foundation; either version 2.1 of the License,
17
* or (at your option) any later version.
18
*
19
* HokuyoAIST is distributed in the hope that it will be useful, but
20
* WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
* Lesser General Public License for more details.
23
*
24
* You should have received a copy of the GNU Lesser General Public
25
* License along with HokuyoAIST. If not, see
26
* <http://www.gnu.org/licenses/>.
27
*/
28
29
#ifndef SCAN_DATA_H__
30
#define SCAN_DATA_H__
31
32
#if defined(WIN32)
33
typedef
unsigned
char
uint8_t;
34
typedef
unsigned
int
uint32_t;
35
#if defined(HOKUYOAIST_STATIC)
36
#define HOKUYOAIST_EXPORT
37
#elif defined(hokuyoaist_EXPORTS)
38
#define HOKUYOAIST_EXPORT __declspec(dllexport)
39
#else
40
#define HOKUYOAIST_EXPORT __declspec(dllimport)
41
#endif
42
#else
43
#include <stdint.h>
44
#define HOKUYOAIST_EXPORT
45
#endif
46
47
#include <
hokuyoaist/sensor_info.h
>
48
49
#include <string>
50
55
namespace
hokuyoaist
56
{
57
58
class
Sensor;
59
61
class
HOKUYOAIST_EXPORT
ScanData
62
{
63
public
:
64
friend
class
Sensor
;
65
68
ScanData
();
85
ScanData
(uint32_t*
const
ranges_buffer,
86
unsigned
int
ranges_length,
87
uint32_t*
const
intensities_buffer=0,
88
unsigned
int
intensities_length=0);
90
ScanData
(
ScanData
const
& rhs);
91
~
ScanData
();
92
98
const
uint32_t* ranges()
const
99
{
return
ranges_; }
101
const
uint32_t* intensities()
const
102
{
return
intensities_; }
104
unsigned
int
ranges_length
()
const
{
return
ranges_length_; }
106
unsigned
int
intensities_length
()
const
{
return
intensities_length_; }
111
bool
get_error_status
()
const
{
return
error_; }
114
std::string error_code_to_string(uint32_t error_code);
118
unsigned
int
laser_time_stamp
()
const
{
return
laser_time_; }
122
unsigned
long
long
system_time_stamp
()
const
{
return
system_time_; }
124
LaserModel
model
()
const
{
return
model_; }
126
bool
buffers_provided
()
const
{
return
buffers_provided_; }
127
136
ScanData
& operator=(
ScanData
const
& rhs);
140
uint32_t operator[](
unsigned
int
index);
141
143
std::string as_string();
144
146
void
clean_up();
147
148
protected
:
149
uint32_t*
ranges_
;
150
uint32_t*
intensities_
;
151
unsigned
int
ranges_length_
;
152
unsigned
int
intensities_length_
;
153
bool
error_
;
154
unsigned
int
laser_time_
;
155
unsigned
long
long
system_time_
;
156
LaserModel
model_
;
157
bool
buffers_provided_
;
158
159
void
allocate_data(
unsigned
int
length,
160
bool
include_intensities =
false
);
161
void
write_range(
unsigned
int
index, uint32_t value);
162
void
write_intensity(
unsigned
int
index, uint32_t value);
163
};
// class ScanData
164
165
}
// namespace hokuyoaist
166
169
#endif // SCAN_DATA_H__
170
Generated on Wed Aug 1 2012 23:17:02 for HokuyoAIST by
1.8.1.2