The basis module provides tools for representing continuous functions as
linear combinations of basis functions or as values at interpolation points.
It is useful for smooth function approximation, trajectory modeling, and
building factors that constrain functions (or their derivatives) at specific
points.
At a high level, you choose a basis (Fourier or Chebyshev), decide whether you want a coefficient-based representation or a pseudo-spectral one (values at Chebyshev points), and then use the provided factors or fitting utilities to solve for parameters in GTSAM.
Getting Oriented¶
Coefficient-based bases:
Chebyshev1Basis,Chebyshev2Basis, andFourierBasistreat the parameters as coefficients on basis functions.Pseudo-spectral basis:
Chebyshev2treats the parameters as values at Chebyshev points and uses barycentric interpolation.Factors: A family of unary factors enforce function values or derivatives at specific points, including vector- and manifold-valued variants.
Fitting:
FitBasisperforms least-squares regression from samples.
Core Concepts¶
Basis: CRTP base class providing evaluation and derivative functors, Jacobians, and common helpers.
Polynomial Bases¶
Chebyshev1Basis: First-kind Chebyshev basis on (coefficient-based).
Chebyshev2Basis: Second-kind Chebyshev basis on (coefficient-based).
FourierBasis: Real Fourier series basis for periodic functions.
Pseudo-Spectral Basis¶
Chebyshev2: Chebyshev points, barycentric interpolation, differentiation/integration matrices, and quadrature weights.
Factors for Basis Evaluation¶
These factors connect basis parameters to measurements of values or derivatives.
EvaluationFactor: Scalar value at a point.
VectorEvaluationFactor: Vector value at a point.
VectorComponentFactor: Single component of a vector value.
ManifoldEvaluationFactor: Manifold-valued measurement (e.g.,
Rot3,Pose3).
Factors for Derivative Constraints¶
DerivativeFactor: Scalar derivative at a point.
VectorDerivativeFactor: Vector derivative at a point.
ComponentDerivativeFactor: Single component of a vector derivative.
Fitting from Data¶
FitBasis: Build a least-squares problem from samples and solve for basis parameters.