Tension issues in Spline roads

Issue #121 resolved
Agustin Alba Chicar created an issue

When modifying the tension parameter of the Spline, you can get different values of the curvature values. In some cases, in SimpleCity map, when going down from 0.6 we start getting problems with the CheckInvariants() method form Maliput. It throws errors in terms of the distance of the point.

Probably this issue is realated to: #119

Comments (7)

  1. Agustin Alba Chicar reporter

    After updating the ignition-math code to cfb40810aaac I got a better behavior on the road rendering, but again with values near 1.0. If I start decreasing the values, when passing the 0.6 value I start having issues with position invariants (the heading invariants are already set to 2.0 PI to avoid issues described in #119). The invariants errors maybe related to issue #119, that's because the resulting lanes are something like the following:

    A.png

    When it actually should be something like:

    B.png

    So, I move to small and atomic examples of RNDF to try to detect the problem or at least a more cuantitative relationship between the tension and the shape of the interpolation.

  2. Agustin Alba Chicar reporter

    After some debugging and chat with @hidmic we can state the following:

    • The tension parameter is a measure of how similar the final curve will be to a polyline.
    • Tension values are in between 0 and 1. It is used in calculation as 1 - tension.
    • (1 - tension) is multiplied to the derivative value at each control point. Derivatives at control points are calculated as the difference vector against the next control point scaled by 0.5.
    • A tension value of 1 means that the derivative at the control point will be null as 1-tension is applied. This means, we will use a polyline.
    • A tension value of 0 means that the derivative at the control point will be the full value described before. So in the range from zero to 1 we can scale the derivatives.

    The module of the tangent has a big importance when calculating the interpolating polynomial. So it's not the same to have a normalized tangent nor a module 10 tangent for example. We were using normalized tangents at the beginning and at the end, what headed to some order problems then. Besides that, we have removed the code of first and last point tangents as the formula calculation was automatically done when calling the Spline API.

    In addition we have added some test RNDF files, which show T and Y connections and one S road. All of these are correctly rendered with a tension value of 0.8. This value was set as a constant in code. We can say that near 0.6 is the limit where you start getting bad interpolations so using numbers less that ~0.65 it's not recommended.

    The code lives in this commit where the test files have been added and also the tension value was set.

  3. Agustin Alba Chicar reporter

    @andres_fortier I think that the exploration with this issue has been finished. Can I close this issue?

  4. Log in to comment