A simulation test method and device for roads and scenes in autonomous driving
By using real-time CSV data to generate signal data tables, split the road into arc segments and straight line segments, write xodr and vtd-xml files to determine the simulation scene actions, solving the time-consuming and labor-consuming problem of high-precision autonomous driving simulation roads and scene construction, and achieving efficient simulation testing.
Patent Information
- Application Number
- CN202310283256.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-19
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-03-19
AI Technical Summary
In the prior art, the construction of large-scale high-precision autonomous driving simulation roads and scenarios consumes time and labor costs, making it difficult to achieve efficient automated generation.
By obtaining the real car CSV data, a signal data table is generated, and based on the road-related signals and scene-related signals recorded in the signal data table, the road is divided into arc segments and straight line segments, the position coordinates of each segment are calculated, and the motion trajectory of the bicycle and target vehicle is written into the xodr and vtd-xml files, the simulation scene action and action start time are determined, and the opendrive, vtd-xml and openscenario files are generated for simulation testing.
It realizes high-precision simulation road and scene generation, improves simulation testing efficiency, and greatly saves manpower and time costs.
Smart Images

Figure CN116524758B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of autonomous driving simulation testing, and in particular to a method and device for simulation testing of roads and scenes in autonomous driving. Background Art
[0002] With the development of autonomous vehicles from L2 to L3 levels, more and more testing work is being done on autonomous vehicles. Autonomous driving simulation is a very important part of it. It converts a large amount of autonomous driving real vehicle development and testing costs into computer simulation development and testing, saving a lot of time, labor and material costs. Autonomous driving simulation is based on simulation testing of simulation software. VTD is one of them, which can simulate roads and dynamic traffic flows. The road part consists of opendrive files with the suffix .xodr files, and the dynamic traffic flow part consists of openscenario and vtd-xml files with the suffixes .xosc files and .xml files respectively. Usually, .xodr, .xosc, and .xml files are manually built and generated on VTD. The time and labor costs of building large quantities of simulated roads and scenes are often huge. If large-scale, high-precision automatic generation of simulated roads and scenes can be achieved, the efficiency of autonomous driving simulation testing will be greatly improved. Summary of the Invention
[0003] In response to the technical problems existing in the prior art, the present invention provides a simulation test method and device for roads and scenes in autonomous driving. Based on the collected CSV data of real vehicles, high-precision restoration of simulated roads in XODR format and simulated scenes in XOSC and XML formats is performed. The method supports the generation of arbitrarily complex roads and arbitrarily complex scenes. The converted OpenX simulation files are imported into VTD for simulation testing. This automated method greatly improves the efficiency of simulation work and greatly saves manpower and time costs.
[0004] The technical solution of the present invention to solve the above technical problems is as follows:
[0005] In a first aspect, the present invention provides a method for simulating and testing roads and scenes in autonomous driving, comprising:
[0006] Obtain real vehicle CSV data and generate a signal data table. The first row of the signal data table contains a header containing various signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2;
[0007] Based on the road-related signals recorded in the signal data table, the road is divided into a combination of multiple arc segments and straight segments, the position coordinates of the arc segments and the straight segments are calculated, and the attributes of each road trajectory are written into the xodr file to construct a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type;
[0008] Determine the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determine the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and write the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file;
[0009] Determine the scene actions and action start times included in the simulation scenario based on simulation requirements. Determine the simulation properties of each scene action based on the motion trajectory coordinates and action start times of the ego vehicle and target vehicle, and write the simulation properties of each scene action into the vtd-xml file and the openscenario file.
[0010] Use the generated opendrive file, vtd-xml file, and openscenario file to perform simulation tests.
[0011] Furthermore, the header of the signal data table includes road-related signals and scene-related signals, wherein the road-related signals include: the distance between the vehicle and the left and right lane lines, lane line curvature, road slope, lane line type, and road width; the scene-related signals include: the lateral and longitudinal distances between the vehicle and the target vehicle, the speed of the vehicle and the target vehicle, acceleration, target object ID, and target object type.
[0012] Furthermore, based on the road-related signals recorded in the signal data table, the road is divided into a combination of multiple arc segments and straight segments, and the position coordinates of the arc segments and the straight segments are calculated, including:
[0013] Obtain lane curvature and divide the road into multiple road segments based on the lane curvature;
[0014] Setting a first curvature threshold, dividing a road segment whose lane line curvature is greater than the first curvature threshold into an arc segment, and dividing a road segment whose lane line curvature is less than the first curvature threshold into a straight segment;
[0015] Set a second curvature threshold, traverse all arc segments, calculate the curvature difference between adjacent arc segments, and if the curvature difference between adjacent arc segments is less than the second curvature threshold, combine the two adjacent arc segments into one arc segment;
[0016] For any combined arc segment S, the distance the vehicle travels on the arc segment S is counted as the length of the arc where the arc segment is located, and the yaw angle of the arc segment S is calculated.
[0017] Furthermore, the motion trajectory coordinates of the vehicle relative to the road trajectory are determined based on the road trajectory attributes, including: determining the lane in which the vehicle is located based on the distance between the vehicle and the lane lines on both sides, and calculating the motion trajectory coordinates of the vehicle based on the trajectory coordinates of the lane in which the vehicle is located.
[0018] Furthermore, the motion trajectory coordinates of the target vehicle are determined based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, including: calculating the motion trajectory coordinates of each frame during the period when the target vehicle appears in the ego vehicle's field of view based on the relative horizontal and vertical distances between the target vehicle and the ego vehicle in each frame.
[0019] Furthermore, the scene actions include: the ego vehicle changing lanes, the target vehicle changing lanes, the ego vehicle overtaking the target vehicle, the target vehicle overtaking the ego vehicle, and the ego vehicle and the target vehicle overtaking and being overtaken multiple times.
[0020] Furthermore, the simulation properties of each scene action are determined based on the motion trajectory coordinates of the ego vehicle and the target vehicle and the action start time, including:
[0021] The scenario action is a lane change for the ego vehicle: the lane change duration is calculated based on the time difference between the ego vehicle in the two lanes before and after the lane change; the scenario action for the ego vehicle's lane change is determined based on the lane change duration and the set lane change time point;
[0022] The scenario action is a target vehicle lane change: the target vehicle's lane is obtained, the target vehicle's lane change type is determined based on the lateral distance change characteristics between the target vehicle and the ego vehicle, and the lane change duration is calculated based on the time difference between the target vehicle in the two lanes before and after the lane change. Based on the lane change duration and the set lane change time point, the target vehicle's lane change scenario action is determined. The target vehicle's lane change types include cutting into the host lane from the left lane, cutting into the host lane from the right lane, cutting into the left lane from the host lane, and cutting into the right lane from the host lane.
[0023] The scenario action is the ego vehicle overtaking the target vehicle: Based on the signal data table, the target vehicle's speed in the first frame when the target vehicle appears in the ego vehicle's field of view and the relative lateral and longitudinal distances of the target vehicle to the ego vehicle are used as the target vehicle's initial speed and initial position. Based on the target vehicle's initial speed and initial position, the scenario action of the ego vehicle overtaking the target vehicle is determined.
[0024] The scenario action is that the target vehicle overtakes the own vehicle: Following operation parameters and overtaking operation parameters are set. Before the action start time, the target vehicle performs the following operation of the own vehicle according to the following operation parameters. At the action start time, the target vehicle performs the overtaking operation according to the overtaking operation parameters. The scenario action of the target vehicle overtaking the own vehicle is determined based on the following operation parameters and the overtaking operation parameters. The following operation parameters include the following vehicle position and the following vehicle speed, and the overtaking operation parameters include the lane change action and the overtaking speed.
[0025] The scenario action is that the ego vehicle and the target vehicle have multiple overtaking and being overtaken: the scenario action is split into a combination of scenario actions of the ego vehicle overtaking the target vehicle and the target vehicle overtaking the ego vehicle, and the scenario action of the ego vehicle and the target vehicle overtaking the ego vehicle is determined based on the scenario action of the ego vehicle overtaking the target vehicle and the scenario action of the target vehicle overtaking the ego vehicle.
[0026] In a second aspect, the present invention provides a simulation test device for roads and scenes in autonomous driving, comprising:
[0027] The data acquisition module obtains the real vehicle CSV data and generates a signal data table. The first row of the signal data table contains a header containing multiple signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2;
[0028] The first file construction module divides the road into a combination of multiple arc segments and straight segments based on the road-related signals recorded in the signal data table, calculates the position coordinates of the arc segments and straight segments, writes the attributes of each road trajectory into the xodr file, and constructs a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type;
[0029] The second file construction module determines the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determines the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and writes the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file;
[0030] The third file construction module determines the scene actions and action start times included in the simulation scenario according to the simulation requirements, determines the simulation properties of each scene action based on the motion trajectory coordinates of the ego vehicle and the target vehicle and the action start time, and writes the simulation properties of each scene action into the vtd-xml file and the openscenario file;
[0031] The simulation module uses the generated opendrive file, vtd-xml file and openscenario file to perform simulation tests.
[0032] In a third aspect, the present invention provides an electronic device, comprising:
[0033] Memory for storing computer software programs;
[0034] The processor is used to read and execute the computer software program, thereby implementing the simulation test method for roads and scenes in autonomous driving described in the first aspect of the present invention.
[0035] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium, in which a computer software program is stored. When the computer software program is executed by a processor, it implements a simulation test method for roads and scenes in autonomous driving as described in the first aspect of the present invention.
[0036] The beneficial effects of the present invention are: based on the collected real vehicle CSV data, the present invention performs high-precision restoration of simulated roads in XODR format and simulation scenes in XOSC and XML formats, supports the generation of arbitrarily complex roads and arbitrarily complex scenes, and imports the converted OpenX simulation files into VTD for simulation testing. This automated method greatly improves the efficiency of simulation work and greatly saves manpower and time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic flow chart of a method for simulating testing roads and scenarios in autonomous driving provided by an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of road trajectory generation provided by an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of motion trajectory generation provided by an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of a vehicle changing lanes according to an embodiment of the present invention;
[0041] Figure 5 A schematic diagram of a target vehicle changing lanes provided by an embodiment of the present invention;
[0042] Figure 6 A schematic diagram of a vehicle overtaking a target vehicle according to an embodiment of the present invention;
[0043] Figure 7 A schematic diagram of a target vehicle overtaking a vehicle according to an embodiment of the present invention;
[0044] Figure 8 A schematic diagram of the structure of a simulation test device for roads and scenes in autonomous driving provided by an embodiment of the present invention;
[0045] Figure 9 A schematic diagram of an electronic device according to an embodiment of the present invention;
[0046] Figure 10 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0048] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the described features. In the description of this application, "plurality" means two or more, unless otherwise specifically specified.
[0049] In the description of this application, the term "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any person skilled in the art to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art will recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.
[0050] like Figure 1 As shown, an embodiment of the present invention provides a simulation test method for roads and scenes in autonomous driving, including:
[0051] Obtain real vehicle CSV data and generate a signal data table. The first row of the signal data table contains a header containing various signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2;
[0052] Based on the road-related signals recorded in the signal data table, the road is divided into a combination of multiple arc segments and straight segments, the position coordinates of the arc segments and the straight segments are calculated, and the attributes of each road trajectory are written into the xodr file to construct a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type;
[0053] Determine the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determine the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and write the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file;
[0054] Determine the scene actions and action start times included in the simulation scenario based on simulation requirements. Determine the simulation properties of each scene action based on the motion trajectory coordinates and action start times of the ego vehicle and target vehicle, and write the simulation properties of each scene action into the vtd-xml file and the openscenario file.
[0055] Use the generated opendrive file, vtd-xml file, and openscenario file to perform simulation tests.
[0056] The present invention performs high-precision restoration of simulated roads in xodr format and simulated scenes in xosc and xml formats based on the collected real vehicle csv data, supports the generation of arbitrarily complex roads and arbitrarily complex scenes, and imports the converted openx simulation files into vtd for simulation testing. This automated method greatly improves the efficiency of simulation work and greatly saves manpower and time costs.
[0057] Specifically, an embodiment of the present invention provides a method for simulating testing of roads and scenes in autonomous driving, comprising the following steps:
[0058] S1, Data Preparation
[0059] Collect CSV data from real vehicles. The first row of this data must contain headers, which contain signal names. Examples include road-related signals such as distance to left and right lane markings, distance to left, right, left, and right lane markings, curvature, slope, lane marking type, and road width. Scene-related signals include the lateral and longitudinal distances between the vehicle and target vehicle, speed and acceleration of the vehicle and target vehicle, target object ID, and target object type. These are basic signals.
[0060] The more signals, the more helpful they are for simulation. Starting from the second row, the actual values of the consecutive frames corresponding to each signal are displayed. There are approximately 40 frames per second, and different acquisition frequencies correspond to different data frames. Errors in the data are then corrected by comparing it to the actual video footage to ensure the accuracy of the acquired data. Only in this way can accurate simulation files be generated.
[0061] S2, road trajectory generation
[0062] The difficulty in accurately recreating simulated roads lies in processing curves. Key information must be extracted from the data to achieve the same curvature as in real images, ensuring that curves are where they should be and straightens where they should be. Basic road information, such as road width, lane type, and number of lanes, can be directly obtained from step S1. These numerical values are stored in the corresponding structural attributes of the xodr file. Road trajectories are generated through a series of transformations based on the curvature of the lanes.
[0063] Positive curvature indicates a left curve, while negative curvature indicates a right curve. The lane curvature is obtained and the road is divided into multiple road segments based on the lane curvature. A first curvature threshold is set. In this embodiment, the first curvature threshold is 0.001. Curvatures greater than 0.0001 are considered curves, while those less than 0.0001 are considered straights. A second curvature threshold is then set. From the first to the last frame of data, several frames with a small difference in curvature values are selected. This second curvature threshold can be set based on practical experience.
[0064] Assume that a certain arc is S, count the distance the vehicle has traveled in this section, take this distance as the length of the curvature circle arc, calculate the corresponding central angle of this arc according to the ratio of the arc to the circumference, and then divide it by the length of the arc to calculate the change in central angle for every 1m of advance, that is, the change in lane line yaw angle. Knowing the horizontal and vertical coordinate values of the current road and the road curvature, the coordinate information of each subsequent small segment can be derived and calculated until all the position coordinate information of arc segment S is counted. The curvature of each road segment is different, and the corresponding road curvature is also different. From the first frame to the last frame of the data, there will be multiple arc segments and straight lines with different curvatures similar to arc segment S. After calculating the position coordinates of all arc segments and straight lines, the trajectory coordinates of the entire road are calculated, and the horizontal and vertical coordinate values, yaw angles, and line types of each small segment are written into the corresponding attributes of the xodr file, and a complete opendrive file will be constructed.
[0065] like Figure 2 As shown, assuming that the length of the first arc is s1, that is, the distance traveled by the vehicle when the curvature of the first segment is greater than 0.0001, and the curvature is c1, then the curvature radius is r1=1 / c1, the corresponding curvature circumference is 2*π*r1, and the corresponding central angle is a=(180*s1) / (π*r1). The left curvature of the road is positive and a is a positive value, and the right curvature of the road is negative and a is a negative value. That is, the lane passes through segment s1, and the yaw angle changes by a. Then, for every 1m increase in the distance in segment s1, the yaw angle changes by a / s1. Assuming that segment s1 has n points p1, p2....p n , the distance between each point is 1m, then the yaw angle change of each point is a / s1, and the coordinates of each point can be calculated from the previous point, p n Point coordinates p n (xn ,y n ), the yaw angle is hdg n , p n-1 Point coordinates p n-1 (x n-1 ,y n-1 ), the yaw angle is hdg n-1 , then x n =x n-1 +1*cos(a / s1),y n =y n-1 +1*sin(a / s1), hdg n =hdg n-1 +a / s1, the curvature of each section of road is different, and the corresponding road curvature is also different, just like Figure 2 For the arcs s1 and s2 in the data, there will be multiple arcs and straight lines with different curvatures similar to the arcs s1 and s2 from the first frame to the last frame of the data. The position coordinates of all arcs and straight lines are calculated.
[0066] S3, target motion trajectory generation
[0067] The accuracy of the target motion trajectory is one of the important manifestations of the high-precision restoration effect of the simulation scene. The generation of the motion trajectory includes the trajectory of the ego vehicle and the trajectory of the target vehicle.
[0068] Taking a two-lane road as an example, it is assumed that the road trajectory in step S2 is the lane trajectory of the left lane.
[0069] a. Vehicle trajectory: Based on the distances between the vehicle and the left and right lane markings, and the distances to the left-left and right-right lane markings in step S1, the vehicle's lane can be calculated. If the vehicle has a distance to the left lane marking but not to the left-left lane marking, and if the vehicle has a distance to both the right lane marking and the right-right lane marking, then the vehicle is in the left lane. If the vehicle has a distance to both the left lane marking and the left-left lane marking, and if the vehicle has a distance to the right lane marking but the distances to the right-right lane marking are uneven, then the vehicle is in the right lane. Once the vehicle's lane, distance to the left lane marking, and lane width are determined, the vehicle's motion trajectory coordinates can be calculated by combining them with the trajectory coordinates of the left lane. The left-left lane marking here refers to the second lane marking to the left of the vehicle, and the right-right lane marking refers to the second lane marking to the right of the vehicle.
[0070] like Figure 3As shown, assuming that the trajectory coordinates of the left lane L have been calculated and generated in step S2, the left lane coordinate point at the same position as the ego vehicle is (x, y), the distance between the ego vehicle and the left lane is L0, and the lane width is 3.5, then the ego vehicle position coordinates are (x, y-L0). When the ego vehicle is in the right lane, the left lane line of the ego vehicle is the middle dotted line, then the ego vehicle position coordinates are (x, y-3.5-L0). By calculating the ego vehicle position coordinates at all positions, the complete motion trajectory of the ego vehicle is generated.
[0071] b. Target vehicle trajectory. The coordinates of the ego vehicle's motion trajectory have been calculated. Based on the relative horizontal and vertical distances between the target vehicle and the ego vehicle at each frame time, the coordinates of the target vehicle's motion trajectory at each frame time during the period of time during which the target vehicle appears in the ego vehicle's field of view can be calculated.
[0072] When the lane is a straight road with a yaw angle of zero, assuming the relative horizontal and vertical coordinates of the ego vehicle and the target vehicle are dx and dy, where dx is positive in front and negative in the back, and dy is positive on the left and negative on the right, the target vehicle's position is (x + dx, y + dy - L0). Calculating the target vehicle's position coordinates at all positions generates the target vehicle's complete trajectory. When the lane is not a straight road with a yaw angle of zero, the relative horizontal and vertical coordinates dx and dy of the ego vehicle and the target vehicle are not based on the original coordinate system but on the ego vehicle's direction of motion. Assuming the lane yaw angle at the current ego vehicle's position is hdg, this value can be obtained from the lane trajectory in step S2. The left lane coordinate point at the same position as the ego vehicle is (x, y), and the target vehicle's position is (x', y'). Then x' = x + dx * cos (hdg) - dy * sin (hdg), and y' = y + dx * sin (hdg) + dy * cos (hdg) - L0.
[0073] Write the trajectory coordinates of the ego vehicle and target vehicle into the Waypoint field corresponding to the PathShape in the vtd-xml file. The xosc file is similar. Then the vehicle motion trajectory function of the openscenario and vtd-xml files required for scene generation is realized.
[0074] S4, determination of scene action
[0075] Scenario actions include lane changes by the ego vehicle, lane changes by the target vehicle, the ego vehicle overtaking the target vehicle, the target vehicle overtaking the ego vehicle, and multiple instances of overtaking and being overtaken by the ego vehicle and target vehicle. The accuracy of these scene actions is another key indicator of the high-precision reproduction of the simulation scene. The accuracy of these scene actions primarily refers to the timing and actions of lane changes by the ego vehicle and target vehicle, as well as the timing and actions of overtaking and being overtaken by the target vehicle. For other scenarios, such as routine vehicle following, precise control of scene timing and actions is not required; simply specifying the target position and speed is sufficient to achieve excellent simulation results. The following describes in detail how to accurately simulate lane changes and overtaking scenarios.
[0076] a. The vehicle changes lanes. Whether the vehicle changes lanes can be determined by whether the lane the vehicle is in changes. Figure 4 As shown, the lane change of the ego vehicle is determined based on the changes in the values of L0, L1, and L2. The lane change duration can be calculated by taking the difference between the time points when the ego vehicle is in the middle of the road before and after the lane change. Assuming the lane width is d, whether the ego vehicle is in the middle of the road can be determined based on the distance between the left and right lane lines L0 and L1. When L0 = L1 = d / 2, the ego vehicle is in the middle of the road. Assuming that the time point when the ego vehicle appears in the middle of the road after the lane change is t2, and the time point when the ego vehicle appears in the middle of the road before the lane change is t1, the lane change time is t2-t1. Using this method, the time points and duration of all lane changes of the ego vehicle in this scene can be calculated.
[0077] b. The target vehicle changes lanes, such as Figure 5 As shown in the figure. The target vehicle's lane change time can be calculated by the change in the relative lateral distance between the target vehicle and the ego vehicle. Given the lane in which the ego vehicle is located, assuming the lane width is d, the relative lateral distance is positive on the left and negative on the right, and the ego vehicle does not change lanes, when the relative lateral distance changes from d to 0, it indicates that the target vehicle is switching from the left lane to the ego vehicle's lane. When the relative lateral distance changes from -d to 0, it indicates that the target vehicle is switching from the right lane to the ego vehicle's lane. When the relative lateral distance changes from 0 to d, it indicates that the target vehicle is switching from the ego vehicle's lane to the left lane. When the relative lateral distance changes from 0 to -d, it indicates that the target vehicle is switching from the ego vehicle's lane to the right lane. The target vehicle's lane change duration is calculated by converting the number of CSV frames required for the relative lateral distance to change from d to 0 or from 0 to d into time.
[0078] c. The ego vehicle overtakes the target vehicle, such as Figure 6 To achieve a realistic scene, the target vehicle must start and reach its initial velocity the moment it appears in the ego vehicle's field of view. In the collected data, the velocity and relative horizontal and vertical distances of the target vehicle in the first frame are used as the initial velocity and position of the target vehicle.
[0079] First, it is necessary to accurately judge from the actual vehicle CSV data whether the scene is the ego vehicle overtaking the target vehicle or the target vehicle overtaking the ego vehicle. When reading the relative longitudinal distance x between the ego vehicle and the target vehicle in the CSV data frame by frame, if x gradually increases from 0, the target vehicle has overtaken the ego vehicle. If the value of x is very large as soon as it appears and then gradually decreases to 0, it means that the ego vehicle has overtaken the target vehicle. After determining that the ego vehicle has overtaken the target vehicle, the target vehicle's action must achieve a realistic scene effect. The target vehicle needs to start with the initial velocity the moment it appears in the ego vehicle's field of view. In the collected data, the speed and relative horizontal and longitudinal distances of the target vehicle in the first frame are used as the initial speed and initial position of the target vehicle. The target vehicle is automatically placed in the lane next to the ego vehicle. When the target vehicle appears from the ego vehicle's field of view, it starts with the initial velocity to avoid the visual effect of the target vehicle stopping on the road. Then the ego vehicle gradually approaches the target vehicle and overtakes it from the lane next to it, thereby achieving a real overtaking effect.
[0080] d. The target car overtakes the self car, such as Figure 7 As shown in the figure, the actual vehicle CSV data must be used to accurately determine whether the scene is the ego vehicle overtaking the target vehicle or the target vehicle overtaking the ego vehicle. When reading the relative longitudinal distance x between the ego vehicle and the target vehicle from the CSV data frame by frame, if x gradually increases from 0, the target vehicle has overtaken the ego vehicle. If x is initially very high and then gradually decreases to 0, the ego vehicle has overtaken the target vehicle. Once the target vehicle has been determined to have overtaken the ego vehicle, the target vehicle's motion state before its appearance is unknown. To achieve the target vehicle's precise appearance within the ego vehicle's field of view at a specific moment, designing a motion path for the target vehicle would create obstructions and other issues, hindering a realistic overtaking effect due to the large number of target vehicles in the scene and their diverse movements. This solution employs a target vehicle that synchronously follows the ego vehicle 3 meters behind it. Its speed and lane change behavior match those of the ego vehicle. When the target vehicle is about to overtake the ego vehicle, the target vehicle is given a lane change at the actual target vehicle speed, achieving a realistic overtaking effect.
[0081] e. The ego vehicle and the target vehicle overtake and are overtaken multiple times. When the ego vehicle overtakes and is overtaken multiple times with the same target vehicle, when the overtaking occurs and when the overtaking occurs, the target vehicle's movement behavior when it is not in the ego vehicle's field of view is unknown. To reduce the conflict between this target vehicle and other target vehicles on the road, before the ego vehicle overtakes the target vehicle, follow the steps in c. After the ego vehicle overtakes the target vehicle, set the target vehicle to change lanes and follow behind the ego vehicle, maintaining the same speed and movement trajectory as the ego vehicle. When the target vehicle overtakes the ego vehicle again, follow the steps in d.
[0082] Write the above scene actions into the corresponding field attributes of vtd-xml and openscenario, then the realistic scene effect of openscenario and vtd-xml files required for scene generation will be achieved.
[0083] S5. Import the generated road opendrive file, scenario openscenario, and vtd-xml file into the vtd software. The osgb file required for simulation is converted by loading the xodr file and operating on the vtd. To achieve batch automatic generation of osgb files, use the following command in the Rod directory of vtd: . / ROD --projectDefaultProject / DefaultProject.rpj --xodr2tdo
[0084] / VTD.2021 / Runtime / Tools / RodDistro_6987_Rod4.6.2 / DefaultProject / Odr / AutoDrv_CruiseCtrl_05_01.xodr The first and second commands are fixed usage, and the third command is the xodr file save path. The above is a file conversion method. To achieve batch conversion, use a shell file, write all the xodr file conversion commands that need to be converted into the shell file line by line, run . / shell file name.sh, and the osgb file conversion results will be saved in the database directory.
[0085] S6, load all generated simulation files into VTD, connect HIL test bench for simulation test.
[0086] like Figure 8 As shown, an embodiment of the present invention further provides a simulation test device for roads and scenes in autonomous driving, comprising:
[0087] The data acquisition module obtains the real vehicle CSV data and generates a signal data table. The first row of the signal data table contains a header containing multiple signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2;
[0088] The first file construction module divides the road into a combination of multiple arc segments and straight segments based on the road-related signals recorded in the signal data table, calculates the position coordinates of the arc segments and straight segments, writes the attributes of each road trajectory into the xodr file, and constructs a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type;
[0089] The second file construction module determines the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determines the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and writes the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file;
[0090] The third file construction module determines the scene actions and action start times included in the simulation scenario according to the simulation requirements, determines the simulation properties of each scene action based on the motion trajectory coordinates of the ego vehicle and the target vehicle and the action start time, and writes the simulation properties of each scene action into the vtd-xml file and the openscenario file;
[0091] The simulation module uses the generated opendrive file, vtd-xml file and openscenario file to perform simulation tests.
[0092] See also Figure 9 , Figure 9 Schematic diagram of an embodiment of an electronic device provided by an embodiment of the present invention. Figure 9 As shown, an embodiment of the present invention provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor 520. When the processor 520 executes the computer program 511, the following steps are implemented:
[0093] Obtain real vehicle CSV data and generate a signal data table. The first row of the signal data table contains a header containing various signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2;
[0094] Based on the road-related signals recorded in the signal data table, the road is divided into a combination of multiple arc segments and straight segments, the position coordinates of the arc segments and the straight segments are calculated, and the attributes of each road trajectory are written into the xodr file to construct a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type;
[0095] Determine the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determine the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and write the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file;
[0096] Determine the scene actions and action start times included in the simulation scenario based on simulation requirements. Determine the simulation properties of each scene action based on the motion trajectory coordinates and action start times of the ego vehicle and target vehicle, and write the simulation properties of each scene action into the vtd-xml file and the openscenario file.
[0097] Use the generated opendrive file, vtd-xml file, and openscenario file to perform simulation tests.
[0098] See also Figure 10 , Figure 10 Schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. Figure 10 As shown, this embodiment provides a computer-readable storage medium 600 on which a computer program 611 is stored. When the computer program 611 is executed by a processor, the following steps are implemented:
[0099] Obtain real vehicle CSV data and generate a signal data table. The first row of the signal data table contains a header containing various signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2;
[0100] Based on the road-related signals recorded in the signal data table, the road is divided into a combination of multiple arc segments and straight segments, the position coordinates of the arc segments and the straight segments are calculated, and the attributes of each road trajectory are written into the xodr file to construct a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type;
[0101] Determine the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determine the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and write the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file;
[0102] Determine the scene actions and action start times included in the simulation scenario based on simulation requirements. Determine the simulation properties of each scene action based on the motion trajectory coordinates and action start times of the ego vehicle and target vehicle, and write the simulation properties of each scene action into the vtd-xml file and the openscenario file.
[0103] Use the generated opendrive file, vtd-xml file, and openscenario file to perform simulation tests.
[0104] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0105] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0107] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0109] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0110] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A simulation test method for roads and scenes in autonomous driving, characterized in that: include: Obtain real vehicle CSV data and generate a signal data table. The first row of the signal data table contains a header containing various signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2; Based on the road-related signals recorded in the signal data table, the road is divided into a combination of multiple arc segments and straight segments, the position coordinates of the arc segments and the straight segments are calculated, and the attributes of each road trajectory are written into the xodr file to construct a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type; Determine the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determine the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and write the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file; Determine the scene actions and action start times included in the simulation scenario based on simulation requirements. Determine the simulation properties of each scene action based on the motion trajectory coordinates and action start times of the ego vehicle and target vehicle, and write the simulation properties of each scene action into the vtd-xml file and the openscenario file. Use the generated opendrive file, vtd-xml file, and openscenario file to perform simulation tests.
2. The simulation test method according to claim 1, wherein: The header of the signal data table includes road-related signals and scene-related signals, wherein the road-related signals include: the distance between the vehicle and the left and right lane lines, lane line curvature, road slope, lane line type, and road width; the scene-related signals include: the lateral and longitudinal distances between the vehicle and the target vehicle, the speed of the vehicle and the target vehicle, acceleration, target object ID, and target object type.
3. The simulation test method according to claim 1, wherein: According to the road-related signals recorded in the signal data table, the road is divided into a combination of multiple arc segments and straight segments, and the position coordinates of the arc segments and the straight segments are calculated, including: Obtain lane curvature and divide the road into multiple road segments based on the lane curvature; Setting a first curvature threshold, dividing a road segment whose lane line curvature is greater than the first curvature threshold into an arc segment, and dividing a road segment whose lane line curvature is less than the first curvature threshold into a straight segment; Set a second curvature threshold, traverse all arc segments, calculate the curvature difference between adjacent arc segments, and if the curvature difference between adjacent arc segments is less than the second curvature threshold, combine the two adjacent arc segments into one arc segment; For any combined arc segment S, the distance the vehicle travels on the arc segment S is counted as the length of the arc where the arc segment is located, and the yaw angle of the arc segment S is calculated.
4. The simulation test method according to claim 1, wherein: The motion trajectory coordinates of the ego vehicle relative to the road trajectory are determined according to the road trajectory attributes, including: determining the lane of the ego vehicle according to the distance between the ego vehicle and the lane lines on both sides, and calculating the motion trajectory coordinates of the ego vehicle in combination with the trajectory coordinates of the lane.
5. The simulation test method according to claim 1, wherein: The motion trajectory coordinates of the target vehicle are determined based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, including: calculating the motion trajectory coordinates of each frame during the period when the target vehicle appears in the ego vehicle's field of view based on the relative horizontal and vertical distances between the target vehicle and the ego vehicle in each frame.
6. The simulation test method according to claim 1, wherein: The scene actions include: the ego vehicle changing lanes, the target vehicle changing lanes, the ego vehicle overtaking the target vehicle, the target vehicle overtaking the ego vehicle, and the ego vehicle and the target vehicle overtaking and being overtaken multiple times.
7. The simulation test method according to claim 6, characterized in that: Based on the motion trajectory coordinates and action start time of the ego vehicle and target vehicle, the simulation properties of each scene action are determined, including: The scenario action is a lane change for the ego vehicle: the lane change duration is calculated based on the time difference between the ego vehicle in the two lanes before and after the lane change; the scenario action for the ego vehicle's lane change is determined based on the lane change duration and the set lane change time point; The scenario action is a target vehicle lane change: the target vehicle's lane is obtained, the target vehicle's lane change type is determined based on the lateral distance change characteristics between the target vehicle and the ego vehicle, and the lane change duration is calculated based on the time difference between the target vehicle in the two lanes before and after the lane change. Based on the lane change duration and the set lane change time point, the target vehicle's lane change scenario action is determined. The target vehicle's lane change types include cutting into the host lane from the left lane, cutting into the host lane from the right lane, cutting into the left lane from the host lane, and cutting into the right lane from the host lane. The scenario action is the ego vehicle overtaking the target vehicle: Based on the signal data table, the target vehicle's speed in the first frame when the target vehicle appears in the ego vehicle's field of view and the relative lateral and longitudinal distances of the target vehicle to the ego vehicle are used as the target vehicle's initial speed and initial position. Based on the target vehicle's initial speed and initial position, the scenario action of the ego vehicle overtaking the target vehicle is determined. The scenario action is that the target vehicle overtakes the own vehicle: Following operation parameters and overtaking operation parameters are set. Before the action start time, the target vehicle performs the following operation of the own vehicle according to the following operation parameters. At the action start time, the target vehicle performs the overtaking operation according to the overtaking operation parameters. The scenario action of the target vehicle overtaking the own vehicle is determined based on the following operation parameters and the overtaking operation parameters. The following operation parameters include the following vehicle position and the following vehicle speed, and the overtaking operation parameters include the lane change action and the overtaking speed. The scenario action is that the ego vehicle and the target vehicle have multiple overtaking and being overtaken: the scenario action is split into a combination of scenario actions of the ego vehicle overtaking the target vehicle and the target vehicle overtaking the ego vehicle, and the scenario action of the ego vehicle and the target vehicle overtaking the ego vehicle is determined based on the scenario action of the ego vehicle overtaking the target vehicle and the scenario action of the target vehicle overtaking the ego vehicle.
8. A simulation test device for roads and scenes in autonomous driving, characterized by: include: The data acquisition module obtains the real vehicle CSV data and generates a signal data table. The first row of the signal data table contains a header containing multiple signal names. The second to nth rows record the actual values collected in each data frame corresponding to each type of signal, where n>2; The first file construction module divides the road into a combination of multiple arc segments and straight segments based on the road-related signals recorded in the signal data table, calculates the position coordinates of the arc segments and straight segments, writes the attributes of each road trajectory into the xodr file, and constructs a complete opendrive file; the attributes of the road trajectory include road trajectory coordinates, yaw angle, and line type; The second file construction module determines the motion trajectory coordinates of the ego vehicle relative to the road trajectory based on the road trajectory attributes, determines the motion trajectory coordinates of the target vehicle based on the relative position relationship between the target vehicle and the ego vehicle and the motion trajectory coordinates of the ego vehicle, and writes the motion trajectory coordinates of the ego vehicle and the target vehicle into the vtd-xml file; The third file construction module determines the scene actions and action start times included in the simulation scenario according to the simulation requirements, determines the simulation properties of each scene action based on the motion trajectory coordinates of the ego vehicle and the target vehicle and the action start time, and writes the simulation properties of each scene action into the vtd-xml file and the openscenario file; The simulation module uses the generated opendrive file, vtd-xml file and openscenario file to perform simulation tests.
9. An electronic device, characterized in that: include: Memory for storing computer software programs; A processor is used to read and execute the computer software program, thereby implementing the simulation test method for roads and scenes in autonomous driving as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that The storage medium stores a computer software program, which, when executed by a processor, implements a simulation test method for roads and scenes in autonomous driving as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Automatic driving simulation test scene generation method and device
CN111123920A
In-loop simulation system and information processing method and device thereof
CN111665738A