Skip to content

Spline module (BSplineSE3, InterpSplineSE3, SplineFit): documentation and test gaps #288

Open

Description

@petercorke

The spline classes are exported from spatialmath but are poorly documented and thinly tested.

Documentation

  • Add the classes to the Sphinx API docs (docs/source does not mention them)
  • Docstrings for SplineSE3, SplineFit and its error methods, and derivative
  • stochastic_downsample_interpolation: units of the epsilons, check_type, bc_type, normalize_time, that results are random and unseeded, and that local checks are not a global error bound
  • visualize: document all parameters
  • BSplineSE3: it is a non-rational B-spline (not NURBS), and it approximates the control poses rather than interpolating them
  • Convert the module's Google-style Args: docstrings to reST

Tests

  • TestSplineFit uses timestamps in [0, 1], so normalize_time is a no-op and mismatches between raw and normalized time cannot show up
  • Assert the Euclidean error as well as the angular error
  • The visualize tests are skipped in CI

To check

  • SplineFit error methods crash if called before a fit (self.spline is None)
  • InterpSplineSE3.derivative builds a Twist3 from the translation rate and the angular rate; is that the intended twist convention, and in which frame?

Related: the time-guard bug filed as #287.

Activity

  1. added
    documentation
    tech-debt
    on Nov 6, 2026
  2. guptuv commented on Dec 2, 2026

    @guptuv

    Hi @petercorke, I'd like to work on #288, starting with the InterpSplineSE3.derivative question.

    I compared derivative(t) against central finite differences of the spline's own pose (Ṫ T⁻¹ and T⁻¹ Ṫ) on a trajectory whose rotation axis changes over time. .v equals ṗ in the world frame, but .w equals the body-frame angular velocity, because RotationSpline(t, 1) returns body rates. So the result is neither a spatial twist, a body twist, nor (ṗ, ω₀). Example at t = 1.73: ω_world = [-0.491, 0.093, 0.800], returned w = [-0.609, 0.500, 0.519].

    Separately, with normalize_time=True the rates are per unit normalised time (10× for a 10 s span), which isn't documented.

    Which output would you prefer?

    • (a) a SpatialVelocity with (ṗ, ω) both in the world frame,
    • (b) a body-frame velocity, or
    • (c) keep Twist3 with an explicit frame= argument.

    And should the rates be per second when normalize_time=True?or anything else you had in mind while posting this question do tell me?

    Once that's settled, I'll open a PR with finite-difference regression tests, the SplineFit before-fit guard and the missing Euclidean-error assert, and then send the docs work as a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationtech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions