Changes to ignition math splines

Issue #113 resolved
Andrés Fortier created an issue

Create issue and potentially send PR to ignition math repo for changes on the spline API / implementation.

Comments (10)

  1. Andrés Fortier reporter

    Status:

    • Allow to force the derivative on the control points instead of it being computed automatically. This is required so that we can create a connection between two lanes while keeping the heading of the start and end point aligned to their respective lanes.
    • Support to evaluate the nth-derivative (up to the third, given the polynomial degree) of the spline in any arbitrary point. (PR).
    • Allow to parametrize the spline based on arc length instead of t [0,1]. We are still looking into this as it seems it will require a non-trivial implementation.

    1) and 2) currently in a PR. Need to change based on OSRF comments.

    3) in progress. Will start by doing a simple interpolation and later revisit to do a better approximation.

  2. Michel Hidalgo

    Regarding the third bullet. Let Q(t) be our curve parameterization (that is, an instance of ignition::Math::Spline); the task is to find t(s) so as to allow us to compute Q(t(s)), the arc-length parameterized curve. Our first attempt was to use another cubic interpolator to approximate t(s), but this proved to be useless, as it adds way too much error when applied to non-trivial curves.

    After some discussion with @agalbachicar, we're going to go with a "best-effort" approach. We'll build a table for s(t) (that is, the arc length integral function), with fixed t, and upon t(s) interpolation, index that table, find the interval where t lies for a given s and finally linearly interpolate on that interval to get t. This can be done in O(n) (because of the table lookup). It's hard to estimate what errors this will introduce, so we'll have to try.

    @andres_fortier do you want this approach to be included in the standing PR?

  3. Andrés Fortier reporter

    I would first address the comments on the PR and push for a second review. If before the PR is merged you finish the step 3 then add it, otherwise open a new PR. Does that sound ok to you?

  4. Michel Hidalgo

    PR merged, though it seems they've found out that it fails to build on Windows after merging it, see here. I'll follow-up, maybe I can ease the fixing process.

  5. Log in to comment