Apollo  6.0
Open source self driving car software
type_defs.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_SRC_TYPE_DEFS_H_
18 #define LIDAR_HESAI_SRC_TYPE_DEFS_H_
19 
20 #include <ctime>
22 
23 namespace apollo {
24 namespace drivers {
25 namespace hesai {
26 
27 typedef struct HesaiPacket {
28  double stamp;
29  uint8_t data[ETHERNET_MTU];
30  uint32_t size;
31 } HesaiPacket;
32 
33 /**************Hesai40P****************************/
34 typedef struct Hesai40PUnit {
35  uint8_t intensity;
36  double distance;
37 } Hesai40PUnit;
38 
39 typedef struct Hesai40PBlock {
40  uint16_t azimuth;
41  uint16_t sob;
44 
45 typedef struct Hesai40Packet {
47  struct tm t;
48  uint32_t usec;
49  int echo;
51 
52 /************Hesai64*******************************/
53 typedef struct Hesai64Header {
54  uint16_t sob; // 0xFFEE 2bytes
55  uint8_t chLaserNumber; // laser number 1byte
56  uint8_t chBlockNumber; // block number 1byte
57  uint8_t chReturnType; // return mode 1 byte
58  // when dual return 0
59  // Single Return
60  // 1-The first block is the 1 st return.
61  // 2-The first block is the 2 nd return
62  uint8_t chDisUnit; // Distance unit, 6mm/5mm/4mm
63  public:
65  sob = 0;
66  chLaserNumber = 0;
67  chBlockNumber = 0;
68  chReturnType = 0;
69  chDisUnit = 0;
70  }
72 
73 typedef struct Hesai64Unit {
74  double distance;
75  uint8_t reflectivity; // reflectivity
76 } Hesai64Unit;
77 
78 typedef struct Hesai64Block {
79  uint16_t azimuth; // packet angle ,Azimuth = RealAzimuth * 100
81 } Hesai64Block;
82 
83 typedef struct Hesai64Packet {
86  uint8_t echo;
87  unsigned int timestamp; // ms
88  unsigned char utc_time[UTC_TIME];
90 
91 /***************GPS****************************/
92 typedef struct GPS {
93  uint16_t flag;
94  uint16_t year;
95  uint16_t month;
96  uint16_t day;
97  uint16_t second;
98  uint16_t minute;
99  uint16_t hour;
100  uint32_t fineTime;
101 } Gps;
102 
103 } // namespace hesai
104 } // namespace drivers
105 } // namespace apollo
106 
107 #endif
uint8_t chLaserNumber
Definition: type_defs.h:55
struct apollo::drivers::hesai::Hesai40PBlock Hesai40PBlock
unsigned int timestamp
Definition: type_defs.h:87
uint8_t reflectivity
Definition: type_defs.h:75
struct apollo::drivers::hesai::Hesai64Unit Hesai64Unit
uint16_t year
Definition: type_defs.h:94
Definition: type_defs.h:34
struct apollo::drivers::hesai::HesaiPacket HesaiPacket
Definition: type_defs.h:83
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Hesai64Header()
Definition: type_defs.h:64
uint16_t sob
Definition: type_defs.h:54
int echo
Definition: type_defs.h:49
uint16_t day
Definition: type_defs.h:96
struct apollo::drivers::hesai::Hesai64Block Hesai64Block
double distance
Definition: type_defs.h:36
Definition: type_defs.h:73
const int UTC_TIME
Definition: const_var.h:42
uint16_t second
Definition: type_defs.h:97
Definition: type_defs.h:78
uint16_t minute
Definition: type_defs.h:98
struct apollo::drivers::hesai::Hesai40Packet Hesai40Packet
uint8_t echo
Definition: type_defs.h:86
uint32_t usec
Definition: type_defs.h:48
uint16_t flag
Definition: type_defs.h:93
const int LASER_COUNT
Definition: const_var.h:27
struct apollo::drivers::hesai::Hesai64Header Hesai64Header
Definition: type_defs.h:39
uint16_t month
Definition: type_defs.h:95
uint8_t intensity
Definition: type_defs.h:35
struct apollo::drivers::hesai::GPS Gps
uint32_t size
Definition: type_defs.h:30
uint32_t fineTime
Definition: type_defs.h:100
const int BLOCKS_PER_PACKET_L64
Definition: const_var.h:50
const int ETHERNET_MTU
Definition: const_var.h:64
uint8_t chReturnType
Definition: type_defs.h:57
uint16_t azimuth
Definition: type_defs.h:40
const int BLOCKS_PER_PACKET
Definition: const_var.h:28
const int LASER_COUNT_L64
Definition: const_var.h:52
uint16_t sob
Definition: type_defs.h:41
uint8_t chBlockNumber
Definition: type_defs.h:56
uint16_t azimuth
Definition: type_defs.h:79
Definition: type_defs.h:45
Definition: type_defs.h:27
Definition: type_defs.h:92
Definition: type_defs.h:53
double stamp
Definition: type_defs.h:28
struct apollo::drivers::hesai::Hesai64Packet Hesai64Packet
uint8_t chDisUnit
Definition: type_defs.h:62
struct apollo::drivers::hesai::Hesai40PUnit Hesai40PUnit
uint8_t data[ETHERNET_MTU]
Definition: type_defs.h:29
Hesai64Header header
Definition: type_defs.h:84
uint16_t hour
Definition: type_defs.h:99
double distance
Definition: type_defs.h:74