Parameterized function for clothoids

I am a road network coding tool that is based on RoadXML .

Road curves from this format have four types:

  • segment,
  • circle,
  • poly line
  • fabric arc.

And I have a problem with the latter.

Clothoid is the same as the Euler spiral and Cornu back. In RoadXML, the arco texture is specified by three parameters:

  • beginning of curvature
  • finite curvature
  • length.

To triangulate the arc, I need a function like foo (t) that returns (x, y) coordinates at t = 0..length. I created similar methods for a circular arc without any problems, but I cannot do this for arco texture.

Part of the problem is that I don’t quite understand how to apply the parameters of initial and final curvature in standard clothoid formulas.

For example, an example of the RoadXML road. RoadXML example http://img560.imageshack.us/img560/8172/bigroandabout.png

This is a curve texture element in a red ellipse. Options:

  • beginning of curvature = 0,
  • end curvature = -0.0165407,
  • length = 45.185.

I do not know how to implement these parameters, because the curvature of the clonoids from 0 to -0.0165 is very direct.

I will be happy if you give me the code for this function (in C ++, C #, Java, Python or pseudo-code) or just a formula that I can encode.

Here are my equations:

x(t) β‰ˆ t, y(t) β‰ˆ (t^3) / 6, where length = t = s = curvature. x(-0.0165) = -0.0165, y(-0.0165) = -7.48688E-07. Clotho length = 0.0165, Source length = 45.185. 

Scalable Combinations:

 x'(l) = x / clotho_length * source_length = 45.185, y'(l) = y / clotho_length * source_length = 5.58149E-07 β‰ˆ 0. x'(0) = 0, y'(0) = 0. 

So I get (0, 0) ... (45, 0) points that are very straight.

Where is my mistake? What am I doing wrong?

+4
source share
2 answers

We will see. Your data:

 start curvature = 0, straight line, R=INF end curvature = -0.0165407, circular arc, R_c = 1/k_c = 60.4569335 length = 45.185. distance along clothoid, s_c = 45.185 

According to the Wikipedia article ,

 R s = const = R_c s_c ( s ~ k = 1/R by definition of clothoid ) d(s) = R d(theta) d(theta) = kd(s) d(theta) / d(s) = 1 / R = k = s / R_c s_c theta = s^2 / 2 R_c s_c = (s/a)^2 = s / 2 R = ks / 2 where ___________________ a = sqrt(2 R_c s_c) (... = 73.915445 ) ~~~~~~~~~~~~~~~~~~~ and so theta_c = k_c s_c / 2 (... = 0.37369576475 = 21.411190 degrees ) ( not so flat after all !! ) 

(note: I call a here the reciprocity of a WP article invoking a ). Then,

 d(x) = d(s) cos(theta) d(y) = d(s) sin(theta) x = INT[s=0..s] cos(theta) d(s) = INT[s=0..s] cos((s/a)^2) ad(s/a) = a INT[u=0..(s/a)] cos(u^2) d(u) = a C( s/a ) y = a INT[u=0..(s/a)] sin(u^2) d(u) = a S( s/a ) 

where C(t) and S(t) Fresnel integrals .

So, how do you scale . Not only t = s , but t = s/a = sqrt(theta) . Here, for the endpoint, t_c = sqrt( k_c s_c / 2) = sqrt( 0.0165407 * 45.185 / 2) = 0.6113066 .

Now WolframAlpha says , {73.915445 Sqrt[pi/2] FresnelC[0.6113066/Sqrt[pi/2]], 73.915445 Sqrt[pi/2] FresnelS[0.6113066/Sqrt[pi/2]]} = {44.5581, 5.57259} . (Mathematica seems to be using the definition with an additional coefficient of Sqrt[pi/2] .)

Testing it with your functions x ~= t --> a*(s/a) = 45.185 , y ~= t^3/3 --> a*(s/a)^3/3 = 73.915445 * 0.6113066^3 / 3 = 45.185 ~= t^3/3 --> a*(s/a)^3/3 = 73.915445 * 0.6113066^3 / 3 = 5.628481 (sic! /3 not /6 , there is an error there).

So, you see that using only the first term from the Taylor series, the representation of Fresnel integrals is not enough - certainly. You should use more and stop only when the desired accuracy is achieved (i.e. when the last calculated term is less than your specified accuracy value in magnitude).

Please note that if you simply implement the general Fresnel integral functions for a single scaled calculation of clothoids, you will lose additional accuracy when you multiply the results by a (which is on the order of 10 2 ... 10 3 usually for roads and railways).

+2
source

See the article by Clothoid, Ryan Seng, and Molly Severdia . As a rule, clothoids are determined by Fresnel integrals. It turns out that the clothoid C(t) has a length arclength t . Thus, immediately from the point of view of the formula, the formula for the general curve is expressed in terms of the length of the arc. A concrete curve is just a subdivision of a common spiral, from the initial curvature to the curvature. You will need to make a turn and translation for the general case.

+2
source

Source: https://habr.com/ru/post/1436287/


All Articles