Optimization method based on Ros2 data processing
By using the Ros2-based timestamp alignment method in autonomous driving data processing, the time-consuming processing problem caused by large amounts of data and inconsistent sensor frequencies is solved, and data processing speed is improved and efficiency optimized.
Patent Information
- Application Number
- CN202410734863.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-22
AI Technical Summary
In the existing autonomous driving data processing process, due to the huge amount of data and the different sampling frequencies of different sensors, the data synchronization and alignment process takes too long, requiring 24 hours to complete one hour of data processing.
Using a data processing method based on Ros2, the timestamps of each sensor data are parsed and aligned through the timestamp alignment node as the benchmark for lidar data, retaining data at the same time, reducing the amount of data and optimizing the data processing process, including lidar, Alignment and collation of camera and inertial navigation system data.
It significantly reduces the amount of data and network IO and disk IO operations, improves data processing speed, shortens data processing time to 1/4 of the original, and supports flexible definition of frame extraction intervals.
Smart Images

Figure CN118828142A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data processing method, and in particular to an optimization method based on Ros2 data processing, which belongs to the technical field of autonomous driving. Background Art
[0002] In the research of driverless technology and in the field of autonomous driving, data, as the driving force of the entire data closed loop, drives the continuous iteration of algorithms. How to quickly process data and obtain effective materials determines the iteration speed of the algorithm model. Figure 1 As shown, a general data processing flow is demonstrated.
[0003] The data access processing flow is assigned to the positioning data analysis node, image processing node and laser frame extraction node for data processing. The positioning analysis node is responsible for extracting positioning related information, such as location, vehicle body posture and other information; the image processing node is responsible for extracting all the original images of multiple cameras, and dedistorting the images, while saving the original images and dedistorted images. After the image processing is completed, the original image data enters the top view processing node, and according to the acquisition time of each frame of the image, the different cameras are synchronized in time, and each camera has the image data at the corresponding moment, and then fits into a top view; the laser frame extraction node is responsible for extracting multi-channel laser radar data at different angles, and the extracted laser radar data enters the laser merging node, and synchronizes the data according to the data sampling timestamp, and merges into a laser radar file. The data alignment node is responsible for sampling the merged laser radar data, and extracts 1 frame every 10 frames as the final data output. At the same time, the timestamp of this frame of laser radar is used as a benchmark to match the sampled image data of different cameras at this moment. Finally, the aligned LiDAR data, the original images and overhead view data from different cameras, and the positioning data are imported into the material sorting node, and the data is classified according to different output directory requirements.
[0004] The existing solution needs to extract all images and lidar data to facilitate data synchronization and alignment between the data synchronization node and the bird's-eye view node. However, due to the large amount of data, the sampling frame rate of a single camera is 30Hz, the sampling frame rate of the lidar is 10Hz, and the sampling frame rate of the positioning data is 100Hz. The amount of data in one hour can reach 100G. The data is stored on the network disk. The data extraction process involves a large number of network interface operations, which makes the data processing time very long. It takes about 24 hours to complete the entire data processing process for one hour of data. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide an optimization method based on Ros2 data processing.
[0006] In order to achieve the above objectives, the specific technical solution of the present invention is as follows: an optimization method based on Ros2 data processing, comprising the following steps: Step 1: Connect the data of each communication node to the processing flow, first enter the timestamp alignment node, parse out all the timestamps of each sensor data from the data packet and align them; Step 2, the output product of the timestamp alignment node is respectively transmitted to the laser frame extraction node, the image processing node and the positioning data analysis node as the input data of each node; Step 3, the original image data after passing through the image processing node flows into the top view processing node for image merging; Step 4: The output products of the image processing node and the laser merging node flow into the data alignment node for data alignment. Since the sampling frequency of the camera is different from that of the laser radar, for the algorithm, only the camera and laser data at the same time can restore the driving scene environment at that time, so the data needs to be aligned. Step 5: Finally, the products of all nodes flow into the material sorting node, and the data is sorted according to different directory structures.
[0007] Furthermore, in step 1, the timestamp alignment node parses all timestamps of data collected by several sensors in the data packet, and the sensors include at least cameras, lidars and inertial navigation systems, thereby obtaining scene information around the vehicle body; obtaining the scene around the vehicle body in an image-visualized manner through the camera; obtaining the scene information around the vehicle body under limited light conditions through the lidar, and the detection distance is long; obtaining the coordinate position, posture and acceleration and other information of the vehicle body through the inertial navigation system; for the original data, the data of each device are compressed in a single file, and the data needs to be extracted from the single file through this workflow.
[0008] In the step 1, the collected data of the laser radar is used as a reference for alignment to retain the full amount of sensor data of the scene at different times to the greatest extent; the laser radar with the smallest starting frame timestamp is used as the main laser radar, and the timestamp of the main laser radar is used as the basis. The timestamp of the target laser radar after frame extraction is retained according to the method of retaining 1 frame for 10 frames, and then the timestamp of the laser radar after frame extraction is used to align the image data of different cameras. If aligned image data can be found in all cameras, the laser radar timestamp of this frame and the image timestamps of each camera are retained.
[0009] Furthermore, the camera includes a surround-view camera for monitoring the environment around the vehicle body and a surround-view camera for monitoring the blind spots around the vehicle body. The surround-view cameras are 6 in number, namely, a center front surround-view camera fcf, a left front surround-view camera flb, a right front surround-view camera frb, a left rear surround-view camera blf, a right rear surround-view camera brf and a center rear surround-view camera bcb; the surround-view cameras are 6 in number, namely, a center front surround-view camera f_fcf, a left front surround-view camera f_fll, a right front surround-view camera f_frr, a left rear surround-view camera f_bll, a right rear surround-view camera f_brr and a center rear surround-view camera f_bcb.
[0010] Furthermore, the target lidar data is retained in the final output pcd_ts.json file, and the target image timestamp after multi-channel camera alignment is retained in the images_ts.json file.
[0011] Furthermore, in step 2, each node traverses its own timestamp json file in turn to extract the target file; for the laser frame extraction node, the data volume is reduced to 1 / 10 of the previous volume; for the image frame extraction node, the data volume is reduced to 1 / 30 of the previous volume; for the positioning and analysis node, the data volume is reduced to 1 / 100 of the previous volume.
[0012] Furthermore, in step 5, according to the business scenarios, the processed materials need to be classified and organized into seven directories: joint annotation, pure pictures, small BEV, 6+2 large BEV, 6 large BEV, bev-od and laser. Each directory has its own sub-directory structure. In order to facilitate the algorithm team to quickly locate and use the processed materials, the material sorting node will archive and organize the materials according to the needs of different business departments.
[0013] Furthermore, the small BEV adopts four surround-view cameras, the large BEV adopts four surround-view cameras and two panoramic cameras, and the 6+2 large BEV adopts six fisheye surround-view cameras and two panoramic cameras.
[0014] Furthermore, in step 2 and step 5, the business scenarios include true value labeling, dynamic visual perception training, static visual perception training, and lidar perception training; folders are classified according to business scenarios to serve downstream businesses, and the required materials can be found in the corresponding directory according to their respective business needs.
[0015] Since the sampling frame rate of the lidar is the lowest, in order to retain as much valid data as possible, the lidar data is used as the benchmark for alignment, which can retain the full amount of sensor data of the scene at different times to the greatest extent; because there are lidars in different directions, the lidar with the smallest starting frame timestamp is used as the main radar, which can record the car driving scene earlier. Therefore, the timestamp of the main lidar is used as the basis, and the target lidar timestamp after frame extraction is retained by retaining 1 frame in 10 frames by default. Then the timestamp of the lidar after frame extraction is used to align the image data of different cameras. If the aligned image data can be found in all cameras, the timestamp of the main lidar is used as the benchmark, and the image timestamps of each camera are matched within 33ms around the timestamp; the lidar timestamp of this frame and the image timestamps of each camera are retained.
[0016] Compared with the prior art, the beneficial effects of the present invention are:
[0017] 1. The present invention only performs data alignment on the timestamps of different sensors instead of synchronizing the sensor data, which greatly reduces the amount of data and significantly improves the alignment speed; 2. By adjusting the workflow, the overall data volume is significantly reduced, network IO and disk IO read and write operations are reduced, and the data processing speed is improved.
[0018] 3. Supports frame extraction interval setting, allowing users to flexibly define the frame extraction interval. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart in the prior art.
[0020] Figure 2 It is a flow chart of the present invention.
[0021] Figure 3 Schematic diagram of a camera of the present invention.
[0022] Figure 4 Schematic diagram of camera and lidar data alignment according to the present invention.
[0023] Figure 5 It is a schematic diagram of the directory structure of the material sorting node of the present invention. DETAILED DESCRIPTION
[0024] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings: This embodiment proposes an optimization method based on Ros2 data processing, the process is as follows Figure 2 As shown, the following steps are included: Step 1, data access processing flow, first enter the timestamp alignment node. This node will parse all the timestamps of the data from different sensors (camera, lidar, inertial navigation, etc.) from the data packet, and then take the timestamp of the main lidar as the standard. By default, the target lidar timestamp after frame extraction is retained according to the method of retaining 1 frame for 10 frames, and then the timestamp of the lidar after frame extraction is used to align the image data of different cameras. If the aligned image data can be found in all cameras, the lidar timestamp of this frame and the image timestamps of each camera are retained. The target lidar data is retained in the final output pcd_ts.json file, and the target image timestamp after multi-channel camera alignment is retained in the images_ts.json file. Since the timestamp alignment is based on the main lidar, the image timestamps of each camera after alignment are found. Then, according to the aligned lidar and camera timestamps, the final lidar and camera data are extracted. The default is to extract 1 frame every 10 frames of lidar. You can set the frame extraction interval variable Interval, for example, Interval=2, which means extracting 2 frames every 10 frames, that is, extracting 1 frame every 5 laser radar frames, and then aligning the camera data.
[0025] Step 2: Give the output product of the timestamp alignment node to the laser frame extraction node, image frame extraction node and positioning data analysis node as the input data of each node. Each node traverses its own timestamp json file in turn and extracts the target file. For the laser frame extraction node, the data volume is reduced to 1 / 10 of the previous amount; for the image frame extraction node, the data volume is reduced to 1 / 30 of the previous amount; for the positioning analysis node, the data volume is reduced to 1 / 100 of the previous amount.
[0026] Step 3: The original image data after passing through the image processing node flows into the top view processing node for image merging.
[0027] Step 4: The products of the image processing node and the laser merging node flow into the data alignment node for data alignment. Since the sampling frequency of the camera is different from that of the laser radar, for the algorithm, only the camera and laser data at the same time can restore the driving scene environment at that time, so the data needs to be aligned. Figure 4 As shown, the data distribution order of each camera and lidar over a period of time is shown. According to business requirements, in this embodiment, only the panoramic camera is synchronously aligned.
[0028] For the cam1 camera, a total of n1 frames of camera data were collected and sorted by sampling time. For other cameras, the sorted data is shown in the figure above. For lidar, since the sampling frame rate is lower than that of the camera, the number of frames in the same time is lower. In chronological order, the lidar data is sorted as shown in the figure above.
[0029] Since the frame rate of the lidar is lower than that of the camera, this solution uses the lidar as a reference for frame alignment to ensure that each frame of lidar data has camera data of each camera near the corresponding time.
[0030] Step 5: Finally, the products of all nodes flow into the material sorting node, and data is sorted according to different directory structures. According to the business scenario, the processed materials need to be classified and sorted into 7 directories: joint annotation, pure pictures, small BEV, 6+2 large BEV, 6 large BEV, bev-od and laser. The folder names are shown in the figure above. For each directory, it has its own subdirectory structure, and the naming is referenced. Figure 5 .
[0031] In order to facilitate the algorithm team to quickly locate and use the processed materials, the material sorting node will archive and sort the materials according to the needs of different business departments. As shown in the figure above, for example, if the laser department only cares about laser data, it only needs to care about the directory [lidar]AIV_DX_#3037_20230322_QA-HY.
[0032] Among them, business scenarios include true value labeling, dynamic visual perception training, static visual perception training, and lidar perception training; folders are classified according to business scenarios to serve downstream businesses. According to their respective business needs, the required materials can be found in the corresponding directory.
[0033] In summary, the entire data processing workflow first performs time alignment operations only on the timestamp data, and then the downstream nodes only need to extract frames of the target data based on the aligned timestamps. This greatly reduces the overall data volume, significantly reduces the read and write operations of network IO and disk IO, and significantly reduces the overall data processing time.
[0034] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above specific embodiments. The above specific embodiments and the description in the specification are only for further illustrating the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of the present invention to be protected is defined by the claims and their equivalents.
Claims
1. An optimization method based on Ros2 data processing, characterized in that: The following steps are included: Step 1: Connect the data of each communication node to the processing flow, first enter the timestamp alignment node, parse out all the timestamps of each sensor data from the data packet and align them; Step 2, the output product of the timestamp alignment node is respectively transmitted to the laser frame extraction node, the image processing node and the positioning data analysis node as the input data of each node; Step 3, the original image data after passing through the image processing node flows into the top view processing node for image merging; Step 4: The output products of the image processing node and the laser merging node flow into the data alignment node for data alignment. Since the sampling frequency of the camera is different from that of the laser radar, for the algorithm, only the camera and laser data at the same time can restore the driving scene environment at that time, so the data needs to be aligned. Step 5: Finally, the products of all nodes flow into the material sorting node, and the data is sorted according to different directory structures.
2. The optimization method based on Ros2 data processing according to claim 1 is characterized in that: In step 1, the timestamp alignment node parses all timestamps of data collected by several sensors in the data packet, and the sensors include at least cameras, lidars and inertial navigation systems; thereby obtaining scene information around the vehicle body; obtaining the scene around the vehicle body in an image visualization manner through the camera; obtaining the scene information around the vehicle body under limited light conditions through the lidar, and having a long detection distance; obtaining the coordinate position, posture and acceleration information of the vehicle body through the inertial navigation system; for the original data, the data of each device are compressed in a single file, and the data needs to be extracted from the single file through this workflow.
3. The optimization method based on Ros2 data processing according to claim 2 is characterized in that: In step 1, the laser radar data collected is used as a reference for alignment to retain the full amount of sensor data of the scene at different times to the greatest extent; The lidar with the smallest starting frame timestamp is used as the main lidar. The timestamp of the main lidar is used as the basis. The timestamp of the target lidar after frame extraction is retained according to the method of retaining 1 frame for 10 frames. Then, the timestamp of the lidar after frame extraction is used to align the image data of different cameras. If aligned image data can be found in all cameras, the lidar timestamp of this frame and the image timestamps of each camera are retained.
4. The optimization method based on Ros2 data processing according to claim 3 is characterized in that: The cameras include surround-view cameras for monitoring the environment around the vehicle body and surround-view cameras for monitoring blind spots around the vehicle body. There are 6 surround-view cameras, namely, a front center surround-view camera fcf, a left front surround-view camera flb, a right front surround-view camera frb, a left rear surround-view camera blf, a right rear surround-view camera brf and a rear center surround-view camera bcb; there are 6 surround-view cameras, namely, a front center surround-view camera f_fcf, a left front surround-view camera f_fll, a right front surround-view camera f_frr, a left rear surround-view camera f_bll, a right rear surround-view camera f_brr and a rear center surround-view camera f_bcb.
5. The optimization method based on Ros2 data processing according to claim 2 is characterized in that: The target lidar data is retained in the final output pcd_ts.json file, and the target image timestamp after multi-channel camera alignment is retained in the images_ts.json file.
6. The optimization method based on Ros2 data processing according to claim 1 is characterized in that: In step 2, each node traverses the json file of its own timestamp in turn to extract the target file; for the laser frame extraction node, the data volume is reduced to 1 / 10 of the previous amount; for the image frame extraction node, the data volume is reduced to 1 / 30 of the previous amount; for the positioning and analysis node, the data volume is reduced to 1 / 100 of the previous amount.
7. The optimization method based on Ros2 data processing according to claim 1 is characterized in that: In step 5, according to the business scenario, the processed materials need to be classified and organized into seven directories: joint annotation, pure pictures, small BEV, 6+2 large BEV, 6 large BEV, bev-od and laser. Each directory has its own sub-directory structure. In order to facilitate the algorithm team to quickly locate and use the processed materials, the material sorting node will archive and organize the materials according to the needs of different business departments.
8. The optimization method based on Ros2 data processing according to claim 7 is characterized in that: The small BEV uses four surround-view cameras, the large BEV uses four surround-view cameras and two panoramic cameras, and the 6+2 large BEV uses six fisheye surround-view cameras and two panoramic cameras.
9. The optimization method based on Ros2 data processing according to claim 1, characterized in that: In step 2 and step 5, the business scenarios include true value labeling, dynamic visual perception training, static visual perception training, and lidar perception training; folders are classified according to business scenarios to serve downstream businesses, and the required materials can be found in the corresponding directory according to their respective business needs.
Citation Information
Cited By
Data processing method, device and equipment and computer readable storage medium
CN121579429A
