INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
scan_data.h
1 /*
2  * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3  * http://gearbox.sf.net/
4  * Copyright (c) 2008-2010 Geoffrey Biggs
5  *
6  * hokuyo_aist Hokuyo laser scanner driver.
7  *
8  * This distribution is licensed to you under the terms described in the
9  * LICENSE file included in this distribution.
10  *
11  * This work is a product of the National Institute of Advanced Industrial
12  * Science and Technology, Japan. Registration number: H22PRO-1086.
13  *
14  * This file is part of hokuyo_aist.
15  *
16  * This software is licensed under the Eclipse Public License -v 1.0 (EPL). See
17  * http://www.opensource.org/licenses/eclipse-1.0.txt
18  */
19 
20 #ifndef SCAN_DATA_H__
21 #define SCAN_DATA_H__
22 
23 #if defined(WIN32)
24  typedef unsigned char uint8_t;
25  typedef unsigned int uint32_t;
26  #if defined(HOKUYO_AIST_STATIC)
27  #define HOKUYO_AIST_EXPORT
28  #elif defined(HOKUYO_AIST_EXPORTS)
29  #define HOKUYO_AIST_EXPORT __declspec(dllexport)
30  #else
31  #define HOKUYO_AIST_EXPORT __declspec(dllimport)
32  #endif
33 #else
34  #include <stdint.h>
35  #define HOKUYO_AIST_EXPORT
36 #endif
37 
38 #include "sensor_info.h"
39 
40 #include <string>
41 
46 namespace hokuyo_aist
47 {
48 
49 class Sensor;
50 
52 class HOKUYO_AIST_EXPORT ScanData
53 {
54  public:
55  friend class Sensor;
56 
59  ScanData();
76  ScanData(uint32_t* const ranges_buffer,
77  unsigned int ranges_length,
78  uint32_t* const intensities_buffer=0,
79  unsigned int intensities_length=0);
81  ScanData(ScanData const& rhs);
82  ~ScanData();
83 
89  const uint32_t* ranges() const
90  { return ranges_; }
92  const uint32_t* intensities() const
93  { return intensities_; }
95  unsigned int ranges_length() const { return ranges_length_; }
97  unsigned int intensities_length() const { return intensities_length_; }
102  bool get_error_status() const { return error_; }
105  std::string error_code_to_string(uint32_t error_code);
109  unsigned int laser_time_stamp() const { return laser_time_; }
113  unsigned long long system_time_stamp() const { return system_time_; }
115  LaserModel model() const { return model_; }
117  bool buffers_provided() const { return buffers_provided_; }
118 
127  ScanData& operator=(ScanData const& rhs);
131  uint32_t operator[](unsigned int index);
132 
134  std::string as_string();
135 
137  void clean_up();
138 
139  protected:
140  uint32_t* ranges_;
141  uint32_t* intensities_;
142  unsigned int ranges_length_;
143  unsigned int intensities_length_;
144  bool error_;
145  unsigned int laser_time_;
146  unsigned long long system_time_;
147  LaserModel model_;
148  bool buffers_provided_;
149 
150  void allocate_data(unsigned int length,
151  bool include_intensities = false);
152  void write_range(unsigned int index, uint32_t value);
153  void write_intensity(unsigned int index, uint32_t value);
154 }; // class ScanData
155 
156 } // namespace hokuyo_aist
157 
160 #endif // SCAN_DATA_H__
161 
unsigned int ranges_length() const
Get the number of range samples in the data.
Definition: scan_data.h:95
Structure to store data returned from the laser scanner.
Definition: scan_data.h:52
LaserModel
Laser models.
Definition: sensor_info.h:49
const uint32_t * intensities() const
Return a pointer to an array of intensity readings.
Definition: scan_data.h:92
Hokuyo laser scanner driver name space.
LaserModel model() const
Get the model of the laser that produced this scan.
Definition: scan_data.h:115
const uint32_t * ranges() const
Return a pointer to array of range readings in millimetres.
Definition: scan_data.h:89
unsigned int laser_time_stamp() const
Get the raw time stamp of the data in milliseconds.
Definition: scan_data.h:109
unsigned long long system_time_stamp() const
Get the system time stamp of the data in milliseconds.
Definition: scan_data.h:113
bool buffers_provided() const
Check if the buffers are being provided instead of automatic.
Definition: scan_data.h:117
bool get_error_status() const
Indicates if one or more steps had an error.
Definition: scan_data.h:102
Hokuyo laser scanner class.
Definition: sensor.h:121
unsigned int intensities_length() const
Get the number of intensity samples in the data.
Definition: scan_data.h:97
 

Generated for GearBox by  doxygen 1.4.5