smooth
A C++ library for Lie theory
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Spline< K, G > Class Template Reference

Single-parameter Lie group-valued function. More...

#include <spline.hpp>

Public Member Functions

 Spline (const G &ga=Identity< G >())
 Default constructor creates an empty Spline starting at a given point.
 
 Spline (double T, Eigen::Matrix< double, Dof< G >, K > &&V, G &&ga=Identity< G >())
 Create Spline with one segment and given velocity control points.
 
template<typename Derived >
 Spline (double T, const Eigen::MatrixBase< Derived > &V, const G &ga=Identity< G >())
 Create Spline with one segment and given velocity control points.
 
template<std::ranges::range Rv>
requires (std::is_same_v<std::ranges::range_value_t<Rv>, Tangent<G>>)
 Spline (double T, const Rv &vs, const G &ga=Identity< G >())
 Create Spline with one segment and given velocities.
 
 Spline (const Spline &)=default
 Copy constructor.
 
 Spline (Spline &&)=default
 Move constructor.
 
Splineoperator= (const Spline &)=default
 Copy assignment.
 
Splineoperator= (Spline &&)=default
 Move assignment.
 
 ~Spline ()=default
 Destructor.
 
std::size_t size () const
 Number of Spline segments.
 
bool empty () const
 True if Spline has zero size()
 
void reserve (std::size_t capacity)
 Allocate space for capacity segments.
 
double t_min () const
 Start time of Spline (always equal to zero).
 
double t_max () const
 End time of Spline.
 
start () const
 Spline start value (always equal to identity).
 
end () const
 Spline end value.
 
void make_local ()
 Move start of Spline to Identity()
 
Splineconcat_global (const Spline &other)
 In-place concatenation with a global Spline.
 
Splineconcat_local (const Spline &other)
 In-place local concatenation.
 
Splineoperator+= (const Spline &other)
 Operator overload for local concatenation.
 
Spline operator+ (const Spline &other)
 Local Spline concatenation.
 
template<typename S = double>
CastT< S, G > operator() (const S &t, OptTangent< CastT< S, G > > vel={}, OptTangent< CastT< S, G > > acc={}) const
 Evaluate Spline at given time.
 
Tangent< G > arclength (double t) const
 Get approximate arclength traversed at time T.
 
Spline crop (double ta, double tb=std::numeric_limits< double >::infinity(), bool localize=true) const
 Crop Spline.
 

Static Public Member Functions

static Spline ConstantVelocityGoal (const G &gb, double T=1, const G &ga=Identity< G >())
 Create constant-velocity Spline that reaches a given target state.
 
static Spline ConstantVelocity (const Tangent< G > &v, double T=1, const G &ga=Identity< G >())
 Create constant-velocity Spline.
 
static Spline FixedCubic (const G &gb, const Tangent< G > &va, const Tangent< G > &vb, double T=1, const G &ga=Identity< G >())
 Create Spline with given start and end position and velocities.
 

Detailed Description

template<int K, LieGroup G>
class Spline< K, G >

Single-parameter Lie group-valued function.

Template Parameters
KSpline degree
GLie group

A Spline is a continuous function \( x : [0, T] \rightarrow \mathbb{G} \). Internally it is a piecewise collection of cumulative polynomial segments.

Definition at line 27 of file spline.hpp.

Constructor & Destructor Documentation

◆ Spline() [1/4]

template<int K, LieGroup G>
Spline< K, G >::Spline ( const G &  ga = Identity< G >())

Default constructor creates an empty Spline starting at a given point.

Parameters
gaSpline starting point (defaults to identity)

◆ Spline() [2/4]

template<int K, LieGroup G>
Spline< K, G >::Spline ( double  T,
Eigen::Matrix< double, Dof< G >, K > &&  V,
G &&  ga = Identity< G >() 
)

Create Spline with one segment and given velocity control points.

Parameters
Tduration (strictly positive)
Vvelocities for segment
gaSpline starting point (defaults to identity)

◆ Spline() [3/4]

template<int K, LieGroup G>
template<typename Derived >
Spline< K, G >::Spline ( double  T,
const Eigen::MatrixBase< Derived > &  V,
const G &  ga = Identity< G >() 
)

Create Spline with one segment and given velocity control points.

Parameters
Tduration (strictly positive)
Vvelocities for segment
gaSpline starting point (defaults to identity)

◆ Spline() [4/4]

template<int K, LieGroup G>
template<std::ranges::range Rv>
requires (std::is_same_v<std::ranges::range_value_t<Rv>, Tangent<G>>)
Spline< K, G >::Spline ( double  T,
const Rv &  vs,
const G &  ga = Identity< G >() 
)

Create Spline with one segment and given velocities.

Parameters
Tduration (strictly positive)
vsvelocity constants (size K)
gaSpline starting point (defaults to identity)

Member Function Documentation

◆ arclength()

template<int K, LieGroup G>
Tangent< G > Spline< K, G >::arclength ( double  t) const

Get approximate arclength traversed at time T.

The arclength is defined as

\[ A(t) = \int_{0}^t \left| \mathrm{d}^r x_s \right| \mathrm{d} s, \]

where the absolute value is component-wise.

Note
This function is approximate for Lie groups with curvature.

◆ concat_global()

template<int K, LieGroup G>
Spline & Spline< K, G >::concat_global ( const Spline< K, G > &  other)

In-place concatenation with a global Spline.

Parameters
otherSpline to append at the end of this Spline.

The resulting Spline \( y(t) \) is s.t.

\[ y(t) = \begin{cases} x_1(t) & 0 \leq t < t_1 \\ x_2(t) & t_1 \leq t \leq t_1 + t_2 \end{cases} \]

◆ concat_local()

template<int K, LieGroup G>
Spline & Spline< K, G >::concat_local ( const Spline< K, G > &  other)

In-place local concatenation.

Parameters
otherSpline to append at the end of this Spline.

The resulting Spline \( y(t) \) is s.t.

\[ y(t) = \begin{cases} x_1(t) & 0 \leq t < t_1 \\ x_1(t_1) \circ x_2(t) & t_1 \leq t \leq t_1 + t_2 \end{cases} \]

That is, other is considered a Spline in the local frame of end(). For global concatenation see concat_global.

◆ ConstantVelocity()

template<int K, LieGroup G>
static Spline Spline< K, G >::ConstantVelocity ( const Tangent< G > &  v,
double  T = 1,
const G &  ga = Identity< G >() 
)
static

Create constant-velocity Spline.

The resulting Spline is

\[ x(t) = g_a \exp(t v), \quad t \in [0, T]. \]

Parameters
vbody velocity
Tduration
gaSpline starting point

◆ ConstantVelocityGoal()

template<int K, LieGroup G>
static Spline Spline< K, G >::ConstantVelocityGoal ( const G &  gb,
double  T = 1,
const G &  ga = Identity< G >() 
)
static

Create constant-velocity Spline that reaches a given target state.

The resulting Spline is

\[ x(t) = g_a \circ \exp\left( \frac{t}{T} (g_b \ominus g_a) \right), \quad t \in [0, T]. \]

Parameters
gbSpline target point
Tduration (must be positive)
gaSpline starting point (defaults to Identity)

◆ crop()

template<int K, LieGroup G>
Spline Spline< K, G >::crop ( double  ta,
double  tb = std::numeric_limits< double >::infinity(),
bool  localize = true 
) const

Crop Spline.

Parameters
ta,tbinterval for cropped Spline
localizecropped Spline start at identity

The resulting Spline \( y(t) \) defined on \( [0, t_b - t_a] \) is s.t.

  • If localize = true:

    \[ y(t) = x(t_a)^{-1} \circ x(t - t_a) \]

  • If localize = false:

    \[ y(t) = x(t - t_a) \]

◆ FixedCubic()

template<int K, LieGroup G>
static Spline Spline< K, G >::FixedCubic ( const G &  gb,
const Tangent< G > &  va,
const Tangent< G > &  vb,
double  T = 1,
const G &  ga = Identity< G >() 
)
static

Create Spline with given start and end position and velocities.

Parameters
gbSpline target point
va,vbstart and end velocities
Tduration
gaSpline starting point (default Identity)

◆ operator()()

template<int K, LieGroup G>
template<typename S = double>
CastT< S, G > Spline< K, G >::operator() ( const S &  t,
OptTangent< CastT< S, G > >  vel = {},
OptTangent< CastT< S, G > >  acc = {} 
) const

Evaluate Spline at given time.

Template Parameters
Stime type
Parameters
[in]ttime
[out]veloutput body velocity at evaluation time
[out]accoutput body acceleration at evaluation time
Returns
value at time t
Note
Outside the support [t_min(), t_max()] the result is clamped to the end points, and the acceleration and velocity is zero.

◆ operator+()

template<int K, LieGroup G>
Spline Spline< K, G >::operator+ ( const Spline< K, G > &  other)

Local Spline concatenation.

See also
concat_local()

◆ operator+=()

template<int K, LieGroup G>
Spline & Spline< K, G >::operator+= ( const Spline< K, G > &  other)

Operator overload for local concatenation.

Parameters
otherSpline to append at the end of this Spline.
See also
concat_local()

The documentation for this class was generated from the following file: