Apollo  6.0
Open source self driving car software
const_var.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 The Apollo Authors. All Rights Reserved.
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 #ifndef LIDAR_HESAI_CONST_VAR_H_
18 #define LIDAR_HESAI_CONST_VAR_H_
19 
20 namespace apollo {
21 namespace drivers {
22 namespace hesai {
23 
24 // hesai 40
25 const int SOB_ANGLE_SIZE = 4;
26 const int RAW_MEASURE_SIZE = 3;
27 const int LASER_COUNT = 40;
28 const int BLOCKS_PER_PACKET = 10;
29 const int BLOCK_SIZE = RAW_MEASURE_SIZE * LASER_COUNT + SOB_ANGLE_SIZE;
30 const int HESAI40_ONE_PACKET_POINTS = LASER_COUNT * BLOCKS_PER_PACKET;
31 const int HESAI40_MAX_PACKETS = 200;
32 const int HESAI40_MIN_PACKETS = 90;
33 
34 const int TIMESTAMP_SIZE = 4;
35 const int FACTORY_INFO_SIZE = 1;
36 const int ECHO_SIZE = 1;
37 const int RESERVE_SIZE = 8;
38 const int REVOLUTION_SIZE = 2;
39 
40 const int INFO_SIZE = (TIMESTAMP_SIZE + FACTORY_INFO_SIZE + ECHO_SIZE +
41  RESERVE_SIZE + REVOLUTION_SIZE);
42 const int UTC_TIME = 6;
43 const int UDP_SEQUENCE_SIZE = 4;
44 const int PACKET_SIZE = (BLOCK_SIZE * BLOCKS_PER_PACKET + INFO_SIZE + UTC_TIME);
45 const int PACKET_SIZE_WITH_UDPSEQ = (PACKET_SIZE + UDP_SEQUENCE_SIZE);
46 const double LASER_RETURN_TO_DISTANCE_RATE = 0.004;
47 
48 // hesai 64
49 const int HEAD_SIZE = 8;
50 const int BLOCKS_PER_PACKET_L64 = 6;
51 const int BLOCK_AZIMUTH_SIZE = 2;
52 const int LASER_COUNT_L64 = 64;
53 const int HS_LIDAR_L64_UNIT_SIZE = 3;
54 const int BLOCK_SIZE_L64 =
55  (HS_LIDAR_L64_UNIT_SIZE * LASER_COUNT_L64 + BLOCK_AZIMUTH_SIZE);
56 const int ENGINE_VELOCITY_SIZE = 2;
57 const int PACKET_SIZE_L64 =
58  HEAD_SIZE + BLOCK_SIZE_L64 * BLOCKS_PER_PACKET_L64 + INFO_SIZE + UTC_TIME;
59 const int PACKET_SIZE_L64_WITH_UDPSEQ = (PACKET_SIZE_L64 + UDP_SEQUENCE_SIZE);
60 const int HESAI64_ONE_PACKET_POINTS = LASER_COUNT_L64 * BLOCKS_PER_PACKET_L64;
61 const int HESAI64_MAX_PACKETS = 350;
62 const int HESAI64_MIN_PACKETS = 150;
63 
64 const int ETHERNET_MTU = 1500;
65 
66 // gps
67 const int GPS_PACKET_SIZE = 512;
68 const int GPS_PACKET_FLAG_SIZE = 2;
69 const int GPS_PACKET_YEAR_SIZE = 2;
70 const int GPS_PACKET_MONTH_SIZE = 2;
71 const int GPS_PACKET_DAY_SIZE = 2;
72 const int GPS_PACKET_HOUR_SIZE = 2;
73 const int GPS_PACKET_MINUTE_SIZE = 2;
74 const int GPS_PACKET_SECOND_SIZE = 2;
75 const int GPS_ITEM_NUM = 7;
76 
77 const double PI = 3.14159265358979323846;
78 
79 static const double pandar40p_elev_angle_map[] = {
80  6.96, 5.976, 4.988, 3.996, 2.999, 2.001, 1.667, 1.333,
81  1.001, 0.667, 0.333, 0, -0.334, -0.667, -1.001, -1.334,
82  -1.667, -2.001, -2.331, -2.667, -3, -3.327, -3.663, -3.996,
83  -4.321, -4.657, -4.986, -5.311, -5.647, -5.974, -6.957, -7.934,
84  -8.908, -9.871, -10.826, -11.772, -12.705, -13.63, -14.543, -15.444};
85 
86 static const double pandarGeneral_elev_angle_map[] = {
87  14.882, 11.032, 8.059, 5.057, 3.04, 2.028, 1.86, 1.688,
88  1.522, 1.351, 1.184, 1.013, 0.846, 0.675, 0.508, 0.337,
89  0.169, 0, -0.169, -0.337, -0.508, -0.675, -0.845, -1.013,
90  -1.184, -1.351, -1.522, -1.688, -1.86, -2.028, -2.198, -2.365,
91  -2.536, -2.7, -2.873, -3.04, -3.21, -3.375, -3.548, -3.712,
92  -3.884, -4.05, -4.221, -4.385, -4.558, -4.72, -4.892, -5.057,
93  -5.229, -5.391, -5.565, -5.726, -5.898, -6.061, -7.063, -8.059,
94  -9.06, -9.885, -11.032, -12.006, -12.974, -13.93, -18.889, -24.897};
95 
96 static const double pandar40p_horizatal_azimuth_offset_map[] = {
97  0.005, 0.006, 0.006, 0.006, -2.479, -2.479, 2.491, -4.953,
98  -2.479, 2.492, -4.953, -2.479, 2.492, -4.953, 0.007, 2.491,
99  -4.953, 0.006, 4.961, -2.479, 0.006, 4.96, -2.478, 0.006,
100  4.958, -2.478, 2.488, 4.956, -2.477, 2.487, 2.485, 2.483,
101  0.004, 0.004, 0.003, 0.003, -2.466, -2.463, -2.46, -2.457};
102 
103 static const double pandarGeneral_horizatal_azimuth_offset_map[] = {
104  -1.042, -1.042, -1.042, -1.042, -1.042, -1.042, 1.042, 3.125,
105  5.208, -5.208, -3.125, -1.042, 1.042, 3.125, 5.208, -5.208,
106  -3.125, -1.042, 1.042, 3.125, 5.208, -5.208, -3.125, -1.042,
107  1.042, 3.125, 5.208, -5.208, -3.125, -1.042, 1.042, 3.125,
108  5.208, -5.208, -3.125, -1.042, 1.042, 3.125, 5.208, -5.208,
109  -3.125, -1.042, 1.042, 3.125, 5.208, -5.208, -3.125, -1.042,
110  1.042, 3.125, 5.208, -5.208, -3.125, -1.042, -1.042, -1.042,
111  -1.042, -1.042, -1.042, -1.042, -1.042, -1.042, -1.042, -1.042};
112 
113 } // namespace hesai
114 } // namespace drivers
115 } // namespace apollo
116 
117 #endif
const int HESAI64_MAX_PACKETS
Definition: const_var.h:61
const int GPS_ITEM_NUM
Definition: const_var.h:75
const int GPS_PACKET_HOUR_SIZE
Definition: const_var.h:72
const int FACTORY_INFO_SIZE
Definition: const_var.h:35
const int HEAD_SIZE
Definition: const_var.h:49
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
const int UDP_SEQUENCE_SIZE
Definition: const_var.h:43
const int PACKET_SIZE
Definition: const_var.h:44
const int HESAI64_ONE_PACKET_POINTS
Definition: const_var.h:60
const int GPS_PACKET_SIZE
Definition: const_var.h:67
const int UTC_TIME
Definition: const_var.h:42
const int GPS_PACKET_MONTH_SIZE
Definition: const_var.h:70
const int BLOCK_AZIMUTH_SIZE
Definition: const_var.h:51
const int INFO_SIZE
Definition: const_var.h:40
const int ENGINE_VELOCITY_SIZE
Definition: const_var.h:56
const double LASER_RETURN_TO_DISTANCE_RATE
Definition: const_var.h:46
const double PI
Definition: const_var.h:77
const int BLOCK_SIZE
Definition: const_var.h:29
const int HS_LIDAR_L64_UNIT_SIZE
Definition: const_var.h:53
const int LASER_COUNT
Definition: const_var.h:27
const int GPS_PACKET_YEAR_SIZE
Definition: const_var.h:69
const int PACKET_SIZE_L64_WITH_UDPSEQ
Definition: const_var.h:59
const int GPS_PACKET_SECOND_SIZE
Definition: const_var.h:74
const int REVOLUTION_SIZE
Definition: const_var.h:38
const int GPS_PACKET_MINUTE_SIZE
Definition: const_var.h:73
const int BLOCKS_PER_PACKET_L64
Definition: const_var.h:50
const int ETHERNET_MTU
Definition: const_var.h:64
const int BLOCKS_PER_PACKET
Definition: const_var.h:28
const int LASER_COUNT_L64
Definition: const_var.h:52
const int SOB_ANGLE_SIZE
Definition: const_var.h:25
const int GPS_PACKET_FLAG_SIZE
Definition: const_var.h:68
const int RAW_MEASURE_SIZE
Definition: const_var.h:26
const int GPS_PACKET_DAY_SIZE
Definition: const_var.h:71
const int HESAI40_MIN_PACKETS
Definition: const_var.h:32
const int BLOCK_SIZE_L64
Definition: const_var.h:54
const int ECHO_SIZE
Definition: const_var.h:36
const int PACKET_SIZE_WITH_UDPSEQ
Definition: const_var.h:45
const int HESAI40_ONE_PACKET_POINTS
Definition: const_var.h:30
const int HESAI40_MAX_PACKETS
Definition: const_var.h:31
const int TIMESTAMP_SIZE
Definition: const_var.h:34
const int PACKET_SIZE_L64
Definition: const_var.h:57
const int HESAI64_MIN_PACKETS
Definition: const_var.h:62
const int RESERVE_SIZE
Definition: const_var.h:37