lms1xx.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef LMS1XX_H_
19 #define LMS1XX_H_
20 
21 #include <string>
22 #include <stdint.h>
23 
30 typedef struct _scanCfg {
36 
42 
48 
53  int stopAngle;
54 } scanCfg;
55 
62 typedef struct _scanDataCfg {
63 
69 
74  bool remission;
75 
81 
86  int encoder;
87 
92  bool position;
93 
98  bool deviceName;
99 
100  bool timestamp;
101 
112 } scanDataCfg;
113 
120 typedef struct _scanData {
121 
127 
132  uint16_t dist1[1082];
133 
139 
144  uint16_t dist2[1082];
145 
151 
156  uint16_t rssi1[1082];
157 
163 
168  uint16_t rssi2[1082];
169 } scanData;
170 
171 typedef enum {
175  idle = 3,
176  rotated = 4,
178  ready = 6,
180 } status_t;
181 
189 class LMS1xx {
190 public:
191  LMS1xx();
192  virtual ~LMS1xx();
193 
199  void connect(std::string host, int port = 2111);
200 
204  void disconnect();
205 
210  bool isConnected();
211 
216  void startMeas();
217 
222  void stopMeas();
223 
228  status_t queryStatus();
229 
234  void login();
235 
245  scanCfg getScanCfg() const;
246 
256  void setScanCfg(const scanCfg &cfg);
257 
263  void setScanDataCfg(const scanDataCfg &cfg);
264 
270  void scanContinous(int start);
271 
277  bool getData(scanData& data);
278 
284  void saveConfig();
285 
290  void startDevice();
291 
292 private:
293  bool connected;
294  bool debug;
295 
296  int sockDesc;
297 };
298 
299 #endif /* LMS1XX_H_ */
int outputInterval
Output interval. Defines which scan is output.
Definition: lms1xx.h:111
struct _scanCfg scanCfg
status_t
Definition: lms1xx.h:171
bool debug
Definition: lms1xx.h:294
ROSCPP_DECL void start()
bool deviceName
Device name. Determines whether the device name is to be output.
Definition: lms1xx.h:98
int resolution
Remission resolution. Defines whether the remission values are output with 8-bit or 16bit resolution...
Definition: lms1xx.h:80
Definition: lms1xx.h:178
int dist_len2
Number of samples in dist2.
Definition: lms1xx.h:138
int angleResolution
Scanning resolution. 1/10000 degree.
Definition: lms1xx.h:41
int rssi_len1
Number of samples in rssi1.
Definition: lms1xx.h:150
bool timestamp
Definition: lms1xx.h:100
bool remission
Remission. Defines whether remission values are output.
Definition: lms1xx.h:74
int scaningFrequency
Scanning frequency. 1/100 Hz.
Definition: lms1xx.h:35
bool position
Position. Defines whether position values are output.
Definition: lms1xx.h:92
Structure containing single scan message.
Structure containing scan configuration.
int startAngle
Start angle. 1/10000 degree.
Definition: lms1xx.h:47
bool connected
Definition: lms1xx.h:293
int stopAngle
Stop angle. 1/10000 degree.
Definition: lms1xx.h:53
struct _scanDataCfg scanDataCfg
Definition: lms1xx.h:175
struct _scanData scanData
Structure containing scan data configuration.
int encoder
Encoders channels. Defines which output channel is activated.
Definition: lms1xx.h:86
Class responsible for communicating with LMS1xx device.
Definition: lms1xx.h:189
int rssi_len2
Number of samples in rssi2.
Definition: lms1xx.h:162
int sockDesc
Definition: lms1xx.h:296
int outputChannel
Output channels. Defines which output channel is activated.
Definition: lms1xx.h:68
int dist_len1
Number of samples in dist1.
Definition: lms1xx.h:126


cob_sick_lms1xx
Author(s): Konrad Banachowicz
autogenerated on Wed Apr 7 2021 02:11:49