hpp-core: hpp::core::Path Class Reference

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

Loading...
Searching...
No Matches
Protected Member Functions | Protected Attributes | List of all members
hpp::core::Path Class Referenceabstract
Path

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

Inheritance diagram for hpp::core::Path:
[legend]

## Public Member Functions
Construction, destruction, copy
virtual | ~Path ()
| Destructor.
virtual PathPtr_t | copy () const =0
| Return a shared pointer to a copy of this.
virtual PathPtr_t | copy (const ConstraintSetPtr_t &constraints) const =0
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.
Extraction/Reversion of a sub-path
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
Evalutation of the path
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
Path definition
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.
virtual Configuration_t | initial () const =0
| Get the initial configuration.
virtual Configuration_t | end () const =0
| Get the final configuration.
const ConstraintSetPtr_t & | constraints () const
| Get constraints the path is subject to.
Time parameterizarion
Time parameterization is handled by this class so child classes need not to handle it.
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.

## Protected Member Functions
virtual std::ostream & | print (std::ostream &os) const
| 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 bool | impl_compute (ConfigurationOut_t configuration, value_type param) const =0
| Function evaluation without applying constraints.
virtual void | impl_derivative (vectorOut_t derivative, const value_type &param, size_type order) const
virtual void | impl_velocityBound (vectorOut_t bound, const value_type &param0, const value_type &param1) const
virtual PathPtr_t | impl_extract (const interval_t &paramInterval) const
| Virtual implementation of extract.
| Path ()

## Protected Attributes
interval_t | paramRange_
| Interval of parameters.

## Detailed Description

Abstraction of paths: mapping from time to configuration space

A path \( p \) is defined by:

\begin{eqnarray*} p : [t_0, t_1] &\to & \mathcal{C} \\ t &\mapsto & constraints.apply( q(t) ) \end{eqnarray*}

where

- \( [t_0, t_1] \) is given by timeRange
- \( q(t) \) is the child class implementation of impl_compute
- `constraints.apply` corresponds to calling Constraint::apply to constraints

Optionally, it is possible to time-parameterize the path with a function \( s \). By default, \( s \) is the identity. The model becomes:

\begin{eqnarray*} p : [t_0, t_1] &\to & \mathcal{C} \\ t &\mapsto & constraints.apply( q(s(t)) ) \end{eqnarray*}

where \( s \) is the timeParameterization, from timeRange to paramRange.

## Constructor & Destructor Documentation

## ◆ ~Path()

virtual hpp::core::Path::~Path | ( |  | ) |
| inlinevirtual

Destructor.

## ◆ Path() [1/5]

hpp::core::Path::Path | ( | const interval_t & | interval,
|  | size_type | outputSize,
|  | size_type | outputDerivativeSize,
|  | const ConstraintSetPtr_t & | constraints
| ) |  |
| protected

Constructor

Parameters

  interval | interval of definition of the path,
  outputSize | size of the output configuration,
  outputDerivativeSize | number of degrees of freedom of the underlying robot
  constraints | constraints the set is subject to, constraints are solved at each evaluation of the output configuration.

Note
  Constraints are copied.

## ◆ Path() [2/5]

hpp::core::Path::Path | ( | const interval_t & | interval,
|  | size_type | outputSize,
|  | size_type | outputDerivativeSize
| ) |  |
| protected

Constructor

Parameters

  interval | interval of definition of the path,
  outputSize | size of the output configuration,
  outputDerivativeSize | number of degrees of freedom of the underlying robot

## ◆ Path() [3/5]

hpp::core::Path::Path | ( | const Path & | path | ) |
| protected

Copy constructor.

## ◆ Path() [4/5]

hpp::core::Path::Path | ( | const Path & | path,
|  | const ConstraintSetPtr_t & | constraints
| ) |  |
| protected

Copy constructor with constraints.

## ◆ Path() [5/5]

hpp::core::Path::Path | ( |  | ) |
| inlineprotected

## Member Function Documentation

## ◆ as() [1/2]

template<class T >

shared_ptr< T > hpp::core::Path::as | ( | void |  | ) |
| inline

Static cast into a derived type.

## ◆ as() [2/2]

template<class T >

shared_ptr< const T > hpp::core::Path::as | ( | void |  | ) | const
| inline

Static cast into a derived type.

## ◆ at()

bool hpp::core::Path::at | ( | const value_type & | time,
|  | ConfigurationOut_t | result
| ) |  | const
| inline

Get the configuration at a parameter without applying the constraints.

## ◆ checkPath()

virtual void hpp::core::Path::checkPath | ( |  | ) | const
| protectedvirtual

Should be called by child classes after having init.

## ◆ configAtParam()

Configuration_t hpp::core::Path::configAtParam | ( | const value_type & | param,
|  | bool & | success
| ) |  | const
| inlineprotected

## ◆ constraints() [1/2]

const ConstraintSetPtr_t & hpp::core::Path::constraints | ( |  | ) | const
| inline

Get constraints the path is subject to.

## ◆ constraints() [2/2]

void hpp::core::Path::constraints | ( | const ConstraintSetPtr_t & | constraint | ) |
| inlineprotected

Set the constraints

Warning
  this method is protected for child classes that need to initialize themselves before being sure that the initial and end configuration satisfy the constraints

## ◆ copy() [1/2]

virtual PathPtr_t hpp::core::Path::copy | ( |  | ) | const
| pure virtual

Return a shared pointer to a copy of this.

Implemented in hpp::core::DubinsPath, hpp::core::InterpolatedPath, hpp::core::KinodynamicOrientedPath, hpp::core::KinodynamicPath, hpp::core::PathVector, hpp::core::path::Hermite, hpp::core::path::Spline< _PolynomeBasis, _Order >, hpp::core::path::Spline< BernsteinBasis, 3 >, hpp::core::steeringMethod::ConstantCurvature, hpp::core::StraightPath, and hpp::core::SubchainPath.

## ◆ copy() [2/2]

virtual PathPtr_t hpp::core::Path::copy | ( | const ConstraintSetPtr_t & | constraints | ) | const
| pure virtual

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.

Implemented in hpp::core::DubinsPath, hpp::core::InterpolatedPath, hpp::core::KinodynamicOrientedPath, hpp::core::KinodynamicPath, hpp::core::PathVector, hpp::core::path::Hermite, hpp::core::path::Spline< _PolynomeBasis, _Order >, hpp::core::path::Spline< BernsteinBasis, 3 >, hpp::core::steeringMethod::ConstantCurvature, hpp::core::StraightPath, and hpp::core::SubchainPath.

## ◆ derivative()

void hpp::core::Path::derivative | ( | vectorOut_t | result,
|  | const value_type & | time,
|  | size_type | order
| ) |  | const

Get derivative with respect to parameter at given parameter

Parameters

  time | value of the time in the definition interval,
  order | order of the derivative

Return values

  result | derivative. Should be allocated and of correct size.

Warning
  the method is not implemented in this class and throws if called without being implemented in the derived class.

Note
  unless otherwise stated, this method is not compatible with constraints. The derivative of the non-constrained path will be computed.

## ◆ end()

virtual Configuration_t hpp::core::Path::end | ( |  | ) | const
| pure virtual

Get the final configuration.

Implemented in hpp::core::DubinsPath, hpp::core::InterpolatedPath, hpp::core::PathVector, hpp::core::path::Hermite, hpp::core::path::Spline< _PolynomeBasis, _Order >, hpp::core::path::Spline< BernsteinBasis, 3 >, hpp::core::steeringMethod::ConstantCurvature, hpp::core::StraightPath, and hpp::core::SubchainPath.

## ◆ eval() [1/2]

bool hpp::core::Path::eval | ( | ConfigurationOut_t | result,
|  | const value_type & | time
| ) |  | const
| inline

Configuration at time.

## ◆ eval() [2/2]

Configuration_t hpp::core::Path::eval | ( | const value_type & | time,
|  | bool & | success
| ) |  | const
| inline

Configuration at time.

## ◆ extract() [1/2]

PathPtr_t hpp::core::Path::extract | ( | const interval_t & | subInterval | ) | const

Parameters

  subInterval | interval of definition of the extract path If upper bound of subInterval is smaller than lower bound, result is reversed.

Exceptions

  projection_error | is thrown when an end configuration of the returned path could not be computed due to projection failure.

## ◆ extract() [2/2]

PathPtr_t hpp::core::Path::extract | ( | const value_type & | tmin,
|  | const value_type & | tmax
| ) |  | const
| inline

Parameters

  subInterval | interval of definition of the extract path If upper bound of subInterval is smaller than lower bound, result is reversed.

Exceptions

  projection_error | is thrown when an end configuration of the returned path could not be computed due to projection failure.

## ◆ impl_compute()

virtual bool hpp::core::Path::impl_compute | ( | ConfigurationOut_t | configuration,
|  | value_type | param
| ) |  | const
| protectedpure virtual

Function evaluation without applying constraints.

Returns
  true if everything went good.

Implemented in hpp::core::path::Spline< _PolynomeBasis, _Order >, hpp::core::path::Spline< BernsteinBasis, 3 >, hpp::core::InterpolatedPath, hpp::core::steeringMethod::ConstantCurvature, hpp::core::StraightPath, hpp::core::SubchainPath, hpp::core::KinodynamicOrientedPath, hpp::core::KinodynamicPath, and hpp::core::PathVector.

## ◆ impl_derivative()

virtual void hpp::core::Path::impl_derivative | ( | vectorOut_t | derivative,
|  | const value_type & | param,
|  | size_type | order
| ) |  | const
| inlineprotectedvirtual

Virtual implementation of derivative

Parameters

  param | parameter within paramRange
  order | order of derivation.

Return values

  derivative |

Reimplemented in hpp::core::path::Spline< _PolynomeBasis, _Order >, hpp::core::path::Spline< BernsteinBasis, 3 >, hpp::core::steeringMethod::ConstantCurvature, hpp::core::InterpolatedPath, hpp::core::PathVector, and hpp::core::StraightPath.

## ◆ impl_extract()

virtual PathPtr_t hpp::core::Path::impl_extract | ( | const interval_t & | paramInterval | ) | const
| protectedvirtual

Virtual implementation of extract.

Reimplemented in hpp::core::KinodynamicPath, hpp::core::steeringMethod::ConstantCurvature, hpp::core::InterpolatedPath, hpp::core::KinodynamicOrientedPath, hpp::core::PathVector, and hpp::core::StraightPath.

## ◆ impl_velocityBound()

virtual void hpp::core::Path::impl_velocityBound | ( | vectorOut_t | bound,
|  | const value_type & | param0,
|  | const value_type & | param1
| ) |  | const
| inlineprotectedvirtual

Virtual implementation of velocityBound

Parameters

  param0,param1 | interval of parameter

Return values

  bound |

Reimplemented in hpp::core::PathVector, hpp::core::steeringMethod::ConstantCurvature, hpp::core::StraightPath, hpp::core::InterpolatedPath, hpp::core::path::Spline< _PolynomeBasis, _Order >, and hpp::core::path::Spline< BernsteinBasis, 3 >.

## ◆ init()

void hpp::core::Path::init | ( | const PathWkPtr_t & | self | ) |
| protected

Store weak pointer to itself

should be called at construction of derived class instances

## ◆ initial()

virtual Configuration_t hpp::core::Path::initial | ( |  | ) | const
| pure virtual

Get the initial configuration.

Implemented in hpp::core::DubinsPath, hpp::core::InterpolatedPath, hpp::core::PathVector, hpp::core::path::Hermite, hpp::core::path::Spline< _PolynomeBasis, _Order >, hpp::core::path::Spline< BernsteinBasis, 3 >, hpp::core::steeringMethod::ConstantCurvature, hpp::core::StraightPath, and hpp::core::SubchainPath.

## ◆ length()

virtual value_type hpp::core::Path::length | ( |  | ) | const
| inlinevirtual

Get length of definition interval.

## ◆ outputDerivativeSize()

size_type hpp::core::Path::outputDerivativeSize | ( |  | ) | const
| inline

Get size of velocity.

## ◆ outputSize()

size_type hpp::core::Path::outputSize | ( |  | ) | const
| inline

Get size of configuration space.

## ◆ paramLength()

value_type hpp::core::Path::paramLength | ( |  | ) | const
| inlineprotected

## ◆ paramRange()

const interval_t & hpp::core::Path::paramRange | ( |  | ) | const
| inline

Get interval of parameters.

Returns
  the result of applying the timeParameterization to timeRange().

Note
  The time parameterization defaults to identity.

## ◆ print()

virtual std::ostream & hpp::core::Path::print | ( | std::ostream & | os | ) | const
| protectedvirtual

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

Reimplemented in hpp::core::DubinsPath, hpp::core::InterpolatedPath, hpp::core::KinodynamicOrientedPath, hpp::core::KinodynamicPath, hpp::core::PathVector, hpp::core::path::Hermite, hpp::core::path::Spline< _PolynomeBasis, _Order >, hpp::core::path::Spline< BernsteinBasis, 3 >, hpp::core::steeringMethod::ConstantCurvature, hpp::core::StraightPath, and hpp::core::SubchainPath.

## ◆ reverse()

virtual PathPtr_t hpp::core::Path::reverse | ( |  | ) | const
| virtual

Reversion of a path

Returns
  a new path that is this one reversed.

Reimplemented in hpp::core::InterpolatedPath, and hpp::core::steeringMethod::ConstantCurvature.

## ◆ timeParameterization() [1/2]

const TimeParameterizationPtr_t & hpp::core::Path::timeParameterization | ( |  | ) | const
| inline

Get the time parameterization function.

## ◆ timeParameterization() [2/2]

void hpp::core::Path::timeParameterization | ( | const TimeParameterizationPtr_t & | tp,
|  | const interval_t & | tr
| ) |  |
| inline

Set the time parameterization function.

## ◆ timeRange() [1/2]

const interval_t & hpp::core::Path::timeRange | ( |  | ) | const
| inline

Get interval of definition.

## ◆ timeRange() [2/2]

void hpp::core::Path::timeRange | ( | const interval_t & | timeRange | ) |
| inlineprotected

## ◆ velocityBound()

void hpp::core::Path::velocityBound | ( | vectorOut_t | result,
|  | const value_type & | t0,
|  | const value_type & | t1
| ) |  | const
| inline

Get an upper bound of the velocity on a sub-interval. The result is a coefficient-wise.

Parameters

  t0 | begin of the interval
  t1 | end of the interval

Return values

  result | maximal derivative on the sub-interval. Should be allocated and of correct size.

Warning
  the method is not implemented in this class and throws if called without being implemented in the derived class.

Note
  unless otherwise stated, this method is not compatible with constraints. The derivative of the non-constrained path will be computed.

## Member Data Documentation

## ◆ paramRange_

interval_t hpp::core::Path::paramRange_
| protected

Interval of parameters.

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

- include/hpp/core/path.hh