lms1xx.h
Go to the documentation of this file.
1 /*
2  * LMS1xx.h
3  *
4  * Created on: 09-08-2010
5  * Author: Konrad Banachowicz
6  ***************************************************************************
7  * This library is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU Lesser General Public *
9  * License as published by the Free Software Foundation; either *
10  * version 2.1 of the License, or (at your option) any later version. *
11  * *
12  * This library is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * Lesser General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Lesser General Public *
18  * License along with this library; if not, write to the Free Software *
19  * Foundation, Inc., 59 Temple Place, *
20  * Suite 330, Boston, MA 02111-1307 USA *
21  * *
22  ***************************************************************************/
23 
24 #ifndef LMS1XX_H_
25 #define LMS1XX_H_
26 
27 #include <string>
28 #include <stdint.h>
29 
36 typedef struct _scanCfg {
42 
48 
54 
59  int stopAngle;
60 } scanCfg;
61 
68 typedef struct _scanDataCfg {
69 
75 
80  bool remission;
81 
87 
92  int encoder;
93 
98  bool position;
99 
105 
106  bool timestamp;
107 
118 } scanDataCfg;
119 
126 typedef struct _scanData {
127 
133 
138  uint16_t dist1[1082];
139 
145 
150  uint16_t dist2[1082];
151 
157 
162  uint16_t rssi1[1082];
163 
169 
174  uint16_t rssi2[1082];
175 } scanData;
176 
177 typedef enum {
181  idle = 3,
182  rotated = 4,
184  ready = 6,
186 } status_t;
187 
195 class LMS1xx {
196 public:
197  LMS1xx();
198  virtual ~LMS1xx();
199 
205  void connect(std::string host, int port = 2111);
206 
210  void disconnect();
211 
216  bool isConnected();
217 
222  void startMeas();
223 
228  void stopMeas();
229 
235 
240  void login();
241 
251  scanCfg getScanCfg() const;
252 
262  void setScanCfg(const scanCfg &cfg);
263 
269  void setScanDataCfg(const scanDataCfg &cfg);
270 
276  void scanContinous(int start);
277 
283  void getData(scanData& data);
284 
290  void saveConfig();
291 
296  void startDevice();
297 
298 private:
299  bool connected;
300  bool debug;
301 
302  int sockDesc;
303 };
304 
305 #endif /* LMS1XX_H_ */
int outputInterval
Output interval. Defines which scan is output.
Definition: lms1xx.h:117
struct _scanCfg scanCfg
uint16_t rssi1[1082]
Remission values for the first reflected pulse.
Definition: lms1xx.h:162
status_t
Definition: lms1xx.h:177
bool debug
Definition: lms1xx.h:300
void setScanDataCfg(const scanDataCfg &cfg)
Set scan data configuration. Set format of scan message returned by device.
Definition: lms1xx.cpp:171
scanCfg getScanCfg() const
Get current scan configuration. Get scan configuration :
Definition: lms1xx.cpp:138
bool deviceName
Device name. Determines whether the device name is to be output.
Definition: lms1xx.h:104
int resolution
Remission resolution. Defines whether the remission values are output with 8-bit or 16bit resolution...
Definition: lms1xx.h:86
Definition: lms1xx.h:184
status_t queryStatus()
Get current status of LMS1xx device.
Definition: lms1xx.cpp:104
int dist_len2
Number of samples in dist2.
Definition: lms1xx.h:144
int angleResolution
Scanning resolution. 1/10000 degree.
Definition: lms1xx.h:47
int rssi_len1
Number of samples in rssi1.
Definition: lms1xx.h:156
bool timestamp
Definition: lms1xx.h:106
bool remission
Remission. Defines whether remission values are output.
Definition: lms1xx.h:80
void login()
Log into LMS1xx unit. Increase privilege level, giving ability to change device configuration.
Definition: lms1xx.cpp:123
int scaningFrequency
Scanning frequency. 1/100 Hz.
Definition: lms1xx.h:41
uint16_t dist1[1082]
Radial distance for the first reflected pulse.
Definition: lms1xx.h:138
bool position
Position. Defines whether position values are output.
Definition: lms1xx.h:98
void stopMeas()
Stop measurements. After receiving this command LMS1xx unit stop spinning laser and measuring...
Definition: lms1xx.cpp:89
Structure containing single scan message.
Structure containing scan configuration.
void setScanCfg(const scanCfg &cfg)
Set scan configuration. Get scan configuration :
Definition: lms1xx.cpp:158
uint16_t rssi2[1082]
Remission values for the second reflected pulse.
Definition: lms1xx.h:174
int startAngle
Start angle. 1/10000 degree.
Definition: lms1xx.h:53
void startDevice()
The device is returned to the measurement mode after configuration.
Definition: lms1xx.cpp:386
void scanContinous(int start)
Start or stop continuous data acquisition. After reception of this command device start or stop conti...
Definition: lms1xx.cpp:185
bool connected
Definition: lms1xx.h:299
int stopAngle
Stop angle. 1/10000 degree.
Definition: lms1xx.h:59
void startMeas()
Start measurements. After receiving this command LMS1xx unit starts spinning laser and measuring...
Definition: lms1xx.cpp:74
bool isConnected()
Get status of connection.
Definition: lms1xx.cpp:70
void disconnect()
Disconnect from LMS1xx device.
Definition: lms1xx.cpp:63
void connect(std::string host, int port=2111)
Connect to LMS1xx.
Definition: lms1xx.cpp:44
uint16_t dist2[1082]
Radial distance for the second reflected pulse.
Definition: lms1xx.h:150
struct _scanDataCfg scanDataCfg
Definition: lms1xx.h:181
void getData(scanData &data)
Receive single scan message.
Definition: lms1xx.cpp:207
LMS1xx()
Definition: lms1xx.cpp:35
struct _scanData scanData
void saveConfig()
Save data permanently. Parameters are saved in the EEPROM of the LMS and will also be available after...
Definition: lms1xx.cpp:371
Structure containing scan data configuration.
int encoder
Encoders channels. Defines which output channel is activated.
Definition: lms1xx.h:92
Class responsible for communicating with LMS1xx device.
Definition: lms1xx.h:195
int rssi_len2
Number of samples in rssi2.
Definition: lms1xx.h:168
int sockDesc
Definition: lms1xx.h:302
int outputChannel
Output channels. Defines which output channel is activated.
Definition: lms1xx.h:74
virtual ~LMS1xx()
Definition: lms1xx.cpp:40
int dist_len1
Number of samples in dist1.
Definition: lms1xx.h:132


lms1xx
Author(s): Konrad Banachowicz
autogenerated on Mon Mar 2 2015 01:32:13