maliput / maliput_malidrive

Open-source ready OpenDrive backend for Maliput
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Implement spiral ground curve #265

Closed agalbachicar closed 5 months ago

agalbachicar commented 8 months ago

Desired behavior

Implement spiral ground curve

Alternatives considered

N/A

Implementation suggestion

N/A

Additional context

260 is the parent ticket.

agalbachicar commented 8 months ago

For the record, I've been working on a python implementation to iterate faster on the math.

Results can be seen https://gist.github.com/agalbachicar/e8d6215a29153c6fbb948c0f476725b1

It is a normalized spiral, we need to work on the right normalization to match the initial and end curvature. The problem with this curve is the analytical form the ground curve takes (Fresnel integrals). We need to use an approximate form using polynomials. These polynomials are high degree polynomials, we get up to 9th and 11th power with only 3 terms of the series that's why normalization is mandatory and beyond values of 2-3 they become really hard to handle.

Another problem that arises is the inverse function (mathematically speaking). I'll work on it and give an update soon.

agalbachicar commented 8 months ago

Binary search seems to be a good enough algorithm, although it will require some computing time.