Multi-laser radar data output method, device, equipment and storage medium

By processing point cloud data collected by multiple lidars and inputting them into the radar thread queue, and determining and outputting frame data that meets the conditions, the problems of unstable and inefficient lidar data output in the existing technology are solved, and more efficient data synchronization output is achieved.

CN112035281BActive Publication Date: 2025-05-23ANHUI JIANGHUAI AUTOMOBILE GRP CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010902750.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-31
Publication Date
2025-05-23
Estimated Expiration
2040-08-31

AI Technical Summary

Technical Problem

In the prior art, when synchronous output of multi-lidar data, GPS modules or thread locks are required, resulting in unstable data output and inefficient efficiency.

Method used

By obtaining multiple point cloud data collected by preset lidar, processing framed data, and inputting frame data into the radar thread queue, determining whether the preset data synchronization conditions are met, and outputting them if they are met.

Benefits of technology

The synchronous and stable output of lidar data is realized, the data output efficiency is improved, and the efficiency reduction caused by thread locks is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112035281B_ABST
    Figure CN112035281B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of vehicle technology, and discloses a method, device, equipment and storage medium for outputting data of multiple laser radars, the method comprising: obtaining multiple point cloud data collected by a preset laser radar; processing the multiple point cloud data to obtain frame data, and inputting the frame data into a radar thread queue; judging whether the frame data in the radar thread queue meets a preset data synchronization condition; and outputting the frame data in the radar thread queue when the preset data synchronization condition is met. Since the prior art requires a GPS module or a thread lock to complete the synchronous output of multiple laser radar data, it will lead to low operating efficiency, while the present invention obtains frame data based on point cloud data, and then inputs the frame data into the radar thread queue, and directly outputs the frame data when the preset data synchronization condition is met, thereby ensuring that the laser radar data is synchronously and stably output while improving the output efficiency of the laser radar data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle technology, and in particular to a multi-laser radar data output method, device, equipment and storage medium. Background Art

[0002] With the vigorous development of fields such as unmanned driving and autonomous mobile robots, laser radar has been widely used due to its high angular resolution, high distance resolution, high speed resolution, wide speed measurement range, strong anti-interference ability and other characteristics. Through laser radar, environmental modeling, obstacle detection, navigation and positioning and other perception functions can be realized. In the prior art, when the data collected by multiple laser radars are synchronously output, it is necessary to use GPS modules or thread locks to complete data synchronization, but the use of thread locks reduces the efficiency of program operation to a certain extent, and it is difficult to ensure that the laser data can be output continuously and stably. Therefore, how to ensure the synchronous and stable output of laser radar data while improving the output efficiency of laser radar data is a technical problem that needs to be solved urgently.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a multi-lidar data output method, device, equipment and storage medium, aiming to solve the technical problem of how to ensure the synchronous and stable output of lidar data while improving the output efficiency of lidar data.

[0005] To achieve the above object, the present invention provides a multi-laser radar data output method, the multi-laser radar data output method comprising the following steps:

[0006] Get multiple point cloud data collected by preset laser radar;

[0007] Processing the plurality of point cloud data to obtain frame data, and inputting the frame data into a radar thread queue;

[0008] Determine whether the frame data in the radar thread queue meets the preset data synchronization condition;

[0009] When the frame data in the radar thread queue meets the preset data synchronization condition, the frame data in the radar thread queue is output.

[0010] Preferably, before the step of acquiring a plurality of point cloud data collected by a preset laser radar, the step further includes:

[0011] Obtaining a vehicle motor speed frequency, and determining whether the vehicle motor speed frequency is equal to a preset frequency threshold;

[0012] When the vehicle motor speed frequency is equal to the preset frequency threshold, the step of acquiring multiple point cloud data collected by the preset laser radar is performed.

[0013] Preferably, the step of processing the plurality of point cloud data to obtain frame data comprises: classifying the plurality of point cloud data to obtain a plurality of groups of point cloud data packets;

[0014] Constructing a point cloud data set according to a plurality of groups of point cloud data packets;

[0015] Corresponding frame data is determined according to the point cloud data set.

[0016] Preferably, before the step of constructing a point cloud data set according to the plurality of groups of point cloud data packets, the step further includes:

[0017] Obtain the total number of horizontal azimuth angles corresponding to the multiple groups of point cloud data packets;

[0018] Determining whether the total number of horizontal azimuth angles is equal to a preset number threshold;

[0019] When the total number of horizontal azimuth angles is equal to the preset number threshold, the step of constructing a point cloud data set according to the multiple groups of point cloud data packets is performed.

[0020] Preferably, before the step of determining whether the total number of horizontal azimuth angles is equal to a preset number threshold, the method further comprises:

[0021] Obtaining the horizontal angle resolution corresponding to the preset laser radar;

[0022] Selecting a single point cloud data package from the multiple point cloud data packages;

[0023] Obtaining the number of basic horizontal azimuth angles corresponding to the single set of point cloud data packets;

[0024] Calculating a preset number threshold value by a preset formula according to the horizontal angle resolution and the number of basic horizontal azimuth angles;

[0025] The preset formula is:

[0026]

[0027] Where n 1 is the preset quantity threshold, γ is the horizontal angle resolution, and δ is the basic horizontal azimuth quantity.

[0028] Preferably, the step of inputting the frame data into the radar thread queue includes: obtaining a processing duration corresponding to the frame data;

[0029] Setting the input duration of the frame data according to the processing duration;

[0030] The frame data is input into a radar thread queue according to the input duration.

[0031] Preferably, before the step of inputting the frame data into the radar thread queue according to the input duration, the method further includes:

[0032] Get the initial number of frames in the radar thread queue;

[0033] Determining whether the radar thread queue is an empty queue according to the initial frame number;

[0034] When the radar thread queue is an empty queue, a step of inputting the frame data into the radar thread queue according to the input duration is performed.

[0035] In addition, to achieve the above-mentioned purpose, the present invention also proposes a multi-laser radar data output device, the multi-laser radar data output device comprising:

[0036] The acquisition module is used to obtain multiple point cloud data collected by the preset laser radar;

[0037] A processing module, used for processing the plurality of point cloud data to obtain frame data, and inputting the frame data into a radar thread queue;

[0038] A judgment module, used to judge whether the frame data in the radar thread queue meets the preset data synchronization condition;

[0039] The output module is used to output the frame data in the radar thread queue when the frame data in the radar thread queue meets the preset data synchronization condition.

[0040] In addition, to achieve the above-mentioned purpose, the present invention also proposes a multi-laser radar data output device, which includes: a memory, a processor, and a multi-laser radar data output program stored in the memory and executable on the processor, and when the multi-laser radar data output program is executed by the processor, the steps of the multi-laser radar data output method described above are implemented.

[0041] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a multi-laser radar data output program is stored, and when the multi-laser radar data output program is executed by a processor, the steps of the multi-laser radar data output method described above are implemented.

[0042] In the present invention, firstly, a plurality of point cloud data collected by a preset laser radar is obtained, and then the plurality of point cloud data are processed to obtain frame data, and the frame data is input into the radar thread queue, and then it is determined whether the frame data in the radar thread queue meets the preset data synchronization conditions, and when the frame data in the radar thread queue meets the preset data synchronization conditions, the frame data in the radar thread queue is output. Compared with the prior art, a GPS module or a thread lock is required to complete the synchronous output of multiple laser radar data, but it will cause the radar data output to be unstable and the data output efficiency to be low, while in the present invention, frame data is obtained according to the point cloud data, and then the frame data is input into the radar thread queue, and the frame data is directly output when the preset data synchronization conditions are met, thereby ensuring the synchronous and stable output of the laser radar data and improving the output efficiency of the laser radar data. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a structural schematic diagram of a multi-lidar data output device in a hardware operating environment involved in an embodiment of the present invention;

[0044] Figure 2 It is a flowchart of a first embodiment of a method for outputting multi-lidar data according to the present invention;

[0045] Figure 3 It is a flowchart of a second embodiment of the multi-lidar data output method of the present invention;

[0046] Figure 4 This is a structural block diagram of the first embodiment of the multi-laser radar data output device of the present invention.

[0047] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0049] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a multi-lidar data output device in the hardware operating environment involved in an embodiment of the present invention.

[0050] like Figure 1As shown, the multi-laser radar data output device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable memory (Non-volatile Memory, NVM), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0051] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation on the multi-lidar data output device and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0052] like Figure 1 As shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and a multi-lidar data output program.

[0053] exist Figure 1 In the multi-laser radar data output device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the multi-laser radar data output device calls the multi-laser radar data output program stored in the memory 1005 through the processor 1001, and executes the multi-laser radar data output method provided by the embodiment of the present invention.

[0054] Based on the above hardware structure, an embodiment of the multi-lidar data output method of the present invention is proposed.

[0055] Reference Figure 2 , Figure 2 It is a flow chart of the first embodiment of the multi-laser radar data output method of the present invention, and proposes the first embodiment of the multi-laser radar data output method of the present invention.

[0056] In a first embodiment, the multi-laser radar data output method comprises the following steps:

[0057] Step S10: Acquire multiple point cloud data collected by a preset laser radar.

[0058] It should be noted that the executing entity of this embodiment can be a multi-lidar data output device or a lidar system, wherein the device is a multi-lidar data output device with functions such as data processing, data communication and program running, or it can be other devices, and this embodiment does not impose any restrictions on this.

[0059] Among them, the laser radar system includes three laser radars, namely, Sagitar 16-line, Sagitar 32-line and Sagitar 16-line. The laser scans the environment in one circle. When the motor speed frequency of Sagitar 32-line and Sagitar 16-line are both set to 10Hz, the number of point clouds returned by Sagitar 32-line laser is about twice the number of point clouds returned by Sagitar 16-line laser. That is to say, the time for Sagitar 32-line to collect or process data is longer than that for Sagitar 16-line.

[0060] The preset laser radar is a laser radar at a preset position. The number of laser radars at the preset position may be 1, 2, or 3, etc., and this embodiment does not limit this.

[0061] That is to say, assuming there are three laser radars, the three laser radars are used to collect corresponding multiple point cloud data respectively.

[0062] Before the step of obtaining multiple point cloud data collected by a preset laser radar, the vehicle motor speed frequency is obtained, and it is determined whether the vehicle motor speed frequency is equal to a preset frequency threshold. When the vehicle motor speed frequency is equal to the preset frequency threshold, the step of obtaining multiple point cloud data collected by the preset laser radar is executed.

[0063] The setting of the vehicle motor speed frequency can run the motor speed frequency corresponding to the laser radar, so that the laser radar can collect stable multiple point cloud data. The motor speed frequency can be 10HZ or 20HZ, etc., which is not limited in this embodiment.

[0064] Step S20: Process the plurality of point cloud data to obtain frame data, and input the frame data into the radar thread queue.

[0065] The steps of processing multiple point cloud data and obtaining frame data are as follows: classifying the multiple point cloud data by creating three threads to obtain multiple groups of point cloud data packets, constructing a point cloud data set according to the multiple groups of point cloud data packets, and determining the corresponding frame data according to the point cloud data set.

[0066] That is to say, multiple point cloud data are acquired through different horizontal directions, and the point cloud data acquired at the same direction are combined to obtain multiple groups of point cloud data packets. Then, the multiple groups of point cloud data packets are constructed into a cloud data set, and finally, the multiple groups of point cloud data packets in the cloud data set are spliced ​​to obtain corresponding frame data.

[0067] Among them, assuming that there are three laser radars, the point cloud data corresponding to each laser radar will be obtained respectively through the three laser radars, and then the point cloud data will be classified to obtain multiple groups of point cloud data packets corresponding to each laser radar, and a cloud data set corresponding to each laser radar will be constructed based on the multiple groups of point cloud data packets, and the multiple groups of point cloud data packets in the cloud data set will be spliced ​​to obtain frame data corresponding to each laser radar, that is, three frame data, etc., which is not limited in this embodiment.

[0068] According to the steps of constructing a point cloud data set based on multiple groups of point cloud data packets, the total number of horizontal azimuth angles corresponding to the multiple groups of point cloud data packets is obtained, and it is determined whether the total number of horizontal azimuth angles is equal to a preset number threshold. When the total number of horizontal azimuth angles is equal to the preset number threshold, the steps of constructing a point cloud data set based on the multiple groups of point cloud data packets are executed.

[0069] The total number of horizontal azimuth angles is the number of horizontal azimuth angles when collecting point cloud data through lidar.

[0070] Before the step of determining whether the total number of horizontal azimuth angles is equal to the preset number threshold, the horizontal angle resolution corresponding to the preset laser radar is obtained, a single point cloud data packet is selected from the multiple point cloud data packets, the basic horizontal azimuth angle number corresponding to the single point cloud data packet is obtained, and the preset number threshold is calculated by a preset formula according to the horizontal angle resolution and the basic horizontal azimuth angle number;

[0071] The preset formula is:

[0072]

[0073] Where n 1 is the preset quantity threshold, γ is the horizontal angle resolution, and δ is the basic horizontal azimuth quantity.

[0074] The number of basic horizontal azimuth angles may be the number of horizontal azimuth angles in each data packet received by the User Datagram Protocol (UDP), wherein the number of horizontal azimuth angles in each data packet of the Sagitar 16-line may be 24, and the number of horizontal azimuth angles in each data packet of the Sagitar 32-line may be 12.

[0075] The horizontal angle resolution may be the horizontal angle resolution of the laser radar, that is, the horizontal angle resolution of the Sagitar 16-line laser radar is 0.18°, the horizontal angle resolution of the Sagitar 32-line laser radar is 0.2°, etc., and this embodiment is not limited thereto.

[0076] The steps for the multi-lidar system to synchronously return a frame of data can be as follows: the main thread is initialized, and three threads L are created. 1 , L 2 , L 3 , L 1 The thread is used to receive and process LiDAR 1 data. 2 The thread is used to receive and process LiDAR 2 data. 3 The thread is used to receive and process the LiDAR 3 data. At the same time, three global variable queues Q are created 1 , Q 2 and Q 3 , Q 1 Used to store a frame of data processed by LiDAR 1, Q 2 Used to store a frame of data processed by LiDAR 2, Q 3 Used to store a frame of data processed by LiDAR 3.

[0077] The method of constructing a thread is as follows: establish a communication connection between socket 1 and laser radar 1, and initialize a flag bit rotflag_1 of the number of received packets = 0. In this scheme, the number of received packets is used to determine whether the laser radar return data is full frame (360° scanning data is defined as one frame), and then construct a while (true) infinite loop. The recvfrom() function is used inside the loop to read the laser radar return data. After each successful reading of a packet of data, the value of the flag bit rotflag_1 is first judged. When it is equal to the set threshold n 1 When a frame of data is collected, it is considered that the current Data1 is added to the queue Q 1 If the tail of the packet is not equal to the set threshold, the flag rotflag_1=rotflag_1+1, and then the Datablock data in the packet is parsed and stored in Data1 after the parsing is completed.

[0078] Construct thread L 2 , thread L 2 Used to receive and process the return data of LiDAR 2. 2 Thread architecture and thread L 1 Basically the same, the difference is the flag bit rotflag_2 threshold n 2 The size of n 2 The method of determining the value is similar to n 1 same.

[0079] Construct thread L 3 , thread L 3 Used to receive and process the return data of laser radar 3. Since laser radar 3 and laser radar 1 are of the same model, L 3 Thread architecture and thread L 1 same.

[0080] The step of inputting frame data into the radar thread queue, obtaining the processing time corresponding to the frame data, setting the input time of the frame data according to the processing time, obtaining the initial number of frames in the radar thread queue, judging whether the radar thread queue is an empty queue according to the initial number of frames, and when the radar thread queue is an empty queue, inputting the frame data into the radar thread queue according to the input time.

[0081] That is to say, first establish a while(true) infinite loop. Inside the loop, first determine whether the three queues are empty at the same time. If they are empty, perform the next scan judgment. If they are not empty, use the queue attributes to read the queue Q 1 , Q 2 and Q 3 The first element of the team is obtained and output, and then the first element of the team is deleted after output, and the cycle is repeated.

[0082] At the same time, considering that the main thread loop reads the queue faster than thread L 1 , L 2 and L 3 If the write queue is written at a high rate, the queue may be empty, and the read synchronization of the same variable may occur, resulting in data program errors. To solve this problem, add a delay function sleep inside the main thread loop, that is, the input duration.

[0083] Step S30: Determine whether the frame data in the radar thread queue meets the preset data synchronization condition.

[0084] The preset data synchronization condition may refer to whether the frame data in the radar thread queue are arranged consistently, that is, the queue Q 1 , Q 2 and Q 3 Frame data can be written simultaneously.

[0085] Step S40: When the frame data in the radar thread queue meets the preset data synchronization condition, the frame data in the radar thread queue is output.

[0086] It can be understood that, assuming that the frame data in the radar thread queue is written into the corresponding queue Q at the same time through the input duration 1 , Q 2 and Q 3And determine whether the currently written frame data is at the head of the corresponding queue. Then, when the frame data in each queue meets the above conditions, the frame data in the radar thread queue is output synchronously through the main thread.

[0087] In this embodiment, firstly, a plurality of point cloud data collected by a preset laser radar is obtained, and then the plurality of point cloud data are processed to obtain frame data, and the frame data is input into the radar thread queue, and then it is determined whether the frame data in the radar thread queue meets the preset data synchronization condition, and when the frame data in the radar thread queue meets the preset data synchronization condition, the frame data in the radar thread queue is output. Compared with the prior art, a GPS module or a thread lock is required to complete the synchronous output of multiple laser radar data, but it will cause the radar data output to be unstable and the data output efficiency to be low, and in the present invention, frame data is obtained according to the point cloud data, and then the frame data is input into the radar thread queue, and the frame data is directly output when the preset data synchronization condition is met, so that the multiple laser radar system continuously outputs synchronous frame data.

[0088] In addition, refer to Figure 3 , Figure 3 Based on the above-mentioned first embodiment of the multi-laser radar data output method, a second embodiment of the multi-laser radar data output method of the present invention is proposed.

[0089] In the second embodiment, step S20 in the multi-laser radar data output method includes:

[0090] Step S201: classify the plurality of point cloud data to obtain a plurality of groups of point cloud data packets.

[0091] That is to say, multiple point cloud data are acquired from different horizontal directions, and the point cloud data acquired from the same direction are combined to obtain multiple groups of point cloud data packets, wherein the combined point cloud data packets can be 6 groups or 12 groups, etc., which is not limited in this embodiment.

[0092] Step S202: constructing a point cloud data set according to the multiple groups of point cloud data packets.

[0093] It can be understood that multiple groups of point cloud data packets are stored together to construct a point cloud data set. Assuming there are three laser radars, the three laser radars respectively obtain corresponding multiple groups of point cloud data packets, and then the point cloud data sets corresponding to the three laser radars are constructed based on the multiple groups of point cloud data packets, etc. This embodiment is not limited to this.

[0094] According to the steps of constructing a point cloud data set based on multiple groups of point cloud data packets, the total number of horizontal azimuth angles corresponding to the multiple groups of point cloud data packets is obtained, and it is determined whether the total number of horizontal azimuth angles is equal to a preset number threshold. When the total number of horizontal azimuth angles is equal to the preset number threshold, the steps of constructing a point cloud data set based on the multiple groups of point cloud data packets are executed.

[0095] The total number of horizontal azimuth angles is the number of horizontal azimuth angles when collecting point cloud data through lidar.

[0096] Before the step of determining whether the total number of horizontal azimuth angles is equal to the preset number threshold, the horizontal angle resolution corresponding to the preset laser radar is obtained, a single point cloud data packet is selected from the multiple point cloud data packets, the basic horizontal azimuth angle number corresponding to the single point cloud data packet is obtained, and the preset number threshold is calculated by a preset formula according to the horizontal angle resolution and the basic horizontal azimuth angle number;

[0097] The preset formula is:

[0098]

[0099] Where n 1 is the preset quantity threshold, γ is the horizontal angle resolution, and δ is the basic horizontal azimuth quantity.

[0100] The number of basic horizontal azimuth angles may be the number of horizontal azimuth angles in each data packet received by the User Datagram Protocol (UDP), wherein the number of horizontal azimuth angles in each data packet of the Sagitar 16-line may be 24, and the number of horizontal azimuth angles in each data packet of the Sagitar 32-line may be 12.

[0101] The horizontal angle resolution may be the horizontal angle resolution of the laser radar, that is, the horizontal angle resolution of the Sagitar 16-line laser radar is 0.18°, the horizontal angle resolution of the Sagitar 32-line laser radar is 0.2°, etc., and this embodiment is not limited thereto.

[0102] Assume that the horizontal angle resolution of the Sagitar 16-line laser radar is 0.18°, and the number of horizontal azimuth angles in each packet of data received by UDP is 24, that is, the value of the preset number threshold is 84; the horizontal angle resolution of the Sagitar 32-line laser radar is 0.2°, and the number of horizontal azimuth angles in each packet of data received by UDP is 12, that is, the value of the preset number threshold is 151, etc. This embodiment is not limited.

[0103] Step S203: determining corresponding frame data according to the point cloud data set, and inputting the frame data into the radar thread queue.

[0104] Multiple groups of point cloud data packets in the cloud data set are stitched together to obtain the frame data corresponding to each laser radar.

[0105] The step of inputting frame data into the radar thread queue, obtaining the processing time corresponding to the frame data, setting the input time of the frame data according to the processing time, obtaining the initial number of frames in the radar thread queue, judging whether the radar thread queue is an empty queue according to the initial number of frames, and when the radar thread queue is an empty queue, inputting the frame data into the radar thread queue according to the input time.

[0106] Assume that the laser radar 2 collects a lot of data and the corresponding thread L 2 Each time you write to queue Q 2 The time of thread L 1 or L 3 Write queue Q 1 or Q 3 In order to realize the synchronous and continuous output of synchronous frame data by multiple laser radar systems, the input duration can be set, where the input duration must be greater than the thread L 2 Write queue Q 2 The duration of the input can be set to record the queue Q 1 and Q 3 Input moment, then wait for Q 2 The input time, then calculate Q 1 or Q 3 With Q 2 The time interval between the two is increased and adjusted, and the adjusted time interval is used as the input duration. The input duration needs to be reasonably set, which can be 60 milliseconds or 70 milliseconds, etc. This embodiment does not limit this.

[0107] In this embodiment, multiple point cloud data are first classified to obtain multiple groups of point cloud data packets, and then a point cloud data set is constructed based on the multiple groups of point cloud data packets, and the corresponding frame data is determined based on the point cloud data set, and then the frame data is input into the radar thread queue. In the prior art, the collected point cloud data is directly input into the thread queue, and it is impossible to determine whether the point cloud data is collected completely. In this embodiment, the point cloud data is classified to determine multiple groups of point cloud data packets, and then a point cloud data set is constructed based on the multiple groups of point cloud data packets to determine the corresponding frame data, and the finally obtained frame data is input into the radar thread queue, thereby avoiding the risk of data loss returned by the laser radar.

[0108] In addition, an embodiment of the present invention further proposes a storage medium, on which a multi-laser radar data output program is stored. When the multi-laser radar data output program is executed by a processor, the steps of the multi-laser radar data output method described above are implemented.

[0109] In addition, refer to Figure 4The embodiment of the present invention further provides a multi-laser radar data output device, the multi-laser radar data output device comprising:

[0110] The acquisition module 4001 is used to acquire a plurality of point cloud data collected by a preset laser radar;

[0111] It should be noted that the executing entity of this embodiment can be a multi-lidar data output device or a lidar system, wherein the device is a multi-lidar data output device with functions such as data processing, data communication and program running, or it can be other devices, and this embodiment does not impose any restrictions on this.

[0112] Among them, the laser radar system includes three laser radars, namely, Sagitar 16-line, Sagitar 32-line and Sagitar 16-line. The laser scans the environment in one circle. When the motor speed frequency of Sagitar 32-line and Sagitar 16-line are both set to 10Hz, the number of point clouds returned by Sagitar 32-line laser is about twice the number of point clouds returned by Sagitar 16-line laser. That is to say, the time for Sagitar 32-line to collect or process data is longer than that for Sagitar 16-line.

[0113] The preset laser radar is a laser radar at a preset position. The number of laser radars at the preset position may be 1, 2, or 3, etc., and this embodiment does not limit this.

[0114] That is to say, assuming there are three laser radars, the three laser radars are used to collect corresponding multiple point cloud data respectively.

[0115] Before the step of obtaining multiple point cloud data collected by a preset laser radar, the vehicle motor speed frequency is obtained, and it is determined whether the vehicle motor speed frequency is equal to a preset frequency threshold. When the vehicle motor speed frequency is equal to the preset frequency threshold, the step of obtaining multiple point cloud data collected by the preset laser radar is executed.

[0116] The setting of the vehicle motor speed frequency can run the motor speed frequency corresponding to the laser radar, so that the laser radar can collect stable multiple point cloud data. The motor speed frequency can be 10HZ or 20HZ, etc., which is not limited in this embodiment.

[0117] The processing module 4002 is used to process the plurality of point cloud data to obtain frame data, and input the frame data into the radar thread queue;

[0118] The steps of processing multiple point cloud data and obtaining frame data are as follows: classifying the multiple point cloud data by creating three threads to obtain multiple groups of point cloud data packets, constructing a point cloud data set according to the multiple groups of point cloud data packets, and determining the corresponding frame data according to the point cloud data set.

[0119] That is to say, multiple point cloud data are acquired through different horizontal directions, and the point cloud data acquired at the same direction are combined to obtain multiple groups of point cloud data packets. Then, the multiple groups of point cloud data packets are constructed into a cloud data set, and finally, the multiple groups of point cloud data packets in the cloud data set are spliced ​​to obtain corresponding frame data.

[0120] Among them, assuming that there are three laser radars, the point cloud data corresponding to each laser radar will be obtained respectively through the three laser radars, and then the point cloud data will be classified to obtain multiple groups of point cloud data packets corresponding to each laser radar, and a cloud data set corresponding to each laser radar will be constructed based on the multiple groups of point cloud data packets, and the multiple groups of point cloud data packets in the cloud data set will be spliced ​​to obtain frame data corresponding to each laser radar, that is, three frame data, etc., which is not limited in this embodiment.

[0121] According to the steps of constructing a point cloud data set based on multiple groups of point cloud data packets, the total number of horizontal azimuth angles corresponding to the multiple groups of point cloud data packets is obtained, and it is determined whether the total number of horizontal azimuth angles is equal to a preset number threshold. When the total number of horizontal azimuth angles is equal to the preset number threshold, the steps of constructing a point cloud data set based on the multiple groups of point cloud data packets are executed.

[0122] The total number of horizontal azimuth angles is the number of horizontal azimuth angles when collecting point cloud data through lidar.

[0123] Before the step of determining whether the total number of horizontal azimuth angles is equal to the preset number threshold, the horizontal angle resolution corresponding to the preset laser radar is obtained, a single point cloud data packet is selected from the multiple point cloud data packets, the basic horizontal azimuth angle number corresponding to the single point cloud data packet is obtained, and the preset number threshold is calculated by a preset formula according to the horizontal angle resolution and the basic horizontal azimuth angle number;

[0124] The preset formula is:

[0125]

[0126] Where n 1 is the preset quantity threshold, γ is the horizontal angle resolution, and δ is the basic horizontal azimuth quantity.

[0127] The number of basic horizontal azimuth angles may be the number of horizontal azimuth angles in each data packet received by the User Datagram Protocol (UDP), wherein the number of horizontal azimuth angles in each data packet of the Sagitar 16-line may be 24, and the number of horizontal azimuth angles in each data packet of the Sagitar 32-line may be 12.

[0128] The horizontal angle resolution may be the horizontal angle resolution of the laser radar, that is, the horizontal angle resolution of the Sagitar 16-line laser radar is 0.18°, the horizontal angle resolution of the Sagitar 32-line laser radar is 0.2°, etc., and this embodiment is not limited thereto.

[0129] The steps for the multi-lidar system to synchronously return a frame of data can be as follows: the main thread is initialized, and three threads L are created. 1 , L 2 , L 3 , L 1 The thread is used to receive and process LiDAR 1 data. 2 The thread is used to receive and process LiDAR 2 data. 3 The thread is used to receive and process the LiDAR 3 data. At the same time, three global variable queues Q are created 1 , Q 2 and Q 3 , Q 1 Used to store a frame of data processed by LiDAR 1, Q 2 Used to store a frame of data processed by LiDAR 2, Q 3 Used to store a frame of data processed by LiDAR 3.

[0130] The method of constructing a thread is as follows: establish a communication connection between socket 1 and laser radar 1, and initialize a flag bit rotflag_1 of the number of received packets = 0. In this scheme, the number of received packets is used to determine whether the laser radar return data is full frame (360° scanning data is defined as one frame), and then construct a while (true) infinite loop. The recvfrom() function is used inside the loop to read the laser radar return data. After each successful reading of a packet of data, the value of the flag bit rotflag_1 is first judged. When it is equal to the set threshold n 1 When , it is considered that a frame of data has been collected, and the current Data1 is added to the tail of the queue Q1. If it is not equal to the set threshold, the flag rotflag_1 = rotflag_1 + 1, and then the Datablock data in the packet is parsed and stored in Data1 after the parsing is completed.

[0131] Construct thread L 2 , thread L 2 Used to receive and process the return data of LiDAR 2. 2 Thread architecture and thread L 1 Basically the same, the difference is the flag bit rotflag_2 threshold n 2 The size of n 2 The method of determining the value is similar to n 1 same.

[0132] Construct thread L3 , thread L 3 Used to receive and process the return data of laser radar 3. Since laser radar 3 and laser radar 1 are of the same model, L 3 Thread architecture and thread L 1 same.

[0133] The step of inputting frame data into the radar thread queue, obtaining the processing time corresponding to the frame data, setting the input time of the frame data according to the processing time, obtaining the initial number of frames in the radar thread queue, judging whether the radar thread queue is an empty queue according to the initial number of frames, and when the radar thread queue is an empty queue, inputting the frame data into the radar thread queue according to the input time.

[0134] That is to say, first establish a while(true) infinite loop. Inside the loop, first determine whether the three queues are empty at the same time. If they are empty, perform the next scan judgment. If they are not empty, use the queue attributes to read the queue Q 1 , Q 2 and Q 3 The first element of the team is obtained and output, and then the first element of the team is deleted after output, and the cycle is repeated.

[0135] At the same time, considering that the main thread loop reads the queue faster than thread L 1 , L 2 and L 3 If the write queue is written at a high rate, the queue may be empty, and the read synchronization of the same variable may occur, resulting in data program errors. To solve this problem, add a delay function sleep inside the main thread loop, that is, the input duration.

[0136] A judging module 4003 is used to judge whether the frame data in the radar thread queue meets the preset data synchronization condition;

[0137] The preset data synchronization condition may refer to whether the frame data in the radar thread queue are arranged consistently, that is, the queue Q 1 , Q 2 and Q 3 Frame data can be written simultaneously.

[0138] The output module 4004 is used to output the frame data in the radar thread queue when the frame data in the radar thread queue meets the preset data synchronization condition.

[0139] It can be understood that, assuming that the frame data in the radar thread queue is written into the corresponding queue Q at the same time through the input duration 1 , Q 2 and Q 3And determine whether the currently written frame data is at the head of the corresponding queue. Then, when the frame data in each queue meets the above conditions, the frame data in the radar thread queue is output synchronously through the main thread.

[0140] In this embodiment, firstly, a plurality of point cloud data collected by a preset laser radar is obtained, and then the plurality of point cloud data are processed to obtain frame data, and the frame data is input into the radar thread queue, and then it is determined whether the frame data in the radar thread queue meets the preset data synchronization condition, and when the frame data in the radar thread queue meets the preset data synchronization condition, the frame data in the radar thread queue is output. Compared with the prior art, a GPS module or a thread lock is required to complete the synchronous output of multiple laser radar data, but it will cause the radar data output to be unstable and the data output efficiency to be low, and in the present invention, frame data is obtained according to the point cloud data, and then the frame data is input into the radar thread queue, and the frame data is directly output when the preset data synchronization condition is met, so that the multiple laser radar system continuously outputs synchronous frame data.

[0141] Other embodiments or specific implementation methods of the multi-laser radar data output device of the present invention can refer to the above-mentioned method embodiments and will not be repeated here.

[0142] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0143] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In a unit claim that lists several means, several of these means may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order and these words may be interpreted as names.

[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0145] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for outputting multi-lidar data, It is characterized in that The multi-laser radar data output method comprises the following steps: Get multiple point cloud data collected by preset laser radar; Processing the plurality of point cloud data to obtain frame data, and inputting the frame data into a radar thread queue, wherein the number of the radar thread queues is consistent with the number of the preset laser radars, and the radar thread queues correspond one to one to the preset laser radars; Determining whether the frame data in the radar thread queue meets a preset data synchronization condition, wherein the preset data synchronization condition is set based on whether the frame data in the radar thread queue are arranged consistently; When the frame data in the radar thread queue meets the preset data synchronization condition, outputting the frame data in the radar thread queue; Wherein, the plurality of point cloud data are acquired through different horizontal orientations; The step of processing the plurality of point cloud data to obtain frame data comprises: Combining point cloud data acquired at the same position in the plurality of point cloud data to obtain a plurality of groups of point cloud data packets; Constructing a point cloud data set corresponding to each laser radar according to the multiple groups of point cloud data packets; Combining multiple groups of point cloud data packets in the cloud data set to obtain frame data corresponding to each laser radar; Wherein, before the step of constructing a point cloud data set according to the plurality of groups of point cloud data packets, the method further comprises: Obtain the total number of horizontal azimuth angles corresponding to the multiple groups of point cloud data packets; Determining whether the total number of horizontal azimuth angles is equal to a preset number threshold; When the total number of horizontal azimuth angles is equal to the preset number threshold, executing the step of constructing a point cloud data set according to the multiple groups of point cloud data packets; Before the step of determining whether the total number of horizontal azimuth angles is equal to a preset number threshold, the method further includes: Obtaining the horizontal angle resolution corresponding to the preset laser radar; Selecting a single point cloud data package from the multiple point cloud data packages; Obtaining the number of basic horizontal azimuth angles corresponding to the single group of point cloud data packets, where the number of basic horizontal azimuth angles is the number of horizontal azimuth angles in each data packet received by the user data packet protocol; Calculating a preset number threshold value by a preset formula according to the horizontal angle resolution and the number of basic horizontal azimuth angles; The preset formula is: Where n1 is the preset number threshold, γ is the horizontal angle resolution, and δ is the basic horizontal azimuth number.

2. The method according to claim 1, It is characterized in that Before the step of obtaining a plurality of point cloud data collected by the preset laser radar, the method further includes: Obtaining a vehicle motor speed frequency, and determining whether the vehicle motor speed frequency is equal to a preset frequency threshold; When the vehicle motor speed frequency is equal to the preset frequency threshold, the step of acquiring multiple point cloud data collected by the preset laser radar is performed.

3. The method according to any one of claims 1 to 2, It is characterized in that The step of inputting the frame data into the radar thread queue comprises: Obtaining the processing time corresponding to the frame data; Setting the input duration of the frame data according to the processing duration; The frame data is input into a radar thread queue according to the input duration.

4. The method according to claim 3, It is characterized in that Before the step of inputting the frame data into the radar thread queue according to the input duration, the method further includes: Get the initial number of frames in the radar thread queue; Determining whether the radar thread queue is an empty queue according to the initial frame number; When the radar thread queue is an empty queue, a step of inputting the frame data into the radar thread queue according to the input duration is performed.

5. A multi-lidar data output device, It is characterized in that The multi-laser radar data output device comprises: The acquisition module is used to obtain multiple point cloud data collected by the preset laser radar; A processing module, used for processing the plurality of point cloud data to obtain frame data, and inputting the frame data into a radar thread queue, wherein the number of the radar thread queues is consistent with the number of the preset laser radars, and the radar thread queues correspond one to one to the preset laser radars; A judging module, used for judging whether the frame data in the radar thread queue meets a preset data synchronization condition, wherein the preset data synchronization condition is set based on whether the frame data in the radar thread queue are arranged consistently; An output module, configured to output the frame data in the radar thread queue when the frame data in the radar thread queue meets the preset data synchronization condition; The processing module is further used to combine the point cloud data obtained at the same orientation in the plurality of point cloud data to obtain a plurality of point cloud data packets; construct a point cloud data set corresponding to each laser radar according to the plurality of point cloud data packets; and perform splicing processing on the plurality of point cloud data packets in the cloud data set to obtain frame data corresponding to each laser radar; The processing module is further used to obtain the total number of horizontal azimuth angles corresponding to the multiple groups of point cloud data packets; determine whether the total number of horizontal azimuth angles is equal to a preset number threshold; when the total number of horizontal azimuth angles is equal to the preset number threshold, execute the step of constructing a point cloud data set according to the multiple groups of point cloud data packets; The processing module is further used to obtain the horizontal angle resolution corresponding to the preset laser radar; select a single point cloud data packet from multiple point cloud data packets; obtain the number of basic horizontal azimuth angles corresponding to the single point cloud data packet, the number of basic horizontal azimuth angles being the number of horizontal azimuth angles in each data packet received by the user data packet protocol; calculate a preset number threshold value by a preset formula according to the horizontal angle resolution and the number of basic horizontal azimuth angles; The preset formula is: Where n1 is the preset number threshold, γ is the horizontal angle resolution, and δ is the basic horizontal azimuth number.

6. A multi-lidar data output device, It is characterized in that The multi-lidar data output device includes: a memory, a processor, and a multi-lidar data output program stored in the memory and executable on the processor. When the multi-lidar data output program is executed by the processor, the steps of the multi-lidar data output method as described in any one of claims 1 to 4 are implemented.

7. A storage medium, It is characterized in that The storage medium stores a multi-laser radar data output program, which, when executed by a processor, implements the steps of the multi-laser radar data output method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Map making method, device and system based on laser radar

    CN107179086A

  • Data transmission methods and devices used for robot operating system (ROS)

    CN107798016A