提交 | 用户 | age
|
842bb6
|
1 |
/** |
Q |
2 |
****************************************************************************** |
|
3 |
* @file : YDLidar.h |
|
4 |
* @brief : Header for YDLidar.c file. |
|
5 |
* This file contains the Lidar defines of the application. |
|
6 |
****************************************************************************** |
|
7 |
*/ |
|
8 |
|
|
9 |
#ifndef __YDLIDAR_H__ |
|
10 |
#define __YDLIDAR_H__ |
|
11 |
|
|
12 |
#define YDLIDAR_VER (0x100) |
|
13 |
#pragma anon_unions |
|
14 |
|
|
15 |
typedef struct LidarDotData |
|
16 |
{ |
|
17 |
unsigned char intensity; |
|
18 |
unsigned char s1; |
|
19 |
/* |
|
20 |
struct { |
|
21 |
unsigned char flag:2; |
|
22 |
unsigned char s1:6; |
|
23 |
}; |
|
24 |
*/ |
|
25 |
unsigned char s2; |
|
26 |
}stLidarDotData; |
|
27 |
|
|
28 |
typedef struct tagLidarDotsPkt |
|
29 |
{ |
|
30 |
unsigned short StSign; |
|
31 |
unsigned char CT; |
|
32 |
unsigned char LSN; |
|
33 |
unsigned short FSA; |
|
34 |
unsigned short LSA; |
|
35 |
unsigned short CS; |
|
36 |
stLidarDotData LidarDotDatas[40]; |
|
37 |
|
|
38 |
}stLidarDotsPkt, *pLidarDotsPkt; |
|
39 |
|
|
40 |
|
|
41 |
typedef struct tagLidarVector |
|
42 |
{ |
|
43 |
int intensit; |
|
44 |
int angle; |
|
45 |
int value; |
|
46 |
}stLidarVector; |
|
47 |
|
|
48 |
typedef struct tagLidarDot |
|
49 |
{ |
|
50 |
int x; |
|
51 |
int y; |
|
52 |
int distance; |
|
53 |
}stLidarDot; |
|
54 |
|
|
55 |
|
|
56 |
extern int nPosX; |
|
57 |
extern int nPosY; |
|
58 |
extern int nPosZ; |
|
59 |
extern int nPosZ1, nPosZ2; |
|
60 |
|
|
61 |
extern int pCount1; |
|
62 |
extern int pCount2; |
|
63 |
|
|
64 |
extern int dCount1; |
|
65 |
extern int dCount2; |
|
66 |
|
|
67 |
extern int vCount1; |
|
68 |
extern int vCount2; |
|
69 |
|
|
70 |
|
|
71 |
int YdLidarStart(int nIdx); /* Start LiDar Running , nIde = 0 , 1 , -1 == ALL */ |
|
72 |
int YdLidarStop(int nIdx); /* stop Lidar Running , nIde = 0 , 1 , -1 == ALL */ |
|
73 |
|
|
74 |
|
|
75 |
int YdLidarParsePkt(int nLidarIdx, stLidarDotsPkt * pLindarPkt, int len1); |
|
76 |
|
|
77 |
|
|
78 |
#endif /* __YDLIDAR_H__ */ |
|
79 |
|