Livox SDK API  V1.1.0
livox_def.h
Go to the documentation of this file.
1 //
2 // The MIT License (MIT)
3 //
4 // Copyright (c) 2019 Livox. All rights reserved.
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in
14 // all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 //
24 
25 #ifndef LIVOX_DEF_H_
26 #define LIVOX_DEF_H_
27 
28 #include <stdint.h>
29 
30 #define kMaxLidarCount 32
31 
33 typedef enum {
38 } DeviceType;
39 
41 typedef enum {
48 } LidarState;
49 
51 typedef enum {
55 } LidarMode;
56 
58 typedef enum {
61 } LidarFeature;
62 
64 typedef enum {
72 
74 typedef enum {
78 } DeviceEvent;
79 
81 typedef enum {
89 
90 #pragma pack(1)
91 
92 #define LIVOX_SDK_MAJOR_VERSION 1
93 #define LIVOX_SDK_MINOR_VERSION 1
94 #define LIVOX_SDK_PATCH_VERSION 0
95 
96 #define kBroadcastCodeSize 16
97 
99 typedef struct {
100  int major;
101  int minor;
102  int patch;
104 
106 typedef struct {
107  int32_t x;
108  int32_t y;
109  int32_t z;
110  uint8_t reflectivity;
111 } LivoxRawPoint;
112 
114 typedef struct {
115  float x;
116  float y;
117  float z;
118  uint8_t reflectivity;
119 } LivoxPoint;
120 
122 typedef struct {
123  uint8_t version;
124  uint8_t slot;
125  uint8_t id;
126  uint8_t rsvd;
127  uint32_t err_code;
128  uint8_t timestamp_type;
130  uint8_t data_type;
131  uint8_t timestamp[8];
132  uint8_t data[1];
134 
136 typedef union {
137  uint32_t status_code;
138  uint32_t progress;
139 } StatusUnion;
140 
142 typedef struct {
143  char broadcast_code[kBroadcastCodeSize];
144  uint8_t handle;
145  uint8_t slot;
146  uint8_t id;
147  uint32_t type;
148  uint16_t data_port;
149  uint16_t cmd_port;
150  char ip[16];
154 } DeviceInfo;
155 
157 typedef struct {
158  char broadcast_code[kBroadcastCodeSize];
159  uint8_t dev_type;
160  uint16_t reserved;
162 
164 typedef struct {
165  char broadcast_code[kBroadcastCodeSize];
166  uint8_t dev_type;
167  uint8_t version[4];
168  uint8_t slot;
169  uint8_t id;
171 
173 typedef struct {
174  char broadcast_code[kBroadcastCodeSize];
175  uint8_t state;
177 
178 typedef struct {
179  uint8_t ret_code;
180  char broadcast_code[kBroadcastCodeSize];
181 } ReturnCode;
182 
183 typedef struct {
184  char broadcast_code[kBroadcastCodeSize];
186 
187 typedef struct {
188  char broadcast_code[kBroadcastCodeSize];
189  uint8_t feature;
191 
193 typedef struct {
194  char broadcast_code[kBroadcastCodeSize];
195  float roll;
196  float pitch;
197  float yaw;
198  int32_t x;
199  int32_t y;
200  int32_t z;
202 
204 typedef struct {
205  uint8_t ret_code;
206  char broadcast_code[kBroadcastCodeSize];
207  float roll;
208  float pitch;
209  float yaw;
210  int32_t x;
211  int32_t y;
212  int32_t z;
214 
215 typedef struct {
216  char broadcast_code[kBroadcastCodeSize];
217  uint8_t state;
218  uint8_t feature;
221 
225 typedef struct {
226  uint32_t ip_addr;
227  uint16_t data_port;
228  uint16_t cmd_port;
230 
234 typedef struct {
235  uint8_t ret_code;
236  uint8_t firmware_version[4];
238 
242 typedef struct {
243  uint32_t error_code;
244 } ErrorMessage;
245 
249 typedef struct {
250  uint8_t ip_mode;
251  uint32_t ip_addr;
253 
257 typedef struct {
258  uint8_t ret_code;
259  uint8_t ip_mode;
260  uint32_t ip_addr;
262 
266 typedef struct {
267  uint8_t ret_code;
268  uint8_t state;
269  uint8_t feature;
272 
276 typedef struct {
277  float roll;
278  float pitch;
279  float yaw;
280  int32_t x;
281  int32_t y;
282  int32_t z;
284 
288 typedef struct {
289  uint8_t ret_code;
290  float roll;
291  float pitch;
292  float yaw;
293  int32_t x;
294  int32_t y;
295  int32_t z;
297 
301 typedef struct {
302  uint8_t ret_code;
303  uint8_t count;
304  ConnectedLidarInfo device_info_list[1];
306 
310 typedef struct {
311  uint8_t count;
312  LidarModeRequestItem config_list[1];
314 
318 typedef struct {
319  uint8_t ret_code;
320  uint8_t count;
321  ReturnCode ret_state_list[1];
323 
327 typedef struct {
328  uint8_t slot;
329  uint8_t state;
331 
335 typedef struct {
336  uint8_t count;
337  ExtrinsicParameterRequestItem parameter_list[1];
339 
343 typedef struct {
344  uint8_t ret_code;
345  uint8_t count;
346  ReturnCode ret_code_list[1];
348 
352 typedef struct {
353  uint8_t count;
354  DeviceBroadcastCode code_list[1];
356 
360 typedef struct {
361  uint8_t ret_code;
362  uint8_t count;
363  ExtrinsicParameterResponseItem parameter_list[1];
365 
369 typedef struct {
370  uint8_t ret_code;
371  uint8_t count;
372  LidarStateItem state_list[1];
374 
378 typedef struct {
379  uint8_t count;
380  RainFogSuppressRequestItem lidar_cfg_list[1];
382 
386 typedef struct {
387  uint8_t ret_code;
388  uint8_t count;
389  ReturnCode ret_state_list[1];
391 
392 #pragma pack()
393 
394 #endif // LIVOX_DEF_H_
uint32_t type
Definition: livox_def.h:147
uint8_t reflectivity
Definition: livox_def.h:118
uint8_t feature
Definition: livox_def.h:218
LidarFeature feature
Definition: livox_def.h:152
uint8_t reflectivity
Definition: livox_def.h:110
DeviceEvent
Definition: livox_def.h:74
uint8_t slot
Definition: livox_def.h:124
LidarState
Definition: livox_def.h:41
uint16_t data_port
Definition: livox_def.h:227
uint8_t rsvd
Definition: livox_def.h:126
uint16_t cmd_port
Definition: livox_def.h:149
ResponseStatus
Definition: livox_def.h:64
uint8_t state
Definition: livox_def.h:217
int32_t z
Definition: livox_def.h:109
uint8_t timestamp_type
Definition: livox_def.h:128
LidarFeature
Definition: livox_def.h:58
uint32_t status_code
Definition: livox_def.h:137
TimestampType
Definition: livox_def.h:81
StatusUnion error_union
Definition: livox_def.h:270
uint8_t slot
Definition: livox_def.h:145
uint8_t handle
Definition: livox_def.h:144
StatusUnion status
Definition: livox_def.h:153
basic_data data
Definition: format.h:764
DeviceType
Definition: livox_def.h:33
float y
Definition: livox_def.h:116
int32_t y
Definition: livox_def.h:108
uint8_t ret_code
Definition: livox_def.h:267
StatusUnion error_union
Definition: livox_def.h:219
#define kBroadcastCodeSize
Definition: livox_def.h:96
uint32_t progress
Definition: livox_def.h:138
uint32_t error_code
Definition: livox_def.h:243
LidarMode
Definition: livox_def.h:51
LidarState state
Definition: livox_def.h:151
int32_t x
Definition: livox_def.h:107
float z
Definition: livox_def.h:117
uint8_t data_type
Definition: livox_def.h:130
uint8_t version
Definition: livox_def.h:123
uint32_t err_code
Definition: livox_def.h:127
uint8_t id
Definition: livox_def.h:125
uint8_t ret_code
Definition: livox_def.h:179
uint16_t data_port
Definition: livox_def.h:148
uint32_t ip_addr
Definition: livox_def.h:226
uint16_t cmd_port
Definition: livox_def.h:228
uint8_t id
Definition: livox_def.h:146
float x
Definition: livox_def.h:115