A method, apparatus, device and medium for generating road maps
By calculating the coordinates and orientation of lane line vertices and combining them with Opendrive format map files, a high-precision road map is generated, solving the problems of insufficient road detail information and large data volume in existing technologies, and realizing detailed depiction and dynamic model support.
Patent Information
- Application Number
- CN202310304212.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-03-27
AI Technical Summary
Existing technologies fail to effectively capture detailed road information in 3D road reconstruction, resulting in 3D models that cannot meet the requirements of high-precision driving simulation. Furthermore, the large amount of data makes it difficult to depict detailed road information.
By acquiring road information, calculating the coordinates and directions of multiple vertices on the lane lines, and using Opendrive format map files, a high-precision road map is generated, supporting real-time updates of dynamic models such as traffic lights.
It enables the generation of high-precision road maps, which can depict detailed road information, reduce data requirements, and support real-time updates of dynamic models, meeting the needs of driving simulation and multiple models.
Smart Images

Figure CN116205981B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of map generation, specifically to a method, apparatus, device, and medium for generating road maps. Background Technology
[0002] In related technologies, the 3D reconstruction of roads and buildings does not focus on detailed road information, such as high-precision shape, color, and type of roads, lane markings, and road surface roughness. This results in 3D models that are insufficient to support scenarios requiring high levels of road detail, such as driving simulations. Furthermore, these technologies rely on coordinate information to build maps, requiring a large amount of data and struggling to meet the demands for detailed road representation.
[0003] Therefore, how to generate high-precision road maps has become a problem that needs to be solved. Summary of the Invention
[0004] This application provides a method, apparatus, device, and medium for generating road maps. Through some embodiments of this application, at least multiple vertices on lane lines can be generated, thereby generating road maps with high accuracy.
[0005] In a first aspect, this application provides a method for generating a road map, the method comprising: acquiring road information of a current road, wherein the road information includes two-dimensional coordinates of the starting point of the centerline of the current road, lane width, and road curve equation; calculating the coordinates and directions of multiple vertices on each lane based on the road information; and drawing a road map of the current road using the coordinates and directions of the multiple vertices, so that a display device can display the road map.
[0006] Therefore, unlike related technologies that build maps based on coordinate information without focusing on detailed road information, the embodiments of this application calculate the coordinates and directions of multiple vertices on each lane using road information. This enables the creation of a road map using vertices on the lane as the smallest unit, thereby clarifying the detailed shape of the lane lines and generating a road map with high accuracy.
[0007] In conjunction with the first aspect, in one embodiment of this application, the plurality of vertices includes the i-th vertex of the current lane, which is any one of the plurality of vertices except the starting point, and the directions of the plurality of vertices on each lane are characterized by heading angles; the calculation of the coordinates and directions of the plurality of vertices on each lane based on the road information includes: calculating the three-dimensional coordinates of the i-th vertex of the current lane based on the three-dimensional coordinates of the starting point of the current lane; calculating the heading angle of the i-th vertex of the current lane based on the two-dimensional coordinates of the i-th vertex of the current lane and the two-dimensional coordinates of the (i+1)-th vertex of the current lane in the UV coordinate system, wherein the UV coordinate system is established with the starting point of the current lane as the origin and the direction of the starting point of the current lane as the coordinate axis; the drawing of the road map of the current road based on the coordinates and directions of the plurality of vertices includes: marking the i-th vertex of the current lane on the map based on the three-dimensional coordinates of the i-th vertex of the current lane and the heading angle, until all vertices on each lane are marked, thereby obtaining the road map of the current road.
[0008] Therefore, by using the (i+1)th vertex to calculate the heading angle of the i-th vertex, the direction of the i-th vertex can be clearly determined, thereby confirming the detailed features of the lane lines and obtaining an accurate road map.
[0009] In conjunction with the first aspect, in one embodiment of this application, the road curve equation includes a road plane curve equation and a height curve equation; the step of calculating the three-dimensional coordinates of the i-th vertex of the current lane line using the three-dimensional coordinates of the starting point of the current lane line includes: inputting the distance from the i-th vertex of the current lane line to the starting point of the current lane line into the road plane curve equation to obtain the two-dimensional coordinates of the i-th vertex of the current lane line in the UV coordinate system; inputting the distance between the i-th vertex of the current lane line and the starting point of the current lane line into the height curve equation to obtain the Z-direction value of the i-th vertex of the current lane line; transforming the two-dimensional coordinates of the i-th vertex of the current lane line into world coordinates and combining them with the Z-direction value of the i-th vertex of the current lane line to obtain the three-dimensional coordinates of the i-th vertex of the current lane line.
[0010] Therefore, by calculating the three-dimensional coordinates of the current lane line, the embodiments of this application can clearly determine the location of each vertex on the lane line, and then draw the detailed features of the lane line based on the direction of each vertex.
[0011] In conjunction with the first aspect, in one embodiment of this application, calculating the heading angle of the i-th vertex of the current lane line based on the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line in the UV coordinate system includes: obtaining the i-th vector between the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line in the UV coordinate system; calculating the i-th angle between the i-th vector and the U-axis in the UV coordinate system; and calculating the angle between the i-th vector and the X-axis in the world coordinate system based on the i-th angle, and using the angle between the vector and the X-axis as the heading angle of the i-th vertex of the current lane line.
[0012] Therefore, the embodiments of this application can obtain an accurate heading angle by using the i-th vector between the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line.
[0013] In conjunction with the first aspect, in one embodiment of this application, before calculating the three-dimensional coordinates of the i-th vertex of the current lane line using the three-dimensional coordinates of the current lane line starting point, the method further includes: obtaining the two-dimensional coordinates of each lane line starting point based on the three-dimensional coordinates of the center line starting point and the direction of the center line starting point; calculating the lateral tilt angle of the current road, and obtaining the offset of each lane line starting point in the Z direction according to the lateral tilt angle and the lane width; adding the offset of each lane line starting point in the Z direction to the Z-direction value in the three-dimensional coordinates of the center line starting point to obtain the Z-direction value of each lane line starting point; and combining the Z-direction value of each lane line starting point with the two-dimensional coordinates of each lane line starting point to obtain the three-dimensional coordinates of each lane line starting point.
[0014] In conjunction with the first aspect, in one embodiment of this application, after marking the i-th vertex of the current lane line on the map based on the three-dimensional coordinates of the i-th vertex of the current lane line and the heading angle, until all vertices on each lane line are marked, the method further includes: connecting the marked vertices on each lane line with a curve to obtain a curve to be rendered; obtaining rendering material corresponding to the road surface material, and rendering the curve to be rendered using the rendering material.
[0015] Therefore, by generating corresponding rendering effects based on the road surface material and conditions, the embodiments of this application can highlight the detailed features of the road and fully restore the original characteristics of the road.
[0016] In conjunction with the first aspect, in one embodiment of this application, after connecting the vertices on each lane line marked by the curve to obtain the curve to be rendered, the method further includes: adding an identifier to the target update object; acquiring the status information of the identifier in real time, and updating the status of the target update object based on the status information.
[0017] Therefore, by dynamically updating the state of the target update object, the embodiments of this application can update the road map according to real-time traffic conditions, thereby obtaining a more accurate road map.
[0018] Secondly, this application provides an apparatus for generating a road map, the apparatus comprising: a road information acquisition module configured to acquire road information of a current road, wherein the road information includes two-dimensional coordinates of the starting point of the centerline of the current road, lane width, and road curve equation; a coordinate calculation module configured to calculate the coordinates and directions of multiple vertices on each lane based on the road information; and a map drawing module configured to draw a road map of the current road using the coordinates and directions of the multiple vertices, so that a display device can display the road map.
[0019] In conjunction with the second aspect, in one embodiment of this application, the plurality of vertices includes the i-th vertex of the current lane, which is any one of the plurality of vertices except the starting point. The directions of the plurality of vertices on each lane are represented by heading angles. The coordinate calculation module is further configured to: calculate the three-dimensional coordinates of the i-th vertex of the current lane using the three-dimensional coordinates of the starting point of the current lane; calculate the heading angle of the i-th vertex of the current lane based on the two-dimensional coordinates of the i-th vertex of the current lane and the two-dimensional coordinates of the (i+1)-th vertex of the current lane in the UV coordinate system, wherein the UV coordinate system is established with the starting point of the current lane as the origin and the direction of the starting point of the current lane as the coordinate axis; the map drawing module is further configured to: mark the i-th vertex of the current lane on the map based on the three-dimensional coordinates of the i-th vertex of the current lane and the heading angle, until all vertices on each lane are marked, thereby obtaining a road map of the current road.
[0020] In conjunction with the second aspect, in one embodiment of this application, the road curve equation includes a road plane curve equation and a height curve equation; the coordinate calculation module is further configured to: input the distance from the i-th vertex of the current lane line to the starting point of the current lane line into the road plane curve equation to obtain the two-dimensional coordinates of the i-th vertex of the current lane line in the UV coordinate system; input the distance between the i-th vertex of the current lane line and the starting point of the current lane line into the height curve equation to obtain the Z-direction value of the i-th vertex of the current lane line; transform the two-dimensional coordinates of the i-th vertex of the current lane line into world coordinates, and combine them with the Z-direction value of the i-th vertex of the current lane line to obtain the three-dimensional coordinates of the i-th vertex of the current lane line.
[0021] In conjunction with the second aspect, in one embodiment of this application, the coordinate calculation module is further configured to: obtain the i-th vector between the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line in the UV coordinate system; calculate the i-th angle between the i-th vector and the U-axis in the UV coordinate system; and, based on the i-th angle, calculate the angle between the i-th vector and the X-axis in the world coordinate system, and use the angle between the vector and the X-axis as the heading angle of the i-th vertex of the current lane line.
[0022] In conjunction with the second aspect, in one embodiment of this application, the coordinate calculation module is further configured to: obtain the two-dimensional coordinates of each lane line starting point based on the three-dimensional coordinates of the centerline starting point and the direction of the centerline starting point; calculate the lateral tilt angle of the current road, and obtain the offset of each lane line starting point in the Z direction according to the lateral tilt angle and the lane width; add the offset of each lane line starting point in the Z direction to the Z-direction value in the three-dimensional coordinates of the centerline starting point to obtain the Z-direction value of each lane line starting point; combine the Z-direction value of each lane line starting point with the two-dimensional coordinates of each lane line starting point to obtain the three-dimensional coordinates of each lane line starting point.
[0023] In conjunction with the second aspect, in one embodiment of this application, the map drawing module is further configured to: connect the vertices on each lane line marked by the curve to obtain the curve to be rendered; obtain rendering material corresponding to the road surface material; and render the curve to be rendered using the rendering material.
[0024] In conjunction with the second aspect, in one embodiment of this application, the map drawing module is further configured to: add an identifier to the target update object; acquire the status information of the identifier in real time, and update the status of the target update object based on the status information.
[0025] Thirdly, this application provides an electronic device, including: a processor, a memory, and a bus; the processor is connected to the memory via the bus, the memory stores a computer program, and the computer program, when executed by the processor, can implement the method as described in any embodiment of the first aspect.
[0026] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed, can perform the methods described in any embodiment of the first aspect. Attached Figure Description
[0027] Figure 1 This is one of the flowcharts illustrating a method for generating a road map according to an embodiment of this application;
[0028] Figure 2 This is one of the schematic diagrams illustrating the calculation process for generating a road map in an embodiment of this application;
[0029] Figure 3 This is a second schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0030] Figure 4 This is the third schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0031] Figure 5 This is the fourth schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0032] Figure 6 This is the fifth schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0033] Figure 7 This is the sixth schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0034] Figure 8 This is the seventh schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0035] Figure 9 This is the eighth schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0036] Figure 10 This is the ninth schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0037] Figure 11 This is the tenth schematic diagram illustrating the calculation process for generating a road map in an embodiment of this application;
[0038] Figure 12This is eleventh of the schematic diagrams illustrating the calculation process for generating road maps in the embodiments of this application;
[0039] Figure 13 This is a second flowchart illustrating a method for generating a road map according to an embodiment of this application;
[0040] Figure 14 This is a schematic diagram illustrating the components of an apparatus for generating road maps, as shown in an embodiment of this application.
[0041] Figure 15 This is a schematic diagram illustrating the composition of an electronic device according to an embodiment of this application. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the protection scope of this application.
[0043] This application can be applied to scenarios involving the generation and rendering of road maps. To address the problems in the background art, in some embodiments of this application, detailed features of each lane line are obtained by calculating the direction and coordinates of each lane line vertex. For example, in some embodiments of this application, the server is configured to: first, acquire road information of the current road; then, calculate the coordinates and directions of multiple vertices on each lane line based on the road information; and finally, draw a road map of the current road using the coordinates and directions of the multiple vertices, so that a display device can display the road map.
[0044] Unlike the embodiments of this application, related technologies, firstly, focus on 3D reconstruction of real-world landscapes and buildings without prioritizing detailed road information, such as the high-precision shape, color, and type of roads, the color and type of lane markings, and the road's roughness. This level of 3D modeling is insufficient for scenarios requiring high levels of road detail, such as driving simulations. Secondly, existing 3D modeling technologies generate static scene models, unable to support dynamic display of objects (e.g., traffic lights). Thirdly, existing technologies rely on coordinate-based maps, requiring a large amount of data and struggling to meet the demands for detailed road depiction. Support for traffic signs, lane markings, obstacles, and custom models is also poor.
[0045] To address the issues of low road accuracy, insufficient road detail, and inadequate road information in existing models, this application focuses on generating road information, producing road models with sufficient accuracy, rich detail, and complete information to meet the needs of applications requiring high road detail. To address the inability to dynamically display traffic lights, this application uses dynamic traffic light models and assigns corresponding IDs to objects, enabling dynamic control of traffic lights by the simulation system. To address the issue of existing technologies requiring large amounts of map data and insufficient detail in road information, this application uses OpenDrive format map files, enabling more detailed road reconstruction with smaller input files. To address the limitations of existing technologies in supporting different types of models, this application imports a pre-built base model to support various types of landscapes, traffic signs, obstacles, and other models.
[0046] The method steps in the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0047] The following describes a method for generating road maps executed by a server in this application. It is understood that the technical solution of the road map generation method in this application can be applied to any server and any electronic device capable of executing the road map generation method. This application does not limit the scope of the application in this regard.
[0048] At least in order to solve the problems in the background technology, such as Figure 1 As shown, some embodiments of this application provide a method for generating road maps, the method comprising:
[0049] S110, obtain the current road information.
[0050] It should be noted that road information includes all information related to the current road, and road information is described using the Opendrive standard.
[0051] As a specific embodiment of this application, the road information includes the starting point information of each road, the road curve equation, the road width, lanes, lane line information, and the position and orientation information of other models (e.g., trees, buildings, traffic lights, etc.) of the current road other than lane lines.
[0052] In other words, road information specifically includes: the coordinates of the road's centerline starting point (two-dimensional, XY), the road's orientation at the starting point, the road's curve equation in the XY plane, the road's elevation curve equation (independent variable: distance from the road apex to the starting point; dependent variable: road elevation at the centerline of that apex), and the road's superelevation curve equation (independent variable: distance from the road apex to the starting point; dependent variable: lateral slope angle of the road surface at the centerline of that apex). Lane information includes: the position of each lane on the road (leftmost, second from left, rightmost, etc.), the width curve of each lane, lane surface information, and lane marking information for each lane, including solid / dark markings, width, and color. Traffic sign information includes: road surface markings, such as left turn, straight ahead, and pedestrian crossings; and information from signs or traffic lights, such as traffic lights, speed limits, and no-entry signs.
[0053] S120 calculates the coordinates and directions of multiple vertices on each lane based on road information.
[0054] In one embodiment of this application, the specific steps for calculating the coordinates and directions of multiple vertices on each lane based on road information are as follows:
[0055] S1201: Calculate the three-dimensional coordinates of the starting point of each lane line based on the three-dimensional coordinates of the starting point of the center line.
[0056] In other words, based on the starting point coordinates of the road centerline, the starting point orientation of the road, the road's elevation curve equation, the road's superelevation curve equation, the position information of the lanes on the road, and the lane width curve, the first set of vertex information of the road at the starting point is calculated, that is, the coordinates X, Y, Z of the starting position point of each lane line are obtained.
[0057] The instruction manual states that the center line is the lane line located in the middle of the current lane. For example, in a two-lane road with five lane lines, the center line is the third lane line.
[0058] First, based on the three-dimensional coordinates of the starting point of the center line and its direction, the two-dimensional coordinates of the starting point of each lane line are obtained.
[0059] Specifically, by substituting the two-dimensional coordinates of the centerline starting point into the elevation curve equation, the elevation coordinates (Z-coordinate) of the centerline starting point are obtained, which is the three-dimensional coordinates of the centerline starting point. Then, based on the width of each lane, the distance from the starting point of each lane to the centerline starting point is calculated, such as... Figure 2 As shown, since the calculation at this step has not yet addressed the direction of the starting points of each lane line, the starting point of each lane line can fall at any point within a certain distance (lane width) from the starting point of the center line. Figure 2 The diagram uses circles to represent the road, where the center is the starting point of the road centerline, the inner circle is the circle containing the boundary points of the first lane lines on the left and right sides, the radius of the inner circle is the width of the first lane lines on the left and right sides, the outer circle is the circle containing the boundary points of the second lane lines on the left and right sides, and the distance between the inner circle and the outer circle is the width of the second lane lines on the left and right sides.
[0060] After obtaining the three-dimensional coordinates of the centerline starting point and the distances of each lane's starting point from the centerline starting point, and combining this with the direction of the centerline starting point, the vertices of the road and lanes at the starting position of the road can be obtained. Specifically, for example... Figure 3 As shown, draw a line perpendicular to the direction of the starting point of the given road centerline. The intersection of this line with the inner circle is the starting point of the first lane on the left and right sides (i.e., A2 and B1), and the intersection of this line with the outer circle is the starting point of the second lane on the left and right sides (i.e., A1 and B2). This gives us the two-dimensional coordinates of the starting point of each lane.
[0061] Then, the lateral tilt angle of the current road is calculated, and the offset of the starting point of each lane line in the Z direction is obtained based on the lateral tilt angle and lane width.
[0062] Specifically, the lateral tilt angle of the road plane is calculated based on the superelevation curve equation, that is, the dependent variable of the superelevation curve equation is set to 0 to obtain the current lateral tilt angle of the road. For example... Figure 4 As shown, the centerline of the road surface is the origin of the coordinate system, the inclined road surface plane is represented by the dashed line, and the lateral inclination angle is the angle between the dashed line and the XY axis.
[0063] Next, the offset of each lane line starting point in the Z direction is added to the value of the starting point of the center line in the Z direction in the three-dimensional coordinates to obtain the value of each lane line starting point in the Z direction.
[0064] Specifically, based on the tilted plane and the width of each lane, the Z-offset of each lane boundary point relative to the road centerline is obtained. Adding the Z-offset of each lane boundary point to the coordinates of the starting point of the centerline yields the Z-coordinate of each lane boundary point. For example... Figure 5As shown, once the width of the four lanes and the Z offset of the four lane boundary points relative to the lane centerline are determined, the Z coordinates of each lane boundary point can be obtained.
[0065] Finally, the Z-direction values of each lane line starting point are combined with the two-dimensional coordinates of each lane line starting point to obtain the three-dimensional coordinates of each lane line starting point.
[0066] In other words, the two-dimensional coordinates of the starting point of each lane line and the value of the starting point of each lane line in the Z direction are obtained in the above steps. These two coordinates are then combined to finally obtain the three-dimensional coordinates of the starting point of each lane line.
[0067] S1202: Calculate the three-dimensional coordinates of the i-th vertex of the current lane line using the three-dimensional coordinates of the starting point of the current lane line.
[0068] It should be noted that the multiple vertices include the i-th vertex of the current lane, which is any one of the multiple vertices except the starting point. The directions of the multiple vertices on each lane are represented by the heading angle. In other words, except for the starting point of each lane which needs to be calculated separately, the other vertices on the lane only need to be calculated using the following method repeatedly.
[0069] In other words, based on the information of the first set of vertex coordinates calculated in S1201, as well as the orientation information of the road starting position, the equation information of the road curve, and the equation of the road height curve, a sampling step size (i.e., the distance between the current vertex and the previous vertex, which can be 1m or 10m) is set, and the coordinates of the vertex of the i-th road surface centerline can be calculated.
[0070] It is understandable that road curve equations include road horizontal curve equations and road vertical curve equations.
[0071] Specifically, the process of calculating the three-dimensional coordinates of the i-th vertex of the current lane line is as follows:
[0072] First, the distance from the i-th vertex of the current lane line to the starting point of the current lane line is input into the road plane curve equation to obtain the two-dimensional coordinates of the i-th vertex of the current lane line in the UV coordinate system.
[0073] Specifically, based on the centerline sampling point coordinates in the first set of vertex information and the road orientation, a coordinate system (UV coordinate system) is defined, such as... Figure 6 As shown, U is the direction of the starting point of the centerline, and V is the direction perpendicular to U. Based on the given road centerline equation, input the distance from the i-th vertex to the previous point, and calculate the coordinates of the i-th vertex in the UV coordinate system. For example, as shown... Figure 7As shown, the origin of the UV coordinate system is the starting coordinate of the road centerline. Inputting the curve length into the road centerline curve equation yields the two-dimensional coordinates of the next vertex, i.e., the location of the next road centerline sampling point. It can be understood that the two-dimensional coordinates of the i-th vertex of each lane are calculated using the above steps.
[0074] Then, the distance between the i-th vertex of the current lane line and the starting point of the current lane line is input into the height curve equation to obtain the Z-direction value of the i-th vertex of the current lane line.
[0075] In other words, by first obtaining the distance between the i-th vertex of the current lane line and the starting point of the current lane line, and then inputting this distance into the pre-obtained height curve equation, the Z-direction value of the i-th vertex of the current lane line in the world coordinate system can be obtained.
[0076] Finally, the two-dimensional coordinates of the i-th vertex of the current lane line are transformed into world coordinates and combined with the Z-direction value of the i-th vertex of the current lane line to obtain the three-dimensional coordinates of the i-th vertex of the current lane line.
[0077] Specifically, let the coordinates of the i-th vertex of the current lane line in the UV coordinate system be (Us, Vs), and the coordinates of the origin of the UV coordinate system in the world coordinate system be (Xwo, Ywo). Then, the XY coordinates of the sampled point in the world coordinate system are (Us+Xwo, Vs+Ywo). This is then combined with the Z-direction value of the i-th vertex of the current lane line obtained in the previous step to obtain the three-dimensional coordinates of the i-th vertex of the current lane line.
[0078] S1203: Calculate the heading angle of the i-th vertex of the current lane line based on the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line in the UV coordinate system.
[0079] It should be noted that the UV coordinate system is established with the starting point of the current lane line as the origin and the direction of the starting point of the current lane line as the coordinate axis.
[0080] First, obtain the i-th vector between the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line in the UV coordinate system.
[0081] Specifically, by repeating the algorithm from the previous step (keeping the UV coordinate system unchanged), the coordinates of the next sampling point can be obtained. After obtaining the sampling coordinates of the next point, a two-dimensional vector between the point calculated by the algorithm in the previous step and the next sampling point can be obtained. The orientation of this vector will be used as the heading angle of the road at this point for subsequent calculations.
[0082] For example, such as Figure 8As shown, the starting point of the current lane line is O, the first vertex is O1, and the second vertex is O2. After obtaining the UV coordinates of O1 and O2 using the method described above, the first vector (Vhi(Ui+1-Ui, Vy+1-Vy)) between O1 and O2 can be obtained by subtracting the UV coordinates of O1(Pi(Ui, Vy)) from the UV coordinates of O2(Pi+1(Ui+1, Vy+1-Vy)).
[0083] Next, calculate the i-th angle between the i-th vector and the U-axis in the UV coordinate system.
[0084] For example, such as Figure 10 As shown, calculate the angle (Hui) between the first vector (Vhi) and the U coordinate axis, that is, obtain the first angle as Hui.
[0085] Finally, based on the i-th included angle, the angle between the i-th vector and the X-axis is calculated in the world coordinate system, and the included angle with the X-axis is used as the heading angle of the i-th vertex of the current lane line.
[0086] In other words, based on the angles between the Hui and U coordinate axes and the world coordinate system, the angle between Hui and the X-axis of the world coordinate system (i.e., the angle of this point's orientation in the world coordinate system) can be calculated. For example... Figure 11 As shown, given the angle Hui between Vhi and the U coordinate axis, Vhi, and the heading angle Hvwi in the world coordinate system, subtracting Hui from Hvwi will give us the angle Huw between the U coordinate axis and the world coordinate system.
[0087] After completing the above calculations, the known data now includes the location information of the next road sampling point, the road orientation of the next point, the initially input road curve equation, road elevation curve equation, road superelevation curve equation, and lane information on the road. By repeating this process, the centerline and lane boundary point information of the next sampling point can be obtained.
[0088] S130 draws a road map of the current road using the coordinates and directions of multiple vertices.
[0089] Specifically, based on the three-dimensional coordinates and heading angle of the i-th vertex of the current lane line, the i-th vertex of the current lane line is marked on the map until all vertices on each lane line are marked, thus obtaining the road map of the current road.
[0090] In other words, after obtaining the three-dimensional coordinates and heading angles of all vertices on the lane line, each vertex is marked on the map, such as... Figure 12 As shown, once the markings are completed, the curvature of the road can be displayed.
[0091] In one embodiment of this application, after marking the vertices on each lane line, it is also necessary to render the map composed of the currently marked vertices. The specific steps are as follows:
[0092] First, connect the vertices on each lane line that have been marked with curves to obtain the curve to be rendered.
[0093] Specifically, after marking the vertices, in order to make the lane lines more in line with the real scene, the vertices on the lane lines are connected to obtain a smooth curve, i.e. the curve to be rendered, so as to clearly show the shape of the lane lines.
[0094] Then, an identifier is added to the target update object, the status information of the identifier is obtained in real time, and the status of the target update object is updated based on the status information.
[0095] Specifically, the target update object can be an object that needs to change in real time. For traffic signs that need to change dynamically, such as traffic lights, the update relies on the state simulated by the simulation engine (e.g., the color of the traffic light). For this type of model, a dynamic model needs to be created, allowing for dynamic model updates after it is loaded into the entire large map. When the target update object is added to the entire large 3D model, a unique ID is assigned to that sub-object based on information from the map file. Thus, when the simulation engine updates the state of the target update object, the state data of the object with the corresponding ID is transferred to the rendering engine, which can then complete the dynamic update of the entire 3D scene based on the corresponding information.
[0096] For example, such as Figure 13 As shown, the text-format map file 133 is input into both the 3D model generation tool and the simulation engine 135. The simulation engine 135 performs simulation calculations on the text-format map file 133, generates the real-time state of the dynamic model, and inputs it into the communication module. The communication module in the rendering engine 134 receives the data and then renders and updates the dynamic sub-objects in the model file. The model file includes a 3D model file 131, which contains dynamic sub-objects (i.e., target update objects) and static sub-objects. It can be understood that static sub-objects are objects that will not change after the map is generated, such as buildings and lanes, while dynamic sub-objects are objects that will be updated in real time after the map is generated, such as traffic lights.
[0097] Finally, obtain the rendering material corresponding to the road surface material, and then render the curve to be rendered using the rendering material.
[0098] In other words, texture mapping is performed on the curved surface based on the road surface material information. After the texture mapping is completed, lane lines are drawn on the curved surface based on the input lane line information. After the lane line information is completed, road landmarks are added to the road based on the sign information, and buildings, trees, warning signs, traffic lights, and other user-defined models are added to the roadside. After completing the above steps, the model information is written from memory to the hard drive and saved as a 3D model file.
[0099] Therefore, addressing the insufficient support for detailed road information in existing technologies, this application utilizes OpenDrive map information, from which detailed road shape, material, and other data can be extracted, and high-precision 3D models can be generated with high-precision step sizes. To address the insufficient support for dynamic models such as traffic lights in existing technologies, this application adds support for dynamic model nodes and, combined with the description information in OpenDrive, assigns unique IDs to dynamic markers, enabling the simulation system to call and control dynamic objects in the 3D model. To address the issue of excessively large map data source files relied upon in existing technologies, this application uses OpenDrive as input, requiring less extensive coordinate information to achieve high-precision road depiction and reconstruction. Regarding the limited support for different model types in existing technologies, this application supports user-defined models, allowing users to add and place them in designated locations, thus expanding and supporting multiple model types.
[0100] Therefore, the core technical points of this application include: support for the OpenDrive format. Based on the OpenDrive format, the required input map file is smaller, and it contains more data, including not only road shapes but also road materials, lane lines, and other data. High-precision reconstruction of road information. Based on the map information provided by OpenDrive, 3D shapes can be generated at different levels of precision depending on the sampling step size. Furthermore, based on information such as road friction coefficients, wear, and lane lines, detailed reconstruction of road material appearance is possible. Support for dynamic models such as traffic lights allows the simulation system to uniquely control all dynamic objects in the model. Support for user-defined models allows users to freely add the models they need.
[0101] The above describes a specific embodiment of a method for generating road maps provided by this application. The following describes an apparatus for generating road maps.
[0102] like Figure 14 As shown, some embodiments of this application provide an apparatus 140 for generating road maps, the apparatus including: a road information acquisition module 141, a coordinate calculation module 142, and a map drawing module 143.
[0103] The road information acquisition module 141 is configured to acquire road information of the current road, wherein the road information includes the two-dimensional coordinates of the starting point of the centerline of the current road, the lane width, and the road curve equation; the coordinate calculation module 142 is configured to calculate the coordinates and directions of multiple vertices on each lane based on the road information; and the map drawing module 143 is configured to draw a road map of the current road using the coordinates and directions of the multiple vertices, so that the display device can display the road map.
[0104] In one embodiment of this application, the plurality of vertices includes the i-th vertex of the current lane, which is any one of the plurality of vertices except the starting point. The directions of the plurality of vertices on each lane are represented by heading angles. The coordinate calculation module 142 is further configured to: calculate the three-dimensional coordinates of the i-th vertex of the current lane using the three-dimensional coordinates of the starting point of the current lane; calculate the heading angle of the i-th vertex of the current lane based on the two-dimensional coordinates of the i-th vertex of the current lane and the two-dimensional coordinates of the (i+1)-th vertex of the current lane in the UV coordinate system, wherein the UV coordinate system is established with the starting point of the current lane as the origin and the direction of the starting point of the current lane as the coordinate axis; the map drawing module 143 is further configured to: mark the i-th vertex of the current lane on the map based on the three-dimensional coordinates of the i-th vertex of the current lane and the heading angle, until all vertices on each lane are marked, thereby obtaining a road map of the current road.
[0105] In one embodiment of this application, the road curve equation includes a road plane curve equation and a height curve equation; the coordinate calculation module 142 is further configured to: input the distance from the i-th vertex of the current lane line to the starting point of the current lane line into the road plane curve equation to obtain the two-dimensional coordinates of the i-th vertex of the current lane line in the UV coordinate system; input the distance between the i-th vertex of the current lane line and the starting point of the current lane line into the height curve equation to obtain the Z-direction value of the i-th vertex of the current lane line; transform the two-dimensional coordinates of the i-th vertex of the current lane line into world coordinates, and combine them with the Z-direction value of the i-th vertex of the current lane line to obtain the three-dimensional coordinates of the i-th vertex of the current lane line.
[0106] In one embodiment of this application, the coordinate calculation module 142 is further configured to: obtain the i-th vector between the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line in the UV coordinate system; calculate the i-th angle between the i-th vector and the U-axis in the UV coordinate system; calculate the angle between the i-th vector and the X-axis in the world coordinate system based on the i-th angle, and use the angle between the vector and the X-axis as the heading angle of the i-th vertex of the current lane line.
[0107] In one embodiment of this application, the coordinate calculation module 142 is further configured to: obtain the two-dimensional coordinates of the starting points of each lane line based on the three-dimensional coordinates of the centerline starting point and the direction of the centerline starting point; calculate the lateral tilt angle of the current road, and obtain the offset of each lane line starting point in the Z direction according to the lateral tilt angle and the lane width; add the offset of each lane line starting point in the Z direction to the value in the Z direction of the three-dimensional coordinates of the centerline starting point to obtain the value of each lane line starting point in the Z direction; combine the value of each lane line starting point in the Z direction with the two-dimensional coordinates of each lane line starting point to obtain the three-dimensional coordinates of each lane line starting point.
[0108] In one embodiment of this application, the map drawing module 143 is further configured to: connect the vertices on each lane line marked by the curve to obtain the curve to be rendered; obtain the rendering material corresponding to the road surface material; and render the curve to be rendered using the rendering material.
[0109] In one embodiment of this application, the map drawing module 143 is further configured to: add an identifier to the target update object; acquire the status information of the identifier in real time, and update the status of the target update object based on the status information.
[0110] In the embodiments of this application, Figure 14 The module shown can achieve Figures 1 to 13 Each process in the method embodiment. Figure 14 The operations and / or functions of each module in the document are respectively designed to achieve... Figures 1 to 13 The corresponding processes are described in the method embodiments above. For details, please refer to the descriptions in the above method embodiments; to avoid repetition, detailed descriptions are appropriately omitted here.
[0111] like Figure 15As shown, this application provides an electronic device 150, including: a processor 151, a memory 152 and a bus 153. The processor is connected to the memory via the bus. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, they are used to implement the method as described in any one of the above embodiments. For details, please refer to the description in the above method embodiments. To avoid repetition, detailed descriptions are appropriately omitted here.
[0112] The bus is used to enable direct communication between these components. In this embodiment, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), an On-Premises Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in this embodiment. The general-purpose processor can be a microprocessor or any conventional processor.
[0113] The memory can be, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory stores computer-readable instructions, which, when executed by the processor, can perform the methods described in the above embodiments.
[0114] Understandable. Figure 15 The structure shown is for illustrative purposes only and may include structures larger than [other structures]. Figure 15 The more or fewer components shown, or having the same Figure 15 The different configurations shown. Figure 15 The components shown can be implemented using hardware, software, or a combination thereof.
[0115] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a server, it implements any of the methods described in all the above embodiments. For details, please refer to the descriptions in the above method embodiments. To avoid repetition, detailed descriptions are appropriately omitted here.
[0116] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0117] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for generating road maps, characterized in that, The method includes: Obtain the road information of the current road, wherein the road information includes the two-dimensional coordinates of the starting point of the centerline of the current road, the lane width, and the road curve equation; Based on the road information, calculate the coordinates and orientations of multiple vertices on each lane line; A road map of the current road is drawn using the coordinates and orientations of the multiple vertices, so that the display device can display the road map; The plurality of vertices includes the i-th vertex of the current lane line, and the i-th vertex of the current lane line is any one of the plurality of vertices except the starting point. The directions of the plurality of vertices on each lane line are represented by the heading angle. The step of calculating the coordinates and orientations of multiple vertices on each lane based on the road information includes: calculating the three-dimensional coordinates of the i-th vertex of the current lane line using the three-dimensional coordinates of the starting point of the current lane line; and calculating the heading angle of the i-th vertex of the current lane line based on the two-dimensional coordinates of the i-th vertex and the (i+1)-th vertex of the current lane line in the UV coordinate system, wherein the UV coordinate system has the starting point of the current lane line as its origin. The direction of the starting point of the current lane line is established by the coordinate axis; the process of drawing the road map of the current road using the coordinates and directions of the multiple vertices includes: marking the i-th vertex of the current lane line on the map based on the three-dimensional coordinates of the i-th vertex of the current lane line and the heading angle, until all vertices on each lane line are marked, thereby obtaining the road map of the current road.
2. The method according to claim 1, characterized in that, The road curve equations include road horizontal curve equations and road elevation curve equations; The step of calculating the three-dimensional coordinates of the i-th vertex of the current lane line using the three-dimensional coordinates of the starting point of the current lane line includes: Input the distance from the i-th vertex of the current lane line to the starting point of the current lane line into the road plane curve equation to obtain the two-dimensional coordinates of the i-th vertex of the current lane line in the UV coordinate system; Input the distance between the i-th vertex of the current lane line and the starting point of the current lane line into the height curve equation to obtain the Z-direction value of the i-th vertex of the current lane line; The two-dimensional coordinates of the i-th vertex of the current lane line are transformed into world coordinates and combined with the Z-direction value of the i-th vertex of the current lane line to obtain the three-dimensional coordinates of the i-th vertex of the current lane line.
3. The method according to claim 1, characterized in that, The calculation of the heading angle of the i-th vertex of the current lane line based on the two-dimensional coordinates of the i-th vertex and the (i+1)-th vertex of the current lane line in the UV coordinate system includes: Obtain the i-th vector between the two-dimensional coordinates of the i-th vertex of the current lane line and the two-dimensional coordinates of the (i+1)-th vertex of the current lane line in the UV coordinate system; Calculate the i-th angle between the i-th vector and the U-axis in the UV coordinate system; Based on the i-th included angle, the angle between the i-th vector and the X-axis is calculated in the world coordinate system, and the included angle with the X-axis is used as the heading angle of the i-th vertex of the current lane line.
4. The method according to claim 1, characterized in that, Before calculating the three-dimensional coordinates of the i-th vertex of the current lane line using the three-dimensional coordinates of the starting point of the current lane line, the method further includes: Based on the three-dimensional coordinates of the starting point of the centerline and the direction of the starting point of the centerline, the two-dimensional coordinates of the starting point of each lane line are obtained. Calculate the lateral tilt angle of the current road, and obtain the offset of the starting point of each lane line in the Z direction based on the lateral tilt angle and the lane width; The offset of each lane line starting point in the Z direction is added to the value of the starting point of the center line in the Z direction in the three-dimensional coordinates to obtain the value of each lane line starting point in the Z direction. The three-dimensional coordinates of the starting points of each lane line are obtained by combining the Z-direction values of the starting points of each lane line with the two-dimensional coordinates of the starting points of each lane line.
5. The method according to any one of claims 1-4, characterized in that, After marking the i-th vertex of the current lane line on the map based on the three-dimensional coordinates of the i-th vertex of the current lane line and the heading angle, and continuing until all vertices on each lane line have been marked, the method further includes: The marked vertices on each lane line are connected by curves to obtain the curve to be rendered; Obtain rendering materials corresponding to the road surface material, and render the curve to be rendered using the rendering materials.
6. The method according to claim 5, characterized in that, After connecting the vertices of each lane line marked with curves to obtain the curve to be rendered, the method further includes: Add an identifier to the target object to be updated; The status information of the identifier is acquired in real time, and the status of the target update object is updated based on the status information.
7. An apparatus for generating road maps, characterized in that, The device includes: The road information acquisition module is configured to acquire the road information of the current road, wherein the road information includes the two-dimensional coordinates of the starting point of the centerline of the current road, the lane width, and the road curve equation; The coordinate calculation module is configured to calculate the coordinates and orientations of multiple vertices on each lane based on the road information; A map drawing module is configured to draw a road map of the current road using the coordinates and directions of the plurality of vertices, so that a display device can display the road map; The plurality of vertices includes the i-th vertex of the current lane line, and the i-th vertex of the current lane line is any one of the plurality of vertices except the starting point. The directions of the plurality of vertices on each lane line are represented by the heading angle. The coordinate calculation module is specifically used to: calculate the three-dimensional coordinates of the i-th vertex of the current lane line using the three-dimensional coordinates of the starting point of the current lane line; and calculate the heading angle of the i-th vertex of the current lane line based on the two-dimensional coordinates of the i-th vertex and the (i+1)-th vertex of the current lane line in the UV coordinate system, wherein the UV coordinate system has the starting point of the current lane line as its origin. The direction of the starting point of the current lane line is established by the coordinate axis; the map drawing module is specifically used to: mark the i-th vertex of the current lane line on the map based on the three-dimensional coordinates of the i-th vertex of the current lane line and the heading angle, until the vertices of each lane line are marked, and obtain the road map of the current road.
8. An electronic device, characterized in that, include: Processor, memory, and bus; The processor is connected to the memory via the bus, and the memory stores a computer program that, when executed by the processor, can implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Lane line map construction method based on camera sensor and construction system
CN109084782A