Aikido
aikido::statespace::GeodesicInterpolator Class Reference

Interpolate by parallel transport along a geodesic between two states in a Lie group with an affine connection. More...

#include <aikido/statespace/GeodesicInterpolator.hpp>

Inheritance diagram for aikido::statespace::GeodesicInterpolator:
aikido::statespace::Interpolator

Public Member Functions

 GeodesicInterpolator (statespace::ConstStateSpacePtr _stateSpace)
 Constructs a GeodesicInterpolator for _stateSpace. More...
 
virtual ~GeodesicInterpolator ()=default
 
ConstStateSpacePtr getStateSpace () const override
 Gets the StateSpace on which this Interpolator operates. More...
 
std::size_t getNumDerivatives () const override
 Upper bound on the number of non-zero derivatives. More...
 
Eigen::VectorXd getTangentVector (const statespace::StateSpace::State *_from, const statespace::StateSpace::State *_to) const
 Gets the tangent vector that defines the geodesic, scaled such that: More...
 
void interpolate (const statespace::StateSpace::State *_from, const statespace::StateSpace::State *_to, double _alpha, statespace::StateSpace::State *_state) const override
 Computes the state that lies at path parameter _alpha along the path that connects _from to _to. More...
 
void getDerivative (const statespace::StateSpace::State *_from, const statespace::StateSpace::State *_to, std::size_t _derivative, double _alpha, Eigen::VectorXd &_tangentVector) const override
 Computes the _derivative-th derivative of the path at path parameter _alpha between _from and _to. More...
 
- Public Member Functions inherited from aikido::statespace::Interpolator
virtual ~Interpolator ()=default
 

Private Attributes

statespace::ConstStateSpacePtr mStateSpace
 

Detailed Description

Interpolate by parallel transport along a geodesic between two states in a Lie group with an affine connection.

The geodesic is defined by a single tangent vector that remains constant during interpolation.

Constructor & Destructor Documentation

◆ GeodesicInterpolator()

aikido::statespace::GeodesicInterpolator::GeodesicInterpolator ( statespace::ConstStateSpacePtr  _stateSpace)
explicit

Constructs a GeodesicInterpolator for _stateSpace.

Parameters
_stateSpaceused for interpolation

◆ ~GeodesicInterpolator()

virtual aikido::statespace::GeodesicInterpolator::~GeodesicInterpolator ( )
virtualdefault

Member Function Documentation

◆ getDerivative()

void aikido::statespace::GeodesicInterpolator::getDerivative ( const statespace::StateSpace::State _from,
const statespace::StateSpace::State _to,
std::size_t  _derivative,
double  _alpha,
Eigen::VectorXd &  _tangentVector 
) const
overridevirtual

Computes the _derivative-th derivative of the path at path parameter _alpha between _from and _to.

The output is an element of the tangent space in the local (i.e. "body") frame.

Parameters
_fromstart state in getStateSpace()
_toend state in getStateSpace()
_derivativeorder of the derivative to compute
_alphapath parameter in the range [0, 1]
[out]_tangentVectoroutput element of the tangent space

Implements aikido::statespace::Interpolator.

◆ getNumDerivatives()

std::size_t aikido::statespace::GeodesicInterpolator::getNumDerivatives ( ) const
overridevirtual

Upper bound on the number of non-zero derivatives.

Implements aikido::statespace::Interpolator.

◆ getStateSpace()

ConstStateSpacePtr aikido::statespace::GeodesicInterpolator::getStateSpace ( ) const
overridevirtual

Gets the StateSpace on which this Interpolator operates.

Implements aikido::statespace::Interpolator.

◆ getTangentVector()

Eigen::VectorXd aikido::statespace::GeodesicInterpolator::getTangentVector ( const statespace::StateSpace::State _from,
const statespace::StateSpace::State _to 
) const

Gets the tangent vector that defines the geodesic, scaled such that:

interpolate(alpha) = _from * expMap(alpha * tangentVector)
Parameters
_fromstart state in getStateSpace()
_togoal state in getStateSpace()
Returns
tangent vector that defines the geodesic

◆ interpolate()

void aikido::statespace::GeodesicInterpolator::interpolate ( const statespace::StateSpace::State _from,
const statespace::StateSpace::State _to,
double  _alpha,
statespace::StateSpace::State _state 
) const
overridevirtual

Computes the state that lies at path parameter _alpha along the path that connects _from to _to.

By definition interpolate(0) is _from and interpolate(1) is _to. The memory location of _state must differ from the memory locations of _from and _to.

Parameters
_fromstart state in getStateSpace()
_toend state in getStateSpace()
_alphapath parameter in the range [0, 1]
[out]_stateoutput interpolated state

Implements aikido::statespace::Interpolator.

Member Data Documentation

◆ mStateSpace

statespace::ConstStateSpacePtr aikido::statespace::GeodesicInterpolator::mStateSpace
private
aikido::statespace::GeodesicInterpolator::interpolate
void interpolate(const statespace::StateSpace::State *_from, const statespace::StateSpace::State *_to, double _alpha, statespace::StateSpace::State *_state) const override
Computes the state that lies at path parameter _alpha along the path that connects _from to _to.