hpp-core: hpp::core::path::Spline< _PolynomeBasis, _Order > Class Template Reference

hpp-core 9.0.2 Implement basic classes for canonical path planning for kinematic chains.

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
hpp::core::path::Spline< _PolynomeBasis, _Order > Class Template Reference
Path

`#include <hpp/core/path/spline.hh>`

Inheritance diagram for hpp::core::path::Spline< _PolynomeBasis, _Order >:
[legend]
Collaboration diagram for hpp::core::path::Spline< _PolynomeBasis, _Order >:
[legend]

## Public Types
enum | { PolynomeBasis = _PolynomeBasis , Order = _Order , NbCoeffs = _Order + 1 , NbPowerOfT = 2 * NbCoeffs + 1 }
typedef internal::sbf_traits< PolynomeBasis, Order > | sbf_traits
typedef internal::spline_basis_function< PolynomeBasis, Order > | BasisFunction_t
typedef Eigen::Matrix< value_type, NbPowerOfT, 1 > | PowersOfT_t
typedef sbf_traits::Coeffs_t | BasisFunctionVector_t
typedef sbf_traits::IntegralCoeffs_t | BasisFunctionIntegralMatrix_t
typedef Eigen::Matrix< value_type, NbCoeffs, Eigen::Dynamic, Eigen::RowMajor > | ParameterMatrix_t
typedef Eigen::Map< const vector_t, Eigen::Aligned > | ConstParameterVector_t
typedef Eigen::Map< vector_t, Eigen::Aligned > | ParameterVector_t
typedef shared_ptr< Spline > | Ptr_t
typedef weak_ptr< Spline > | WkPtr_t

## Public Member Functions
size_type | parameterSize () const
void | parameterDerivativeCoefficients (vectorOut_t res, const value_type &t) const
void | parameterIntegrate (vectorIn_t dParam)
| Adds dParam to the parameters.
value_type | squaredNormIntegral (const size_type order) const
void | squaredNormIntegralDerivative (const size_type order, vectorOut_t res) const
void | basisFunctionDerivative (const size_type order, const value_type &u, BasisFunctionVector_t &res) const
void | basisFunctionDerivative (const size_type order, const value_type &u, vectorOut_t res) const
void | maxVelocity (vectorOut_t res) const
void | squaredNormBasisFunctionIntegral (const size_type order, BasisFunctionIntegralMatrix_t &res) const
void | squaredNormBasisFunctionIntegral (const size_type order, matrixOut_t res) const
virtual Configuration_t | initial () const
| Get the initial configuration.
virtual Configuration_t | end () const
| Get the final configuration.
const Configuration_t & | base () const
void | base (const Configuration_t &q)
const ParameterMatrix_t & | parameters () const
| Each row corresponds to a velocity of the robot.
void | parameters (const ParameterMatrix_t &m)
ConstParameterVector_t | rowParameters () const
| Concatenate the parameters as one vector (P_0^T, ..., P_n^T).
void | rowParameters (vectorIn_t p)
| Set the parameters.
PathPtr_t | copy () const
| Return a shared pointer to a copy of this.
PathPtr_t | copy (const ConstraintSetPtr_t &constraints) const
virtual | ~Spline ()
Public Member Functions inherited from hpp::core::Path
virtual | ~Path ()
| Destructor.
template<class T >
shared_ptr< T > | as (void)
| Static cast into a derived type.
template<class T >
shared_ptr< const T > | as (void) const
| Static cast into a derived type.
PathPtr_t | extract (const interval_t &subInterval) const
PathPtr_t | extract (const value_type &tmin, const value_type &tmax) const
virtual PathPtr_t | reverse () const
Configuration_t | eval (const value_type &time, bool &success) const
| Configuration at time.
bool | eval (ConfigurationOut_t result, const value_type &time) const
| Configuration at time.
bool | at (const value_type &time, ConfigurationOut_t result) const
| Get the configuration at a parameter without applying the constraints.
void | derivative (vectorOut_t result, const value_type &time, size_type order) const
void | velocityBound (vectorOut_t result, const value_type &t0, const value_type &t1) const
size_type | outputSize () const
| Get size of configuration space.
size_type | outputDerivativeSize () const
| Get size of velocity.
const interval_t & | timeRange () const
| Get interval of definition.
virtual value_type | length () const
| Get length of definition interval.
const ConstraintSetPtr_t & | constraints () const
| Get constraints the path is subject to.
const interval_t & | paramRange () const
const TimeParameterizationPtr_t & | timeParameterization () const
| Get the time parameterization function.
void | timeParameterization (const TimeParameterizationPtr_t &tp, const interval_t &tr)
| Set the time parameterization function.

## Static Public Member Functions
static void | timeFreeBasisFunctionDerivative (const size_type order, const value_type &u, BasisFunctionVector_t &res)
static void | timeFreeBasisFunctionDerivative (const size_type order, const value_type &u, vectorOut_t res)
static Ptr_t | create (const DevicePtr_t &robot, const interval_t &interval, const ConstraintSetPtr_t &constraints, bool se3Output=false)
static void | value (pinocchio::LiegroupElementConstRef base, Eigen::Ref< const ParameterMatrix_t > params, const value_type &u, ConfigurationOut_t config, vectorOut_t velocity)

## Protected Member Functions
| Spline (const DevicePtr_t &robot, const interval_t &interval, const ConstraintSetPtr_t &constraints, bool se3Output=false)
| Spline (const Spline &path)
| Spline (const Spline &path, const ConstraintSetPtr_t &constraints)
void | init (const Ptr_t &self)
std::ostream & | print (std::ostream &os) const
bool | impl_compute (ConfigurationOut_t configuration, value_type t) const
| Function evaluation without applying constraints.
void | impl_derivative (vectorOut_t res, const value_type &t, size_type order) const
void | impl_paramDerivative (vectorOut_t res, const value_type &t) const
void | impl_paramIntegrate (vectorIn_t dParam)
void | impl_velocityBound (vectorOut_t result, const value_type &t0, const value_type &t1) const
Protected Member Functions inherited from hpp::core::Path
| Path (const interval_t &interval, size_type outputSize, size_type outputDerivativeSize, const ConstraintSetPtr_t &constraints)
| Path (const interval_t &interval, size_type outputSize, size_type outputDerivativeSize)
| Path (const Path &path)
| Copy constructor.
| Path (const Path &path, const ConstraintSetPtr_t &constraints)
| Copy constructor with constraints.
void | init (const PathWkPtr_t &self)
void | constraints (const ConstraintSetPtr_t &constraint)
virtual void | checkPath () const
| Should be called by child classes after having init.
void | timeRange (const interval_t &timeRange)
value_type | paramLength () const
Configuration_t | configAtParam (const value_type &param, bool &success) const
virtual PathPtr_t | impl_extract (const interval_t &paramInterval) const
| Virtual implementation of extract.
| Path ()

## Protected Attributes
size_type | parameterSize_
| Robot number of degrees of freedom.
DevicePtr_t | robot_
LiegroupElement | base_
ParameterMatrix_t | parameters_
Protected Attributes inherited from hpp::core::Path
interval_t | paramRange_
| Interval of parameters.

## Detailed Description

template<int _PolynomeBasis, int _Order>
class hpp::core::path::Spline< _PolynomeBasis, _Order >

Base class for spline paths

Splines are polynomials with various possible representations.

Parameters

  _PolynomeBasis | basis of polynomials used among CanonicalPolynomeBasis for the canonical basis, BernsteinBasis for Bernstein basis
  _Order | degree of the polynomial representation.

See also
  hpp::core::path::PolynomeBasisType.

Splines represent a curve in the tangent space of a given robot (hpp::core::Device) at a configuration called base.

\begin{eqnarray*} spline (u) &=& base + PM^{T} B (u) \end{eqnarray*}

where*

- \(u\in [0,1]\),
- operator "+" should be understood as Lie group integration,
- \(PM\) is the matrix of parameters the rows of which are the spline control points. This matrix is accessible via setter and getter Spline::parameters,
- \(B (t)\) is the vector containing the values of the basis functions at parameter \(t\).

The dimension of control points, corresponding to the robot number of degrees of freedom can be retrieved by getter Spline::parameterSize.

Warning
  Velocities for robots with non-vector configuration space are not correctly handled.

## Member Typedef Documentation

## ◆ BasisFunction_t

template<int _PolynomeBasis, int _Order>

typedef internal::spline_basis_function<PolynomeBasis, Order> hpp::core::path::Spline< _PolynomeBasis, _Order >::BasisFunction_t

## ◆ BasisFunctionIntegralMatrix_t

template<int _PolynomeBasis, int _Order>

typedef sbf_traits::IntegralCoeffs_t hpp::core::path::Spline< _PolynomeBasis, _Order >::BasisFunctionIntegralMatrix_t

## ◆ BasisFunctionVector_t

template<int _PolynomeBasis, int _Order>

typedef sbf_traits::Coeffs_t hpp::core::path::Spline< _PolynomeBasis, _Order >::BasisFunctionVector_t

## ◆ ConstParameterVector_t

template<int _PolynomeBasis, int _Order>

typedef Eigen::Map<const vector_t, Eigen::Aligned> hpp::core::path::Spline< _PolynomeBasis, _Order >::ConstParameterVector_t

## ◆ ParameterMatrix_t

template<int _PolynomeBasis, int _Order>

typedef Eigen::Matrix<value_type, NbCoeffs, Eigen::Dynamic, Eigen::RowMajor> hpp::core::path::Spline< _PolynomeBasis, _Order >::ParameterMatrix_t

## ◆ ParameterVector_t

template<int _PolynomeBasis, int _Order>

typedef Eigen::Map<vector_t, Eigen::Aligned> hpp::core::path::Spline< _PolynomeBasis, _Order >::ParameterVector_t

## ◆ PowersOfT_t

template<int _PolynomeBasis, int _Order>

typedef Eigen::Matrix<value_type, NbPowerOfT, 1> hpp::core::path::Spline< _PolynomeBasis, _Order >::PowersOfT_t

## ◆ Ptr_t

template<int _PolynomeBasis, int _Order>

typedef shared_ptr<Spline> hpp::core::path::Spline< _PolynomeBasis, _Order >::Ptr_t

## ◆ sbf_traits

template<int _PolynomeBasis, int _Order>

typedef internal::sbf_traits<PolynomeBasis, Order> hpp::core::path::Spline< _PolynomeBasis, _Order >::sbf_traits

## ◆ WkPtr_t

template<int _PolynomeBasis, int _Order>

typedef weak_ptr<Spline> hpp::core::path::Spline< _PolynomeBasis, _Order >::WkPtr_t

## Member Enumeration Documentation

## ◆ anonymous enum

template<int _PolynomeBasis, int _Order>

anonymous enum

Enumerator
PolynomeBasis |
Order |
NbCoeffs |
NbPowerOfT |

## Constructor & Destructor Documentation

## ◆ ~Spline()

template<int _PolynomeBasis, int _Order>

virtual hpp::core::path::Spline< _PolynomeBasis, _Order >::~Spline | ( |  | ) |
| inlinevirtual

## ◆ Spline() [1/3]

template<int _PolynomeBasis, int _Order>

hpp::core::path::Spline< _PolynomeBasis, _Order >::Spline | ( | const DevicePtr_t & | robot,
|  | const interval_t & | interval,
|  | const ConstraintSetPtr_t & | constraints,
|  | bool | se3Output = `false`
| ) |  |
| inlineprotected

Constructor.

Parameters

  robot | robot for which the path comupted (defines the configuration space),
  interval | interval of definition of the path,
  constraints | constraints the path is subject to,
  se3Output | if true interpolation of freeflyer joints take place in \(SE(3)\), otherwise interpolation takes place in \(\mathbf{R}^3\times SO(3)\).

## ◆ Spline() [2/3]

template<int _PolynomeBasis, int _Order>

hpp::core::path::Spline< _PolynomeBasis, _Order >::Spline | ( | const Spline< _PolynomeBasis, _Order > & | path | ) |
| protected

## ◆ Spline() [3/3]

template<int _PolynomeBasis, int _Order>

hpp::core::path::Spline< _PolynomeBasis, _Order >::Spline | ( | const Spline< _PolynomeBasis, _Order > & | path,
|  | const ConstraintSetPtr_t & | constraints
| ) |  |
| protected

## Member Function Documentation

## ◆ base() [1/2]

template<int _PolynomeBasis, int _Order>

const Configuration_t & hpp::core::path::Spline< _PolynomeBasis, _Order >::base | ( |  | ) | const
| inline

Get the base configuration. The parameters are velocities to be integrated from this configuration.

## ◆ base() [2/2]

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::base | ( | const Configuration_t & | q | ) |
| inline

See also
  base() const

## ◆ basisFunctionDerivative() [1/2]

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::basisFunctionDerivative | ( | const size_type | order,
|  | const value_type & | u,
|  | BasisFunctionVector_t & | res
| ) |  | const

Returns a vector \( (v_i) \) as

\[ v_i = T^{-k} b_i^{(k)}(u) \]

## ◆ basisFunctionDerivative() [2/2]

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::basisFunctionDerivative | ( | const size_type | order,
|  | const value_type & | u,
|  | vectorOut_t | res
| ) |  | const
| inline

## ◆ copy() [1/2]

template<int _PolynomeBasis, int _Order>

PathPtr_t hpp::core::path::Spline< _PolynomeBasis, _Order >::copy | ( |  | ) | const
| inlinevirtual

Return a shared pointer to a copy of this.

Implements hpp::core::Path.

## ◆ copy() [2/2]

template<int _PolynomeBasis, int _Order>

PathPtr_t hpp::core::path::Spline< _PolynomeBasis, _Order >::copy | ( | const ConstraintSetPtr_t & | constraints | ) | const
| inlinevirtual

Return a shared pointer to a copy of this and set constraints

Parameters

  constraints | constraints to apply to the copy

Precondition
  *this should not have constraints.

Implements hpp::core::Path.

## ◆ create()

template<int _PolynomeBasis, int _Order>

static Ptr_t hpp::core::path::Spline< _PolynomeBasis, _Order >::create | ( | const DevicePtr_t & | robot,
|  | const interval_t & | interval,
|  | const ConstraintSetPtr_t & | constraints,
|  | bool | se3Output = `false`
| ) |  |
| inlinestatic

Create instance a return a shared pointer

Parameters

  robot | robot for which the path comupted (defines the configuration space),
  interval | interval of definition of the path,
  constraints | constraints the path is subject to,
  se3Output | if true interpolation of freeflyer joints take place in \(SE(3)\), otherwise interpolation takes place in \(\mathbf{R}^3\times SO(3)\).

## ◆ end()

template<int _PolynomeBasis, int _Order>

virtual Configuration_t hpp::core::path::Spline< _PolynomeBasis, _Order >::end | ( |  | ) | const
| inlinevirtual

Get the final configuration.

Implements hpp::core::Path.

Reimplemented in hpp::core::path::Hermite.

## ◆ impl_compute()

template<int _PolynomeBasis, int _Order>

bool hpp::core::path::Spline< _PolynomeBasis, _Order >::impl_compute | ( | ConfigurationOut_t | configuration,
|  | value_type | param
| ) |  | const
| protectedvirtual

Function evaluation without applying constraints.

Returns
  true if everything went good.

Implements hpp::core::Path.

## ◆ impl_derivative()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::impl_derivative | ( | vectorOut_t | res,
|  | const value_type & | t,
|  | size_type | order
| ) |  | const
| protectedvirtual

Compute the derivative of required order of the spline

Warning
  If the output space of the spline is not a vector space, derivatives of order greater than 1 on the non-vertor space parts are wrong.

Reimplemented from hpp::core::Path.

## ◆ impl_paramDerivative()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::impl_paramDerivative | ( | vectorOut_t | res,
|  | const value_type & | t
| ) |  | const
| protected

## ◆ impl_paramIntegrate()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::impl_paramIntegrate | ( | vectorIn_t | dParam | ) |
| protected

## ◆ impl_velocityBound()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::impl_velocityBound | ( | vectorOut_t | bound,
|  | const value_type & | param0,
|  | const value_type & | param1
| ) |  | const
| protectedvirtual

Virtual implementation of velocityBound

Parameters

  param0,param1 | interval of parameter

Return values

  bound |

Reimplemented from hpp::core::Path.

## ◆ init()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::init | ( | const Ptr_t & | self | ) |
| inlineprotected

## ◆ initial()

template<int _PolynomeBasis, int _Order>

virtual Configuration_t hpp::core::path::Spline< _PolynomeBasis, _Order >::initial | ( |  | ) | const
| inlinevirtual

Get the initial configuration.

Implements hpp::core::Path.

Reimplemented in hpp::core::path::Hermite.

## ◆ maxVelocity()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::maxVelocity | ( | vectorOut_t | res | ) | const

Returns an upper bound of the velocity on the complete interval.

See also
  Path::velocityBound

## ◆ parameterDerivativeCoefficients()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::parameterDerivativeCoefficients | ( | vectorOut_t | res,
|  | const value_type & | t
| ) |  | const
| inline

The partial derivative with respects to the parameters is of the form

\begin{eqnarray*} \frac{\partial S}{\partial p_{k}} (q, p, t) &=& B_k(t) \times I \\ \frac{\partial S}{\partial q_{base}} (q, p, t) &=& I \end{eqnarray*}

This method returns the coefficients \( (B_k(t))_{k} \)

## ◆ parameterIntegrate()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::parameterIntegrate | ( | vectorIn_t | dParam | ) |
| inline

Adds dParam to the parameters.

## ◆ parameters() [1/2]

template<int _PolynomeBasis, int _Order>

const ParameterMatrix_t & hpp::core::path::Spline< _PolynomeBasis, _Order >::parameters | ( |  | ) | const
| inline

Each row corresponds to a velocity of the robot.

## ◆ parameters() [2/2]

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::parameters | ( | const ParameterMatrix_t & | m | ) |
| inline

Returns the \( (P_i^T) \). Each row contains one parameter.

## ◆ parameterSize()

template<int _PolynomeBasis, int _Order>

size_type hpp::core::path::Spline< _PolynomeBasis, _Order >::parameterSize | ( |  | ) | const
| inline

## ◆ print()

template<int _PolynomeBasis, int _Order>

std::ostream & hpp::core::path::Spline< _PolynomeBasis, _Order >::print | ( | std::ostream & | os | ) | const
| protectedvirtual

Print interval of definition (and of parameters if relevant) in a stream

Reimplemented from hpp::core::Path.

## ◆ rowParameters() [1/2]

template<int _PolynomeBasis, int _Order>

ConstParameterVector_t hpp::core::path::Spline< _PolynomeBasis, _Order >::rowParameters | ( |  | ) | const
| inline

Concatenate the parameters as one vector (P_0^T, ..., P_n^T).

## ◆ rowParameters() [2/2]

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::rowParameters | ( | vectorIn_t | p | ) |
| inline

Set the parameters.

## ◆ squaredNormBasisFunctionIntegral() [1/2]

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::squaredNormBasisFunctionIntegral | ( | const size_type | order,
|  | BasisFunctionIntegralMatrix_t & | res
| ) |  | const

Returns a matrix \( (m_{i,j}) \) as

\[ m_{i,j} = T^{1-2k} \int_0^1 b_i^{(k)}(u) b_j^{(k)}(u) du \]

## ◆ squaredNormBasisFunctionIntegral() [2/2]

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::squaredNormBasisFunctionIntegral | ( | const size_type | order,
|  | matrixOut_t | res
| ) |  | const
| inline

## ◆ squaredNormIntegral()

template<int _PolynomeBasis, int _Order>

value_type hpp::core::path::Spline< _PolynomeBasis, _Order >::squaredNormIntegral | ( | const size_type | order | ) | const

Returns \( \int S^{(k)}(t)^T \times S^{(k)}(t) dt \)

where k is the argument

## ◆ squaredNormIntegralDerivative()

template<int _PolynomeBasis, int _Order>

void hpp::core::path::Spline< _PolynomeBasis, _Order >::squaredNormIntegralDerivative | ( | const size_type | order,
|  | vectorOut_t | res
| ) |  | const

Returns the derivative of squaredNormIntegral wrt the parameters.

\[ res(j) \gets 2 \sum_i P_i^T \times m_{i,j} \]

## ◆ timeFreeBasisFunctionDerivative() [1/2]

template<int _PolynomeBasis, int _Order>

static void hpp::core::path::Spline< _PolynomeBasis, _Order >::timeFreeBasisFunctionDerivative | ( | const size_type | order,
|  | const value_type & | u,
|  | BasisFunctionVector_t & | res
| ) |  |
| static

Returns a vector \( (v_i) \) as

\[ v_i = b_i^{(k)}(u) \]

## ◆ timeFreeBasisFunctionDerivative() [2/2]

template<int _PolynomeBasis, int _Order>

static void hpp::core::path::Spline< _PolynomeBasis, _Order >::timeFreeBasisFunctionDerivative | ( | const size_type | order,
|  | const value_type & | u,
|  | vectorOut_t | res
| ) |  |
| inlinestatic

## ◆ value()

template<int _PolynomeBasis, int _Order>

static void hpp::core::path::Spline< _PolynomeBasis, _Order >::value | ( | pinocchio::LiegroupElementConstRef | base,
|  | Eigen::Ref< const ParameterMatrix_t > | params,
|  | const value_type & | u,
|  | ConfigurationOut_t | config,
|  | vectorOut_t | velocity
| ) |  |
| static

Evaluate a spline.

Parameters

  base | the base configuration.
  params | concatenation of row vectors representing the velocity interpolation points.
  u | the ratio, between 0 and 1.

Return values

  config | the output configuration
  velocity | the interpolated velocity

## Member Data Documentation

## ◆ base_

template<int _PolynomeBasis, int _Order>

LiegroupElement hpp::core::path::Spline< _PolynomeBasis, _Order >::base_
| protected

Base of the spline path. The spline is a curve in the tangent space of the robot at this configuration.

## ◆ parameters_

template<int _PolynomeBasis, int _Order>

ParameterMatrix_t hpp::core::path::Spline< _PolynomeBasis, _Order >::parameters_
| protected

Parameters of the spline are stored in a matrix number of rows = degree of polynomial + 1 number of columns = robot number of degrees of freedom.

## ◆ parameterSize_

template<int _PolynomeBasis, int _Order>

size_type hpp::core::path::Spline< _PolynomeBasis, _Order >::parameterSize_
| protected

Robot number of degrees of freedom.

## ◆ robot_

template<int _PolynomeBasis, int _Order>

DevicePtr_t hpp::core::path::Spline< _PolynomeBasis, _Order >::robot_
| protected

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

- include/hpp/core/fwd.hh
- include/hpp/core/path/spline.hh