INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
sensor_info.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 SENSOR_INFO_H__
21 #define SENSOR_INFO_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 <string>
39 #include <cstring>
40 
45 namespace hokuyo_aist
46 {
47 
50 {
51  MODEL_URG04LX, // Classic-URG
52  MODEL_UBG04LXF01, // Rapid-URG
53  MODEL_UHG08LX, // Hi-URG
54  MODEL_UTM30LX, // Top-URG
55  MODEL_UXM30LXE, // Tough-URG
56  MODEL_UNKNOWN
57 };
58 
59 
60 HOKUYO_AIST_EXPORT inline char const* model_to_string(LaserModel model)
61 {
62  switch(model)
63  {
64  case MODEL_URG04LX:
65  return "URG-04LX";
66  case MODEL_UBG04LXF01:
67  return "UBG-04LX-F01";
68  case MODEL_UHG08LX:
69  return "UHG-08LX";
70  case MODEL_UTM30LX:
71  return "UTM-30LX";
72  case MODEL_UXM30LXE:
73  return "UXM-30LX-E";
74  default:
75  return "Unknown model";
76  }
77 }
78 
79 
80 HOKUYO_AIST_EXPORT inline LaserModel string_to_model(char const* model)
81 {
82  if(strncmp(model, "URG-04LX", 8) == 0)
83  return MODEL_URG04LX;
84  else if(strncmp(model, "UBG-04LX-F01", 8) == 0)
85  return MODEL_UBG04LXF01;
86  else if(strncmp(model, "UHG-08LX", 8) == 0)
87  return MODEL_UHG08LX;
88  else if(strncmp(model, "UTM-30LX", 8) == 0)
89  return MODEL_UTM30LX;
90  else if(strncmp(model, "UXM-30LX-E", 8) == 0)
91  return MODEL_UXM30LXE;
92  else
93  return MODEL_UNKNOWN;
94 }
95 
96 
99 {
100  CLOCKWISE,
101  COUNTERCLOCKWISE
102 };
103 
104 
105 HOKUYO_AIST_EXPORT inline char const* rot_dir_to_string(RotationDirection dir)
106 {
107  switch(dir)
108  {
109  case CLOCKWISE:
110  return "Clockwise";
111  case COUNTERCLOCKWISE:
112  return "Counter-clockwise";
113  default:
114  return "Unknown";
115  }
116 }
117 
118 
119 // Forward declaration
120 class Sensor;
121 
122 
127 class HOKUYO_AIST_EXPORT SensorInfo
128 {
129  public:
130  friend class Sensor;
131 
132  SensorInfo();
133  SensorInfo(SensorInfo const& rhs);
134 
136  SensorInfo& operator=(SensorInfo const& rhs);
137 
139  std::string as_string();
140 
141  // Version details.
143  std::string vendor;
145  std::string product;
147  std::string firmware;
149  std::string protocol;
151  std::string serial;
152 
153  // Specification details.
155  std::string model;
157  unsigned int min_range;
159  unsigned int max_range;
161  unsigned int steps;
163  unsigned int first_step;
165  unsigned int last_step;
168  unsigned int front_step;
170  unsigned int standard_speed;
173 
174  // Status details.
176  bool power;
178  unsigned int speed;
180  unsigned short speed_level;
182  std::string measure_state;
184  unsigned int baud;
186  unsigned int time;
188  std::string sensor_diagnostic;
189 
190  // Calculated details
193  double min_angle;
196  double max_angle;
198  double resolution;
202  unsigned int scanable_steps;
204  unsigned int max_step;
207 
208  private:
209  void set_defaults();
210  void calculate_values();
211 }; // class SensorInfo
212 
213 }; // namespace hokuyo_aist
214 
217 #endif // SENSOR_INFO_H__
218 
double min_angle
Definition: sensor_info.h:193
double time_resolution
Time between two scan points (milliseconds).
Definition: sensor_info.h:200
unsigned int max_range
Maximum detectable range (mm).
Definition: sensor_info.h:159
unsigned int scanable_steps
Total number of steps in a full scan (lastStep - firstStep).
Definition: sensor_info.h:202
std::string firmware
Firmware version.
Definition: sensor_info.h:147
std::string model
Sensor model number.
Definition: sensor_info.h:155
LaserModel detected_model
Detected model of the laser.
Definition: sensor_info.h:206
std::string measure_state
Measurement state.
Definition: sensor_info.h:182
LaserModel
Laser models.
Definition: sensor_info.h:49
std::string sensor_diagnostic
Diagnostic status string.
Definition: sensor_info.h:188
std::string vendor
Vendor name.
Definition: sensor_info.h:143
Hokuyo laser scanner driver name space.
unsigned int first_step
First scanable step of a full scan.
Definition: sensor_info.h:163
RotationDirection
Sensor direction of rotation.
Definition: sensor_info.h:98
std::string product
Product name.
Definition: sensor_info.h:145
unsigned int time
Current sensor time (s).
Definition: sensor_info.h:186
unsigned int steps
Number of steps in a 360-degree scan.
Definition: sensor_info.h:161
unsigned int front_step
Definition: sensor_info.h:168
unsigned int baud
Baud rate.
Definition: sensor_info.h:184
unsigned int last_step
Last scanable step of a full scan.
Definition: sensor_info.h:165
unsigned short speed_level
Speed level (0 for default)
Definition: sensor_info.h:180
bool power
Operational status - illuminated or not.
Definition: sensor_info.h:176
unsigned int max_step
Absolute maximum commandable step.
Definition: sensor_info.h:204
double resolution
Angle between two scan points (radians).
Definition: sensor_info.h:198
unsigned int speed
Current motor speed (rpm).
Definition: sensor_info.h:178
std::string serial
Serial number of this device.
Definition: sensor_info.h:151
unsigned int standard_speed
Standard motor speed (rpm).
Definition: sensor_info.h:170
RotationDirection rot_dir
Rotation direction.
Definition: sensor_info.h:172
unsigned int min_range
Minimum detectable range (mm).
Definition: sensor_info.h:157
Sensor information.
Definition: sensor_info.h:127
double max_angle
Definition: sensor_info.h:196
Hokuyo laser scanner class.
Definition: sensor.h:121
std::string protocol
Protocol version in use.
Definition: sensor_info.h:149
 

Generated for GearBox by  doxygen 1.4.5