A road median position calculation method for intelligent traffic simulation
By calculating the position and rotation angle of the median strip and combining it with the lane width offset, the problem of complex modeling in existing traffic simulations is solved, and the generation of median strip models is achieved quickly and accurately, making them suitable for large-scale road adjustments.
Patent Information
- Application Number
- CN202211731092.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In existing traffic simulation technologies, the method of modeling road medians using graphical tools is complex and requires certain computer graphics knowledge, resulting in insufficient modeling flexibility, small simulation scale, and difficulty in quickly adapting to road adjustments.
A method for calculating the location of road medians in intelligent transportation simulation is adopted. By acquiring road information, the starting and ending points of the median are calculated, and the position of the middle part of the model is determined by interpolation and rotation angle. Combined with lane width offset, the median model can be quickly generated and adjusted.
It achieves rapid and accurate generation of median strip models, suitable for large-scale road adjustments, reducing manual modeling time and improving model generation efficiency.
Smart Images

Figure CN116050113B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic simulation technology, specifically a method for calculating the location of road medians for intelligent traffic simulation. Background Technology
[0002] Since the 1980s, the country has vigorously developed basic transportation infrastructure construction, and the road construction in my country's large and medium-sized cities has made great progress. Now, the Internet of Vehicles and Intelligent Transportation Systems (ITS) are also developing rapidly, forming a relatively complete road traffic system.
[0003] However, with the increase in the number of vehicles, urban pollution is becoming more and more serious, traffic pressure is increasing, and the utilization rate of traffic roads is showing different differences. For traffic congestion sections, municipal planning will be redesigned and planned. In order to assess the environmental pollution caused by vehicle exhaust and verify the rationality and effectiveness of municipal road design, it is necessary to design a three-dimensional traffic simulation system based on urban road data to test the simulation effect and efficiency. At the same time, it is of great significance for urban traffic display and accident scene reconstruction.
[0004] Current traffic simulation technology, in terms of simulation scale, still suffers from limitations such as small simulation scale, insufficient flexibility, and limited application value. In terms of 3D simulation, most methods use graphics tools such as 3ds Max and CAD to model roads, while methods for modeling road medians using programs are relatively complex and require a foundation in computer graphics. Summary of the Invention
[0005] The purpose of this invention is to provide a method for calculating the location of road medians in intelligent transportation simulation, in order to solve the problem that the existing technology mentioned in the background art requires modeling through graphic tools, which leads to complex modeling methods and requires a certain knowledge base, resulting in insufficient flexibility and convenience in modeling and simulation.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] A method for calculating the location of road medians in intelligent transportation simulation, characterized by the following steps:
[0008] Step S1: Based on the preset road information, obtain the total width of the lanes and the road curve point set Spline(P0, P1, ..., P...). i); Determine the starting and ending points of the median strip based on the road information, and connect the starting and ending points through the intermediate part model; Determine the total length L of the intermediate part model, assuming that all models are set in the left-hand coordinate system, and the initial coordinates and rotation angles are (0,0,0).
[0009] Step S2: Determine the initial position and rotation angle of the starting part of the model based on the starting point of the isolation zone;
[0010] Step S3: Determine the position and rotation angle of the first intermediate part model based on the position of the initial part model;
[0011] Step S4: Determine the positions and rotation angles of the remaining intermediate models based on the position of the first intermediate model.
[0012] Step S5: Offset according to the width of the left and right lanes of the road.
[0013] According to the above technical solution, the calculation of position and rotation angle in step S2 is as follows:
[0014] The starting part is located at the starting position of the road curve point, i.e., P0; and the direction of the starting part model should be consistent with the direction of vector p0p1. Then the starting part model should rotate θ units around the Y-axis, where θ is the angle between the X-axis unit vector i (1, 0, 0) and the turning vector p0p1.
[0015] According to the above technical solution, the specific calculation method for the position of the first intermediate part model in step S3 is as follows:
[0016] Starting from the initial point P0 of the curve point set Spline, first determine whether the distance D(P0, P1) between P0 and P1 is greater than the length L of the middle part model. If D(P0, P1) >= L, then interpolate between P0 and P1 using half the length of the middle part model L / 2 and D(P0, P1) to obtain the position Pos0 of the first middle part model, and rotate it by a certain angle.
[0017] According to the above technical solution, the specific calculation method for the rotation angle is as follows:
[0018] The first intermediate part of the model rotates by θ units around the Y-axis, where θ is the angle between the X-axis unit vector i (1, 0, 0) and the turning vector p0p1.
[0019] According to the above technical solution, the specific calculation method for the position of the second intermediate part model in step S4 is as follows:
[0020] Assume that the position of the second middle part model is Pos1, and the termination position of the first middle part model is a; the distance D(a, P1) between a and P1 < L, take the next curve point P2, calculate the distance between a and P2, if D(a, P2) >= L, then interpolate at a ratio of t between P1 and P2 to obtain point b, ensuring that the distance between a and b is L, and calculate according to the following formula:
[0021] D(P1t+(1-t)P2,a)=L (1)
[0022] Where D is the distance function between two points.
[0023] According to the above technical solution, after obtaining t and interpolating to get point b, the position of Pos1 is the midpoint of a and b. Therefore, the position of the second model is Pos1. After obtaining the position of the second model, rotate it by a certain angle.
[0024] According to the above technical solution, the rotation is to rotate θ units around the Y axis, and θ is the included angle between the unit vector i(1, 0, .....) of the X axis and the vector ab.
[0025] According to the above technical solution, the specific calculation of the positions of the remaining middle models is as follows:
[0026] When looping through the entire curve point set Spline to the termination point, if the distance D(c, P i ) between c and P i >= L / 2, then the final model position is the midpoint of c and P i , and the model length is shortened to D(c, P i ); if D(c, P i ) < L / 2, then change the position of c to P i , the model length is elongated, and P i is the termination point of Spline.
[0027] According to the above technical solution, in step S5, the specific steps of the offset are as follows:
[0028] First, calculate the offset amount Offset = (total width of the left lane of the road - total width of the right lane of the road) / 2; then calculate the direction unit vector v of the offset; finally, offset the vector v by Offset units in the direction to obtain the final position.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] Through the present invention, the model of the road isolation belt can be produced quickly. Moreover, after the road is adjusted, through the method in the present invention, it can also be adjusted quickly, can quickly adapt to the adjustment of the road, and is convenient for the change and simulation of the road model.
[0031] The method in this invention has a continuous production function, which can quickly and accurately generate median strips for road models. It is suitable for the automatic generation of large-scale median strip models for road sections. Furthermore, the generated median strip models are accurately positioned. Compared with existing technologies, it effectively reduces the time for manual modeling and improves the model generation efficiency. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the connection of the present invention;
[0033] Figure 2 This is a schematic diagram of the starting part of the present invention;
[0034] Figure 3 This is a schematic diagram of the middle part of the present invention;
[0035] Figure 4 This is a schematic diagram of the isolation zone of the present invention;
[0036] Figure 5 This is one of the effect diagrams of the present invention;
[0037] Figure 6 This is the second illustration of the invention. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] Example 1
[0040] like Figure 1 , Figure 2 and Figure 3 As shown, a method for calculating the location of road medians in intelligent transportation simulation is characterized by the following steps:
[0041] Step S1: Based on the preset road information, obtain the total width of the lanes and the road curve point set Spline(P0, P1, ..., P...). i ); Determine the starting and ending points of the median strip based on the road information, and connect the starting and ending points through the intermediate part model; Determine the total length L of the intermediate part model, assuming that all models are set in the left-hand coordinate system, and the initial coordinates and rotation angles are (0,0,0).
[0042] Step S2: Determine the initial position and rotation angle of the starting part of the model based on the starting point of the isolation zone;
[0043] Step S3: Determine the position and rotation angle of the first intermediate part model based on the position of the initial part model;
[0044] Step S4: Determine the positions and rotation angles of the remaining intermediate models based on the position of the first intermediate model.
[0045] Step S5: Offset according to the width of the left and right lanes of the road.
[0046] This invention enables the rapid production of road median strip models. Furthermore, after road adjustments are made, the method described in this invention allows for rapid adjustments as well, facilitating changes and simulations of the road model.
[0047] The method in this invention has a continuous production function, which can quickly and accurately generate median strips for road models. It is suitable for the automatic generation of large-scale median strip models for road sections. Furthermore, the generated median strip models are accurately positioned. Compared with existing technologies, it effectively reduces the time for manual modeling and improves the model generation efficiency.
[0048] Example 2
[0049] This embodiment is a further refinement of Embodiment 1. In step S2, the calculation of the rotation angle is specifically as follows:
[0050] The starting part is located at the starting position of the road curve points, i.e., P0 (P0 is the set of road curve points Spline(P0, P1, ..., P...) described at the beginning). i The starting point is P0 in the model; and the direction of the starting part model should be consistent with the direction of vector p0p1. Then the starting part model should rotate θ units around the Y-axis, where θ is the angle between the X-axis unit vector i (1, 0, 0) and the direction of the vector p0p1.
[0051] In step S3, the specific calculation method for the position of the first intermediate part of the model is as follows:
[0052] Starting from the initial point P0 of the curve point set Spline, first determine whether the distance D(P0, P1) between P0 and P1 is greater than the length L of the middle part model. If D(P0, P1) >= L, then interpolate between P0 and P1 using half the length of the middle part model L / 2 and D(P0, P1) to obtain the position Pos0 of the first middle part model, and rotate it by a certain angle.
[0053] The interpolation function is as follows: Lerp(a,b,t)=(1-t)*a+t*b; where a is P0, b is P1, t is the proportion, i.e. t=(L / 2) / DP0,P1), and D is the function for calculating the distance between two points.
[0054] The specific calculation method of the rotation angle is as follows:
[0055] The first intermediate part model rotates by θ units around the Y-axis, where θ is the angle between the unit vector i(1, 0, 0) of the X-axis and the vector p0p1.
[0056] Embodiment III
[0057] This embodiment is a further refinement of Embodiment I.
[0058] In step S4, the specific calculation method of the position of the second intermediate part model is as follows:
[0059] Assume that the position of the second intermediate part model is Pos1, and the termination position of the first intermediate part model is a; the distance D(a, P1) between a and P1 < L, take the next curve point P2, calculate the distance between a and P2, if D(a, P2) >= L, then interpolate to get point b between P1 and P2 at a ratio of t, ensuring that the distance between a and b is L, and calculate according to the following formula:
[0060] D(P1t+(1 - t)P2, a) = L (1)
[0061] Where D is the distance function between two points.
[0062] After obtaining t, interpolate to get point b, then the position of Pos1 is the midpoint of a and b, so the position of the second model is Pos1. After obtaining the position of the second model, rotate it by a certain angle.
[0063] Its rotation is to rotate by θ units around the Y-axis, where θ is the angle between the unit vector i(1, 0, 0) of the X-axis and the vector ab.
[0064] The specific calculation of the positions of the remaining intermediate models is as follows:
[0065] When looping through the entire curve point set Spline to the termination point, if the distance D(c, P i ) >= L / 2, then the position of the last model is the midpoint of c and P i ), and the model length is shortened to D(c, P i ); if D(c, P i ) < L / 2, then change the position of c to P i ), the model length is elongated, and P i is the termination point of Spline. i
[0066] In step S5, the specific steps of the offset are as follows:
[0067] First, calculate the offset: Offset = (total width of the left lane - total width of the right lane) / 2; then calculate the direction vector v; finally, the vector v is the final position, which is the direction offset Offset units.
[0068] Example 4
[0069] The inventive concept is as follows: This invention mainly includes the following steps:
[0070] Step S1: Determine the condition of the isolation zone model;
[0071] like Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown, there are generally three types of isolation zone models: (1) those with either a start or end portion; (2) those with both a start and end portion; and (3) those without a start or end portion. The difference between them lies in the fact that when calculating the middle part of the isolation zone, it is necessary to first determine the position of the start or end portion of the model. Figure 1 For case (1), the isolation strip model with the starting part, Figure 2 For case (3), taking the case where the isolation zone model has a starting part as an example, the algorithm steps for calculating the position of the isolation zone are introduced, such as... Figure 3 As shown in the top view, firstly, the road curve point set Spline(p0, P1, ..., p) has been obtained. i Given the length L of the model in the middle of the isolation zone, the position and rotation of the model prefabricated body are both initial values (0, 0, 0).
[0072] Step S2: Determine the position and rotation of the initial part of the isolation zone model;
[0073] The starting part should be located at the starting position of the road curve point, i.e., p0, and the direction should be consistent with the direction of vector p0p1. Since it is a left-handed coordinate system, the starting part should rotate the X-axis unit vector i (1, 0, 0) around the Y-axis and turn towards the vector p0p1 by an angle θ units.
[0074] Step S3: Determine the position and rotation of the first intermediate part of the model;
[0075] Starting from the initial point of the Spline point set, first determine whether the distance D(p0, P1) between p0 and P1 is greater than the length L of the middle part of the model, such as... Figure 4-5 If D(p0, P1) >= L, then the position Pos0 of the first middle part of the model is obtained by interpolation between p0 and P1 using the ratio of half the model length L / 2 to D(p0, P1). The rotation is the angle θ between the Y-axis and the X-axis unit vector i(1, 0, 0) and the direction vector p0p1.
[0076] Step S4, find the position Pos1 of the second model and the positions of the subsequent models;
[0077] As Figure 3 in, when the termination position of the first middle part model is a, and the distance D(a, P1) from P1 < L, then take the next curve point P2, calculate the distance between a and P2. If D(a, P2) >= L, then interpolate at a ratio of t between P1 and P2 to obtain point b, ensuring that the distance between a and b is L. If D(a, P2) < L, then take the next point until the condition is satisfied; Figure 4-5 in here D(a, P2) > L, and the key lies in the calculation of the t value. First, know the position of point a, assumed to be (x0, y0, z0), and also know the positions of P1 and P2 as (x1, y1, z1), (x2, y2, z2). Then, according to the above conditions, the equation (1) can be obtained:
[0078] D(p1t+(1 - t)p2, a) = L (1)
[0079] In the equation, D is the distance function between two points. Substitute a, P1, and P2 into equation 4 - 1 and simplify to obtain equation (2):
[0080]
[0081] Among them Under the condition of satisfaction, there exists t and t ∈ [0, 1]. Let Then, according to the quadratic formula, we get (3):
[0082]
[0083] After finding t, interpolate to obtain point b. Then the position of Pos1 is the midpoint of a and b. Therefore, the position of the second model is Pos1, and its rotation is by an angle of θ units of the included angle between the unit vector i(1, 0, 0) of the X - axis rotating around the Y - axis and the vector ab. When looping through the entire curve point set Spline to the termination point, as Figure 4-5 in, the distance D(c, p i ) from c to p i ) >= L / 2, then the position of the final model is the midpoint of c and p i , and the model length is shortened to D(c, p i ); if D(c, p i ) < L / 2, then change the position of c to p i , and the model length is elongated.
[0084] Step S5, offset according to the widths of the left and right lanes of the road when calculating the position; <>
[0085] The location information calculated through steps S2, S3, and S4 is only based on the position of the curve point in the center of the road, not the exact position of the guardrail. Therefore, an offset is required. The specific steps are as follows: First, calculate the offset amount Offset = (total width of the left lane - total width of the right lane) / 2; then calculate the unit vector v of the offset direction. Figure 3 Taking the offset of position Pos1 as an example, the vector v = (ba) × (0,-1,0) is a unit vector, where × is the cross product of vectors, that is, the unit vector v is perpendicular to the vector (ba); finally, the final position is offset by Offset units from Pos1 as the starting point and vector v as the direction.
[0086] The above is the position calculation algorithm for case (1) in step S1. The algorithms for cases (2) and (3) are similar, except that the position of the termination part needs to be determined.
[0087] Example 5
[0088] Generating only the middle section of the isolation strip model involves the following steps:
[0089] Step 1: Based on the road information, obtain the total width of the left and right lanes and calculate the offset.
[0090] Step 2: Obtain the length of the middle part of the model;
[0091] Step 3: Iterate through the road curve point set, calculate the position and rotation of each model, and record them;
[0092] Step 4: Generate the isolation zone model based on the position and rotation cycle;
[0093] Step 5: Merge all the generated median strip models into one model to obtain the road median strip.
[0094] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0095] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for calculating the position of a road median in intelligent transportation simulation, characterized in that: The method comprises the following steps: Step S1, according to the preset road information, the total width of the lane and the road curve point set Spline (P0, P1,..., P i ) are obtained; the starting point and the ending point of the separation belt are determined according to the road information, and the intermediate part model is connected between the starting point and the ending point; the total length L of the intermediate part model is determined, and it is assumed that all the models are arranged in the left-hand coordinate system, and the initial coordinates and the rotation angle are (0, 0, 0); Step S2, determining the initial position and rotation angle of the starting part model according to the starting point of the isolation belt; the calculation of the position and rotation angle is specifically as follows: The start portion is located at the start position of the road curve point, i.e. P0; and the direction of the start portion model should be consistent with the direction of the vector The start portion model should be rotated by units of Y axis, to the angle between the X axis unit vector (1, 0, 0) and the tangent vector . Step S3, determining the position and rotation angle of the first intermediate part model according to the position of the starting part model; the specific calculation method of the position of the first intermediate part model is as follows: Starting from the curve point set Spline initial point P0, first, judge whether the distance D (P0, P1) between P0 and P1 is greater than the length L of the intermediate part model, if D (P0, P1) >= L, then the first intermediate part model position Pos0 is obtained by interpolating the distance D (P0, P1) with half of the length L / 2 of the intermediate part model between P0 and P1, and a certain angle is rotated; the specific calculation method of the rotation angle is as follows: The first intermediate part model is rotated by Y axis one unit, is the X axis unit vector the steering vector (1, 0, 0) the included angle; Step S4, determining the positions and rotation angles of the remaining intermediate models according to the position of the first intermediate part model; Step S5, offsetting according to the left and right lane widths of the road. 2.The method for calculating the position of the road median strip in the intelligent traffic simulation according to claim 1, characterized in that: In step S4, the specific calculation method of the position of the second intermediate part model is as follows: Suppose the position of the second intermediate part model is Pos1, and the termination position of the first intermediate part model is a; the distance D (a, P1) between a and P1 is less than L, the next curve point P2 is taken, the distance between a and P2 is calculated, if D (a, P2) >= L, then the b point is obtained by interpolating P1 and P2 with a proportion t, ensuring that the distance between a and b is L, and the following formula is used for calculation: Wherein, D is the distance function between two points. 3.The method for calculating the position of the road median strip in the intelligent traffic simulation according to claim 2, characterized in that: After t is obtained, the b point is obtained by interpolation, and the position of Pos1 is the midpoint of a and b, so the position of the second model is Pos1, after the position of the second model is obtained, a certain angle is rotated.
4. The method for calculating the position of the road median strip in the intelligent traffic simulation according to claim 3, characterized in that: Its rotation is Y-axis rotation one unit, X-axis unit vector (1, 0, 0) steering vector angle.
5. The method of claim 1, wherein the method comprises: The specific calculation of the positions of the remaining intermediate models is as follows: When the whole set of curve points Spline is traversed to the end point, the distance D(c, P i ) between c and P i >=L / 2, the last model position is the midpoint of c and P i , and the model length is shortened to D(c, P i ); if D(c, P i )<L / 2, the position of c is changed to P i , the model length is extended, and P i is the end point of Spline.
6. The method of claim 1, wherein: In step S5, the specific steps of the offset are as follows: First, calculate the offset Offset = (total width of the left lane of the road - total width of the right lane of the road) / 2; then calculate the direction unit vector v of the offset; finally, the vector v is the direction offset of Offset units, which is the final position.
Citation Information
Patent Citations
Linear road element automatic modeling method and device
CN110135014A