Virtual sensor construction method for automatic driving
By introducing noise signals and noise models into the virtual sensor, the inconsistency between the virtual sensor and the actual sensor is solved, improving the reliability of simulation testing and hardware compatibility.
Patent Information
- Application Number
- CN202411330850.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-10
AI Technical Summary
Existing virtual sensor models cannot simulate the noise and errors of real sensors under various environmental conditions, and cannot be consistent with actual sensors, affecting the reliability of simulation verification and the compatibility of hardware-in-the-loop simulation.
By introducing different noise signals to simulate the noise and error of the sensor, information within the sensor's sensing range is filtered, and corresponding noise models are added to ensure that the virtual sensor is consistent with the actual sensor. CAN signals are then output to enhance hardware compatibility.
This achieves consistency between the perception of virtual sensors and actual sensors, enhancing the realism of simulation testing and the compatibility of hardware-in-the-loop simulation.
Smart Images

Figure CN119294067A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of autonomous driving technology, and in particular to a method for constructing a virtual sensor for autonomous driving. Background Art
[0002] In the development process of autonomous driving systems, simulation testing is one of the key links. Although there are mature virtual simulation platforms, virtual sensor models still have significant deficiencies. Traditional virtual sensors rely on true values for loop simulation, without fully considering factors such as errors and noise that may occur in actual scenarios. This not only affects the reliability and safety of simulation verification, but also weakens the robustness of the system in different simulation environments. In addition, traditional virtual sensors can usually only simulate a single sensor and cannot be adjusted according to changes in the target sensor parameters. At the same time, they are often disconnected from hardware implementation, and the sensing results are not output in the form of CAN signals. The inconsistency with the actual sensor makes it unsuitable for hardware-in-the-loop simulation, thereby affecting the iteration speed of autonomous driving system development. Therefore, for the autonomous driving simulation test system, there is an urgent need for a method to build a virtual sensor for autonomous driving, so that it has a detection range and perception results similar to those of the actual sensor. Summary of the invention
[0003] The purpose of the present invention is to propose a method for constructing a virtual sensor for autonomous driving to solve the shortcomings of existing virtual sensor models in simulating the performance of real sensors. Specifically, the present invention simulates the noise and errors that real sensors may face under various environmental conditions by introducing different noise signals; based on the detection range of the real sensor, irrelevant environmental information is screened and eliminated to ensure that the detection range of the virtual sensor is consistent with that of the actual sensor; in addition, the present invention also aims to develop using the TX2 platform to provide CAN signal output consistent with the actual sensor, so as to enhance the compatibility between the virtual sensor and the hardware implementation and improve the simulation test effect of the autonomous driving system.
[0004] To achieve the above object, the present invention provides the following solutions:
[0005] A method for constructing a virtual sensor for autonomous driving, comprising:
[0006] Acquiring traffic participant information; the traffic participant information is obtained using environment simulation software;
[0007] Performing coordinate conversion between the global coordinate system in the environment simulation software and the simulated sensor coordinate system, and converting the traffic participant information into information in the sensor coordinate system;
[0008] Acquire the sensing range of the target sensor, filter the information in the sensor coordinate system according to the sensing range, and acquire the information in the sensor coordinate system within the sensing range;
[0009] The traffic participants with occlusion in the traffic participant information within the perception range are filtered, and the corresponding noise model is added to obtain the target information, the target information is converted into the CAN format, and the CAN information is output.
[0010] Optionally, the traffic participant information includes: road information, traffic participant information and traffic light information.
[0011] Optionally, converting the traffic participant information into information in the sensor coordinate system includes:
[0012] Performing coordinate conversion between the global coordinate system and the vehicle coordinate system in the environment simulation software, converting the information of the traffic participant into information in the vehicle coordinate system; performing coordinate conversion between the vehicle coordinate system and the simulated sensor coordinate system, converting the information in the vehicle coordinate system into information in the sensor coordinate system;
[0013] The coordinate transformation method is:
[0014]
[0015] Where (x1, y1) is the coordinate of the point in the target coordinate system, (x0, y0) is the coordinate of the point in the base coordinate system, (a, b) is the coordinate of the origin of the target coordinate system in the base coordinate system, and θ is the angle between the target coordinate system and the base coordinate system.
[0016] Optionally, filtering the traffic participants with obstructions in the traffic participant information within the perception range includes:
[0017] The plane map of the perception range is replaced with the visible triangle of the traffic participant, and it is determined whether there is any occlusion between the visible triangle of the traffic participant and other traffic participants, and the traffic participants with occlusion are obtained, and the traffic participants with occlusion are filtered.
[0018] Optionally, obtaining the obstructed traffic participant includes:
[0019] Take any of the traffic participants as the first object to be processed, and determine whether the traversal of the first object to be processed is completed. If the traversal is completed, it proves that there is no occlusion for the first object to be processed. If the traversal is not completed, extract any remaining traffic participants as the second object to be processed, and determine whether the visible triangles of the second object to be processed and the first object to be processed intersect. If not, extract any remaining traffic participants as the third object to be processed, and determine whether the visible triangles of the first object to be processed intersect until the traversal is completed. If they intersect, determine the visible angles of the visible triangles of the second object to be processed and the first object to be processed.
[0020] Optionally, determining visible angles of visible triangles in the second object to be processed and the first object to be processed includes:
[0021] Determine whether the two viewing edges of the visible triangle in the first object to be processed intersect with the outline of the second object to be processed. If they do not intersect, it proves that there is a segmented partial occlusion. Perform a segmented partial occlusion visibility judgment on the two viewing edges of the visible triangle in the first object to be processed and the outline of the second object to be processed. If they intersect, it proves that there is an occlusion in one of the arbitrary viewing edges. Perform a unilateral partial occlusion visibility judgment on the two viewing edges of the visible triangle in the first object to be processed and the outline of the second object to be processed.
[0022] Optionally, segmenting two viewing angle edges of a visible triangle in the first object to be processed and a contour of the second object to be processed to determine partial occlusion visibility includes:
[0023] According to the two viewing angle edges of the visible triangle in the first object to be processed and the two side edges of the outline of the second object to be processed, a left visible angle and a right visible angle are established, and it is determined whether the left visible angle and the right visible angle are greater than the visible threshold of the target sensor. If any of the left visible angle and the right visible angle is greater than the visible threshold of the target sensor, it is proved that the target object is visible; if both the left visible angle and the right visible angle are less than the visible threshold of the target sensor, it is proved that the target object is invisible.
[0024] Optionally, segmenting two viewing angle edges of a visible triangle in the first object to be processed and a contour of the second object to be processed to determine partial occlusion visibility includes:
[0025] Determine whether the outline of the second object to be processed is occluded by the left or right viewing angle in the visible triangle of the first object to be processed. If the left viewing angle is occluded, it proves that there is occlusion between the outline of the second object to be processed and the left viewing angle in the visible triangle of the first object to be processed, that is, there is occlusion on the left side of the target object. If the right viewing angle is occluded, it proves that there is occlusion between the outline of the second object to be processed and the right viewing angle in the visible triangle of the first object to be processed, that is, there is occlusion on the right side of the target object.
[0026] Optionally, adding a corresponding noise model includes: acquiring the type and working environment of the target sensor, and adding a corresponding noise model; wherein the corresponding noise model includes: a Gaussian noise model and a white noise model;
[0027] The method for obtaining the Gaussian noise model is:
[0028]
[0029] In the formula, x is a random variable, μ is the random mean, and σ is the standard deviation;
[0030] Acquiring the white noise model includes: using a prime modular multiplication linear congruential generator to generate random numbers uniformly distributed between preset thresholds, transforming the random numbers into white noise that conforms to a Gaussian distribution through a function transformation method, adding the white noise to the ideal output of a functional sensing model, and acquiring the white noise model.
[0031] Optionally, outputting the CAN information includes:
[0032] By utilizing the master-slave communication principle and the CAN protocol of the target sensor, the target information is sent from the environment simulation host to the sensor simulation slave and converted into information in CAN format, the CAN information is acquired, and the CAN information is output based on the slave CAN interface.
[0033] The beneficial effects of the present invention are:
[0034] The present invention provides a method for constructing a virtual sensor for autonomous driving, which can provide detection information within a corresponding range according to the detection range of a target sensor. In view of the noise and error faced by real sensors in different environments, the method adds various noise signals to the true value to achieve a perception effect similar to that of the actual sensor. By developing and verifying based on the TX2 platform, the method ensures that the virtual sensor has the same CAN signal output as the real sensor, thereby enhancing the compatibility with the hardware and the authenticity of the simulation test. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0036] Figure 1 A flow chart of a method for constructing a virtual sensor for autonomous driving according to an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of the coordinate system relationship of an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of the detection range of an embodiment of the present invention;
[0039] Figure 4 A schematic diagram of visible triangles and visible angles according to an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram of a target vehicle being completely blocked according to an embodiment of the present invention;
[0041] Figure 6 This is a schematic diagram of a left side partial occlusion of an embodiment of the present invention;
[0042] Figure 7 A schematic diagram of partial occlusion on the right side of an embodiment of the present invention;
[0043] Figure 8 This is a schematic diagram of occlusion of a segmented part according to an embodiment of the present invention;
[0044] Fig. 9 A flow chart of a traffic object visibility quick judgment algorithm according to an embodiment of the present invention;
[0045] Fig.10 is a flowchart of comparing visible angles according to an embodiment of the present invention;
[0046] Fig.11 A flowchart of generating and adding Gaussian white noise according to an embodiment of the present invention;
[0047] Fig.12 A Gaussian white noise random sequence and a probability density function diagram of an embodiment of the present invention;
[0048] Fig.13 1 is a Gaussian white noise autocorrelation function and a power spectrum density diagram according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] like Figure 1 As shown, this embodiment discloses a method for constructing a virtual sensor for autonomous driving, including: obtaining information of traffic participants; obtaining the information of traffic participants by using environment simulation software; performing coordinate conversion between the global coordinate system in the environment simulation software and the simulated sensor coordinate system, and converting the information of traffic participants into information in the sensor coordinate system; obtaining the perception range of the target sensor, filtering the information in the sensor coordinate system according to the perception range, and obtaining the information in the sensor coordinate system within the perception range; filtering the traffic participants that are blocked in the information of traffic participants within the perception range, and adding corresponding noise models, obtaining target information, converting the target information into CAN format, and outputting CAN information.
[0052] Specifically, the hardware requirements are: a computer running Linux system as the host and an NVIDIA JetsonTX2 (TX2) as the slave.
[0053] Software requirements: The host machine must be installed with Virtual Test Drive (VTD), MATLAB, and ROS robot operating system, and the slave machine must be installed with ROS robot operating system and C++ compiler.
[0054] This embodiment discloses a method for constructing a virtual sensor for autonomous driving, including: obtaining traffic participant information based on environmental simulation software, providing true value information required for sensor model construction; performing coordinate transformation based on the positional relationship between the simulated sensor coordinate system and the global coordinate system in the simulation software, and converting the traffic participant information in the simulation software into information under the sensor coordinates; filtering the traffic participant information within the sensor perception range from the acquired true value information according to the perception range of the target sensor based on the target sensor parameters, and processing the occlusion problem based on the occlusion simulation discrimination algorithm; adding corresponding noise models to the acquired traffic participant information based on different simulation environments and target sensor types to keep it consistent with the performance of the actual sensor; based on the master-slave communication principle and the CAN protocol of the target sensor, sending the target information from the environmental simulation host to the sensor simulation slave, and converting it into CAN format information and sending it through the slave CAN interface, thereby realizing the effective combination of software and hardware. Among them, the traffic participant information includes: road information, traffic participant information and traffic light information.
[0055] The specific method of obtaining information about traffic participants based on environmental simulation software and providing the true value information required for sensor model construction is as follows: based on the communication modules supported by the simulation software (such as UDP, TCP, ROS, etc.), obtain and parse the environmental information provided by the simulation software; based on the real sensor type and environmental information, filter the target information to provide a basis for subsequent processing.
[0056] Based on the positional relationship between the simulated sensor coordinate system and the global coordinate system in the simulation software, coordinate transformation is performed to convert the traffic participant information in the simulation software into information under the sensor coordinate system as follows: based on the environmental coordinate information of the simulation software, its environmental information coordinate system is confirmed; based on the spatial coordinate relationship between the sensor and the main vehicle and the relationship between the main vehicle coordinate system and the environmental information coordinate system, the environmental information provided by the simulation software is converted into environmental information under the sensor coordinate system.
[0057] Based on the target sensor parameters, the information of traffic participants within the sensor perception range is filtered out from the acquired true value information according to the perception range of the target sensor, and the specific method for handling the occlusion problem based on the occlusion simulation discrimination algorithm is as follows: based on the perception range of the target sensor, all traffic participants in the environment are filtered to ensure that only those objects located in the effective perception area of the sensor are retained; based on the occlusion simulation discrimination algorithm, traffic objects that cannot be detected due to mutual occlusion are filtered.
[0058] Based on the master-slave communication principle and the CAN protocol of the target sensor, the target information is sent from the environment simulation host to the sensor simulation slave, and converted into CAN format information and sent through the slave CAN interface, thereby realizing the effective combination of software and hardware. The specific method is as follows: Based on the communication method supported by the master and slave (such as UDP, TCP, ROS, etc.), the target information is sent from the host to the slave in real time; based on the CAN protocol information of the target sensor, the information is converted in the slave and sent from the CAN port in the form of a CAN signal.
[0059] Furthermore, the traffic participant information includes: road information, traffic participant information and traffic light information.
[0060] Specifically, the information of traffic participants is obtained based on the environmental simulation software to provide the true value information required for the construction of the sensor model. Through the UDP communication principle, the UDP module in MATLAB is used to obtain the environmental information package in VTD. Subsequently, the rdbreader module is used to parse and classify the environmental information package, covering road information, traffic participant information, and traffic light information.
[0061] Further, converting the traffic participant information into information in the sensor coordinate system includes: performing coordinate conversion between the global coordinate system and the vehicle coordinate system in the environment simulation software, and converting the traffic participant information into information in the vehicle coordinate system; performing coordinate conversion between the vehicle coordinate system and the simulated sensor coordinate system, and converting the information in the vehicle coordinate system into information in the sensor coordinate system;
[0062] The coordinate transformation method is:
[0063]
[0064] Where (x1, y1) is the coordinate of the point in the target coordinate system, (x0, y0) is the coordinate of the point in the base coordinate system, (a, b) is the coordinate of the origin of the target coordinate system in the base coordinate system, and θ is the angle between the target coordinate system and the base coordinate system.
[0065] Specifically, based on the positional relationship between the simulated sensor coordinate system and the global coordinate system in the simulation software, coordinate transformation is performed to convert the traffic participant information in the simulation software into information under the sensor coordinate system.
[0066] Figure 2The positional relationship between the global coordinate system, the vehicle coordinate system, and the sensor coordinate system is shown. The environmental information obtained by VTD is all based on the global coordinate system. In order to convert it into information in the sensor coordinate system, it is necessary to first use the relationship between the vehicle coordinate system and the global coordinate system to convert it into data information in the vehicle coordinate system; then, according to the relationship between the vehicle coordinate system and the sensor coordinate system, convert the information into data in the sensor coordinate system.
[0067] The coordinate transformation formula is as follows:
[0068]
[0069] Where (x1, y1) is the coordinate of the point in the target coordinate system, (x0, y0) is the coordinate of the point in the base coordinate system, (a, b) is the coordinate of the origin of the target coordinate system in the base coordinate system, and θ is the angle between the target coordinate system and the base coordinate system.
[0070] Furthermore, filtering the traffic participants with occlusion in the traffic participant information within the perception range includes:
[0071] Replace the plane map of the perception range with the visible triangles of the traffic participants, determine whether there is occlusion between the visible triangles of the traffic participants and the rest of the traffic participants, obtain the traffic participants with occlusion, and filter the traffic participants with occlusion (delete the traffic participants with occlusion from the traffic participant information).
[0072] Specifically, based on the target sensor parameters, the information of traffic participants within the sensor perception range is filtered out from the acquired true value information according to the perception range of the target sensor, and the occlusion problem is handled based on the occlusion simulation discrimination algorithm. First, due to the limitations of the sensor perception range, traffic participants outside the perception range are invisible. In order to ensure the authenticity of the established functional virtual sensor, all traffic participants in the environment need to be filtered based on the perception range of the target sensor to ensure that only those objects within the effective perception area of the sensor are retained. Figure 3 The millimeter wave radar sensing range is demonstrated. Secondly, during normal vehicle driving, due to the occlusion between some traffic participants, some traffic objects may not be effectively detected within the sensing range. To ensure the accuracy of sensor data, an occlusion simulation discrimination algorithm is required to filter out traffic objects that cannot be detected due to occlusion.
[0073] Furthermore, obtaining the traffic participants with occlusion includes:
[0074] Take any traffic participant as the first object to be processed, and determine whether the traversal of the first object to be processed is completed. If the traversal is completed, it proves that there is no occlusion for the first object to be processed. If the traversal is not completed, extract any remaining traffic participant as the second object to be processed, and determine whether the visible triangles of the second object to be processed and the first object to be processed intersect. If not, extract any remaining traffic participant as the third object to be processed, and determine whether it intersects with the visible triangles of the first object to be processed until the traversal is completed. If it intersects, determine the visible angles of the visible triangles of the second object to be processed and the first object to be processed.
[0075] Further, determining the visible angles of visible triangles in the second object to be processed and the first object to be processed includes:
[0076] Determine whether the two viewing edges of the visible triangle in the first object to be processed intersect with the outline of the second object to be processed. If they do not intersect, it proves that there is a segmented partial occlusion. The two viewing edges of the visible triangle in the first object to be processed and the outline of the second object to be processed are judged for segmented partial occlusion visibility. If they intersect, it proves that there is an occlusion in one of the arbitrary viewing edges. The two viewing edges of the visible triangle in the first object to be processed and the outline of the second object to be processed are judged for unilateral partial occlusion visibility.
[0077] Further, segmenting two viewing angle edges of a visible triangle in the first object to be processed and the contour of the second object to be processed to determine partial occlusion visibility includes:
[0078] According to the two viewing angle sides of the visible triangle in the first object to be processed and the two side edges of the contour of the second object to be processed, the left visible angle and the right visible angle are established, and it is judged whether the left visible angle and the right visible angle are greater than the visible threshold of the target sensor. If any of the left visible angle and the right visible angle is greater than the visible threshold of the target sensor, it proves that the target object is visible. If both the left visible angle and the right visible angle are less than the visible threshold of the target sensor, it proves that the target object is invisible.
[0079] Further, segmenting two viewing angle edges of a visible triangle in the first object to be processed and the contour of the second object to be processed to determine partial occlusion visibility includes:
[0080] Determine whether the outline of the second object to be processed is occluded by the left or right viewing angle of the visible triangle of the first object to be processed. If the left viewing angle is occluded, it proves that there is occlusion between the outline of the second object to be processed and the left viewing angle of the visible triangle of the first object to be processed, that is, there is occlusion on the left side of the target object. If the right viewing angle is occluded, it proves that there is occlusion between the outline of the second object to be processed and the right viewing angle of the visible triangle of the first object to be processed, that is, there is occlusion on the right side of the target object.
[0081] Specifically, the principle of the occlusion simulation discrimination algorithm is as follows:
[0082] Whether it is a pyramid representing the sensing range of the visual sensor or a cone representing the sensing range of the millimeter-wave radar, its plane graph can be replaced by an isosceles triangle with its vertex at the position of the vehicle. Figure 4 , ΔCOD is the visible triangle of the target vehicle ABCD to the vehicle, and angle COD is the visible angle; Figure 5 In the figure, the visible triangle ΔCOD of the target car overlaps with the occluding car, which leads to the occlusion problem. According to the degree of occlusion, it can be divided into partial occlusion and full occlusion. Figure 4 The two viewing edges CO and DO of the visible triangle intersect with the outline of the same blocking car, which is a complete occlusion, that is, the target car is completely invisible to the own car because of the blocking car.
[0083] Partial occlusion can be divided into left partial occlusion, right partial occlusion and split partial occlusion according to the position of the occluder.
[0084] Partial occlusion on the left: Figure 6 , which is the case of partial occlusion on the left side. At this time, the visible triangle ΔCOD of the target object only intersects with the left viewing angle CO. At this time, the actual visible triangle is ΔEOD. The actual visible angle EOD is compared to see if it is greater than the visible threshold of the sensor. If it is greater, the target object is judged to be visible, otherwise it is judged to be invisible.
[0085] Partial occlusion on the right: Figure 7 , which is the case of partial occlusion on the right side. At this time, the visible triangle ΔC1OD1 of the target 1 only has the right viewing angle D1O intersecting with the occluder 1. At this time, the actual visible triangle is ΔE1OC1. The actual visible angle E1OC1 is compared to see if it is greater than the visible threshold of the sensor. If it is greater, the target is determined to be visible, otherwise it is determined to be invisible.
[0086] Segmentation partial occlusion: such as Figure 8 , is the case of segmented partial occlusion, in which case the occluder 2 is completely contained in the visible triangle ΔC2OD2 of the target 2. At this time, the actual visible triangles are ΔC2OF2 and ΔE2OD2. The left visible angle C1OF1 and the right visible angle E2OD2 are compared to see whether they are greater than the visible threshold of the sensor. If at least one of the actual visible angles is greater than the visible threshold of the sensor, the target is judged to be visible, otherwise it is judged to be invisible.
[0087] Fig. 9The flowchart of the occlusion judgment algorithm is shown. The object to be processed is taken as the input object and all other objects to be processed are subjected to occlusion judgment in turn. First, object 1 to be processed is input into the process. At this time, the list of objects to be processed has not been traversed yet. The next judgment logic is entered through "No". The current object is the input object. The next object extraction link is entered through "Yes", that is, object 2 to be processed is extracted to enter the process. Object 2 to be processed has not been traversed yet when it enters. The next judgment logic is entered through "No". Object 2 to be processed is not an input object. Therefore, its contour and the visible triangle of the input object (that is, the first object to be processed) are judged to see if they intersect. If they intersect, the visible angle needs to be further compared to determine visibility; if they do not intersect, object 3 to be processed is extracted to enter the process.
[0088] The comparison process of visible angles is as follows Fig.10 First, determine whether the two viewing angles of the visible triangle of the input object intersect with the contour of the current object to be processed. If neither intersects, it is determined to be a segmented partial occlusion, and the segmented partial occlusion visibility judgment process is entered. Otherwise, it is determined to be a unilateral partial occlusion (if both viewing angles intersect with the contour of the current object to be processed, it has been determined to be invisible in the previous logic, so it is impossible for this situation to occur in this process), and the unilateral partial occlusion visibility judgment process is entered.
[0089] Further, adding a corresponding noise model includes: obtaining the type and working environment of the target sensor, and adding a corresponding noise model; wherein the corresponding noise model includes: a Gaussian noise model and a white noise model;
[0090] The method to obtain the Gaussian noise model is:
[0091]
[0092] In the formula, x is a random variable, μ is the random mean, and σ is the standard deviation;
[0093] Acquiring a white noise model includes: using a prime modular multiplication linear congruential generator to generate random numbers uniformly distributed between preset thresholds, transforming the random numbers into white noise that conforms to a Gaussian distribution through a function transformation method, adding the white noise to the ideal output of a functional sensing model, and acquiring a white noise model.
[0094] Specifically, based on different simulation environments and target sensor types, corresponding noise models are added to the acquired traffic participant information to make it consistent with the performance of actual sensors.
[0095] Specifically, according to the characteristics and working environment of each sensor, choosing an appropriate noise model can effectively simulate the random errors and uncertainties faced by the sensor under real conditions, thereby improving the realism and effectiveness of the simulation. The ranging accuracy of LiDAR is usually affected by environmental factors (such as reflectivity, weather conditions, etc.), so Gaussian noise can be used to simulate its measurement error. Millimeter-wave radar signals are also affected by multipath effects and other environmental factors, so Gaussian noise and white noise are suitable for modeling. At the same time, GPS signals are also affected by multipath effects, changes in satellite positions, and atmospheric conditions, so Gaussian noise is usually used to simulate their position errors. This case uses millimeter-wave radar as the target sensor for demonstration, so Gaussian noise is used for modeling.
[0096] The Gaussian model is as follows:
[0097]
[0098] Where x is a random variable, μ is the random mean, and σ is the standard deviation.
[0099] The process of generating and adding Gaussian white noise is as follows Fig.11 First, a prime modulus multiplication linear congruential generator is used to generate random numbers R1 and R2 uniformly distributed between [0,1], where the prime modulus m = 2 31 -1, a=630,360,016. Then, it is transformed into white noise that conforms to Gaussian distribution through function transformation method, and the generated Gaussian white noise is added to the ideal output of the functional sensing model, where the standard deviation of the Gaussian white noise is the standard deviation of the output of the functional sensing model. Its random sequence diagram and probability density function are shown as follows: Fig.12 The length of this random sequence is 10000, the amplitude is about 3, and the probability density function completely conforms to the normal distribution. Its autocorrelation function and power spectrum density are as follows: Fig.13 The values of the autocorrelation function between 0 and 2 are discretely distributed in the range of -0.2 to 0.2, while the power spectrum density corresponds well to the correlation characteristics of white noise.
[0100] Furthermore, the output CAN information includes:
[0101] By utilizing the master-slave communication principle and the CAN protocol of the target sensor, the target information is sent from the environment simulation host to the sensor simulation slave, converted into information in CAN format, and the CAN information is obtained and output based on the slave CAN interface.
[0102] Specifically, based on the master-slave communication principle and the CAN protocol of the target sensor, the target information is sent from the environment simulation host to the sensor simulation slave, and converted into CAN format information and sent through the slave CAN interface, thereby realizing the effective combination of software and hardware.
[0103] First, this case uses ROS communication to send the target information to the slave. Since the required target information type is often not found in the ROS standard information library, it is necessary to customize the ROS information and convert it into an information format that MATLAB can recognize.
[0104] Secondly, the ROS toolkit in MATLAB is used to build a ROS information publishing module, in which the Blank Message module is responsible for receiving data, the Bus Assignment module is used for signal allocation, and the Publish module is used for sending information.
[0105] Thirdly, to achieve communication between the master and slave machines, you must ensure that the master and slave machines are in the same LAN and configure multi-machine communication. Add the IP address and host name of the master and slave machines to the hosts file of the master and slave machines, and set the environment variables of the slave machines to achieve effective communication between the master and slave machines.
[0106] Next, load the CAN device driver on the slave and set the relevant properties. Execute the necessary CAN device driver commands, configure the baud rate, operating mode, etc., to ensure that the CAN device can operate normally and meet the required transmission rate.
[0107] Finally, a ROS subscription node is written on the TX2 platform to receive obstacle information and convert it into CAN messages. The written ROS subscription node will subscribe to the ROS information published by the host MATLAB. The system will manage CAN devices as network devices. Therefore, the SocketCAN interface is provided in the Linux environment, making CAN bus communication consistent with Ethernet communication, and the application development interface more universal and flexible. Use SocketCAN to write information conversion code, convert the target information into CAN format according to the CAN protocol of the target sensor, and send it out through the CAN port.
[0108] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for constructing a virtual sensor for autonomous driving, characterized in that: include: Obtain information about traffic participants; The traffic participant information is obtained by using environmental simulation software; Performing coordinate conversion between the global coordinate system in the environment simulation software and the simulated sensor coordinate system, and converting the traffic participant information into information in the sensor coordinate system; Acquire the sensing range of the target sensor, filter the information in the sensor coordinate system according to the sensing range, and acquire the information in the sensor coordinate system within the sensing range; The traffic participants with occlusion in the traffic participant information within the perception range are filtered, and the corresponding noise model is added to obtain the target information, the target information is converted into the CAN format, and the CAN information is output.
2. The method for constructing a virtual sensor for autonomous driving according to claim 1, characterized in that: The traffic participant information includes: road information, traffic participant information and traffic light information.
3. The method for constructing a virtual sensor for autonomous driving according to claim 1, characterized in that: Converting the traffic participant information into information in the sensor coordinate system includes: Performing coordinate conversion between the global coordinate system and the vehicle coordinate system in the environment simulation software, converting the information of the traffic participant into information in the vehicle coordinate system; performing coordinate conversion between the vehicle coordinate system and the simulated sensor coordinate system, converting the information in the vehicle coordinate system into information in the sensor coordinate system; The coordinate transformation method is: Where (x1, y1) is the coordinate of the point in the target coordinate system, (x0, y0) is the coordinate of the point in the base coordinate system, (a, b) is the coordinate of the origin of the target coordinate system in the base coordinate system, and θ is the angle between the target coordinate system and the base coordinate system.
4. The method for constructing a virtual sensor for autonomous driving according to claim 1, characterized in that: Filtering the traffic participants that are blocked in the traffic participant information within the perception range includes: The plane map of the perception range is replaced with the visible triangle of the traffic participant, and it is determined whether there is any occlusion between the visible triangle of the traffic participant and other traffic participants, and the traffic participants with occlusion are obtained, and the traffic participants with occlusion are filtered.
5. The method for constructing a virtual sensor for autonomous driving according to claim 4, characterized in that: Acquiring the obstructed traffic participant includes: Take any of the traffic participants as the first object to be processed, and determine whether the traversal of the first object to be processed is completed. If the traversal is completed, it proves that there is no occlusion for the first object to be processed. If the traversal is not completed, extract any remaining traffic participants as the second object to be processed, and determine whether the visible triangles of the second object to be processed and the first object to be processed intersect. If not, extract any remaining traffic participants as the third object to be processed, and determine whether the visible triangles of the first object to be processed intersect until the traversal is completed. If they intersect, determine the visible angles of the visible triangles of the second object to be processed and the first object to be processed.
6. The method for constructing a virtual sensor for autonomous driving according to claim 5, characterized in that: Determining visible angles of visible triangles in the second object to be processed and the first object to be processed includes: Determine whether the two viewing edges of the visible triangle in the first object to be processed intersect with the outline of the second object to be processed. If they do not intersect, it proves that there is a segmented partial occlusion. Perform a segmented partial occlusion visibility judgment on the two viewing edges of the visible triangle in the first object to be processed and the outline of the second object to be processed. If they intersect, it proves that there is an occlusion in one of the arbitrary viewing edges. Perform a unilateral partial occlusion visibility judgment on the two viewing edges of the visible triangle in the first object to be processed and the outline of the second object to be processed.
7. The method for constructing a virtual sensor for autonomous driving according to claim 6, characterized in that: The segmentation of two viewing angle edges of a visible triangle in the first object to be processed and the contour of the second object to be processed to determine partial occlusion visibility includes: According to the two viewing angle edges of the visible triangle in the first object to be processed and the two side edges of the outline of the second object to be processed, a left visible angle and a right visible angle are established, and it is determined whether the left visible angle and the right visible angle are greater than the visible threshold of the target sensor. If any of the left visible angle and the right visible angle is greater than the visible threshold of the target sensor, it is proved that the target object is visible; if both the left visible angle and the right visible angle are less than the visible threshold of the target sensor, it is proved that the target object is invisible.
8. The method for constructing a virtual sensor for autonomous driving according to claim 6, characterized in that: The segmentation of two viewing angle edges of a visible triangle in the first object to be processed and the contour of the second object to be processed to determine partial occlusion visibility includes: Determine whether the outline of the second object to be processed is occluded by the left or right viewing angle in the visible triangle of the first object to be processed. If the left viewing angle is occluded, it proves that there is occlusion between the outline of the second object to be processed and the left viewing angle in the visible triangle of the first object to be processed, that is, there is occlusion on the left side of the target object. If the right viewing angle is occluded, it proves that there is occlusion between the outline of the second object to be processed and the right viewing angle in the visible triangle of the first object to be processed, that is, there is occlusion on the right side of the target object.
9. The method for constructing a virtual sensor for autonomous driving according to claim 1, characterized in that: Adding the corresponding noise model includes: obtaining the type and working environment of the target sensor, and adding the corresponding noise model; wherein the corresponding noise model includes: a Gaussian noise model and a white noise model; The method for obtaining the Gaussian noise model is: In the formula, x is a random variable, μ is the random mean, and σ is the standard deviation; Acquiring the white noise model includes: using a prime modular multiplication linear congruential generator to generate random numbers uniformly distributed between preset thresholds, transforming the random numbers into white noise that conforms to a Gaussian distribution through a function transformation method, adding the white noise to the ideal output of a functional sensing model, and acquiring the white noise model.
10. The method for constructing a virtual sensor for autonomous driving according to claim 1, characterized in that: Outputting the CAN information includes: By utilizing the master-slave communication principle and the CAN protocol of the target sensor, the target information is sent from the environment simulation host to the sensor simulation slave and converted into information in CAN format, the CAN information is acquired, and the CAN information is output based on the slave CAN interface.