hpp::core::InterpolatedPath Class Reference

Piecewise linear interpolation between two configurations. More...

#include <hpp/core/interpolated-path.hh>

Inheritance diagram for hpp::core::InterpolatedPath:
[legend]
Collaboration diagram for hpp::core::InterpolatedPath:
[legend]

Public Types

typedef std::pair< value_type, Configuration_tInterpolationPoint_t
 
typedef std::map< value_type, Configuration_t, std::less< value_type >, Eigen::aligned_allocator< InterpolationPoint_t > > InterpolationPoints_t
 
typedef Path parent_t
 

Public Member Functions

virtual ~InterpolatedPath () throw ()
 Destructor. More...
 
virtual PathPtr_t copy () const
 Return a shared pointer to this. More...
 
virtual PathPtr_t copy (const ConstraintSetPtr_t &constraints) const
 Return a shared pointer to a copy of this and set constraints. More...
 
virtual PathPtr_t reverse () const
 Reversion of a path. More...
 
DevicePtr_t device () const
 Return the internal robot. More...
 
void insert (const value_type &time, ConfigurationIn_t config)
 Insert interpolation point. More...
 
Configuration_t initial () const
 Get the initial configuration. More...
 
Configuration_t end () const
 Get the final configuration. More...
 
const InterpolationPoints_tinterpolationPoints () const
 
- Public Member Functions inherited from hpp::core::Path
virtual ~Path () throw ()
 Destructor. More...
 
template<class T >
boost::shared_ptr< T > as (void)
 Static cast into a derived type. More...
 
template<class T >
boost::shared_ptr< const T > as (void) const
 Static cast into a derived type. More...
 
PathPtr_t extract (const interval_t &subInterval) const throw (projection_error)
 
PathPtr_t extract (const value_type &tmin, const value_type &tmax) const throw (projection_error)
 
Configuration_t operator() (const value_type &time) const HPP_CORE_DEPRECATED
 
Configuration_t operator() (const value_type &time, bool &success) const
 
bool operator() (ConfigurationOut_t result, const value_type &time) const throw ()
 
Configuration_t eval (const value_type &time, bool &success) const
 
bool eval (ConfigurationOut_t result, const value_type &time) const throw ()
 
bool at (const value_type &time, ConfigurationOut_t result) const
 Get the configuration at a parameter without applying the constraints. More...
 
void derivative (vectorOut_t result, const value_type &time, size_type order) const
 Get derivative with respect to parameter at given parameter. More...
 
void velocityBound (vectorOut_t result, const value_type &t0, const value_type &t1) const
 Get an upper bound of the velocity on a sub-interval. More...
 
size_type outputSize () const
 Get size of configuration space. More...
 
size_type outputDerivativeSize () const
 Get size of velocity. More...
 
const interval_ttimeRange () const
 Get interval of definition. More...
 
virtual value_type length () const
 Get length of definition interval. More...
 
const ConstraintSetPtr_tconstraints () const
 Get constraints the path is subject to. More...
 
const interval_tparamRange () const
 Get interval of parameters. More...
 
void timeParameterization (const TimeParameterizationPtr_t &tp, const interval_t &tr)
 Set the time parameterization function. More...
 

Static Public Member Functions

static InterpolatedPathPtr_t create (const DevicePtr_t &device, ConfigurationIn_t init, ConfigurationIn_t end, value_type length)
 Create instance and return shared pointer. More...
 
static InterpolatedPathPtr_t create (const DevicePtr_t &device, ConfigurationIn_t init, ConfigurationIn_t end, value_type length, ConstraintSetPtr_t constraints)
 Create instance and return shared pointer. More...
 
static InterpolatedPathPtr_t createCopy (const InterpolatedPathPtr_t &path)
 Create copy and return shared pointer. More...
 
static InterpolatedPathPtr_t create (const PathPtr_t &path, const DevicePtr_t &device, const std::size_t &nbSamples)
 Create an interpolation of this path. More...
 
static InterpolatedPathPtr_t createCopy (const InterpolatedPathPtr_t &path, const ConstraintSetPtr_t &constraints)
 Create copy and return shared pointer. More...
 

Protected Member Functions

virtual std::ostream & print (std::ostream &os) const
 Print path in a stream. More...
 
 InterpolatedPath (const DevicePtr_t &robot, ConfigurationIn_t init, ConfigurationIn_t end, value_type length)
 Constructor. More...
 
 InterpolatedPath (const DevicePtr_t &robot, ConfigurationIn_t init, ConfigurationIn_t end, value_type length, ConstraintSetPtr_t constraints)
 Constructor with constraints. More...
 
 InterpolatedPath (const PathPtr_t &path, const DevicePtr_t &device, const std::size_t &nbSamples)
 DIscretization of a given path. More...
 
 InterpolatedPath (const InterpolatedPath &path)
 Copy constructor. More...
 
 InterpolatedPath (const InterpolatedPath &path, const ConstraintSetPtr_t &constraints)
 Copy constructor with constraints. More...
 
void init (InterpolatedPathPtr_t self)
 
void initCopy (InterpolatedPathPtr_t self)
 
virtual bool impl_compute (ConfigurationOut_t result, value_type param) const
 Function evaluation without applying constraints. More...
 
virtual void impl_derivative (vectorOut_t result, const value_type &t, size_type order) const
 Virtual implementation of derivative. More...
 
virtual void impl_velocityBound (vectorOut_t result, const value_type &t0, const value_type &t1) const
 Virtual implementation of velocityBound. More...
 
PathPtr_t impl_extract (const interval_t &subInterval) const throw (projection_error)
 Extraction/Reversion of a sub-path See Path::extract. More...
 
- Protected Member Functions inherited from hpp::core::Path
 Path (const interval_t &interval, size_type outputSize, size_type outputDerivativeSize, const ConstraintSetPtr_t &constraints)
 Constructor. More...
 
 Path (const interval_t &interval, size_type outputSize, size_type outputDerivativeSize)
 Constructor. More...
 
 Path (const Path &path)
 Copy constructor. More...
 
 Path (const Path &path, const ConstraintSetPtr_t &constraints)
 Copy constructor with constraints. More...
 
void init (const PathWkPtr_t &self)
 Store weak pointer to itself. More...
 
void constraints (const ConstraintSetPtr_t &constraint)
 Set the constraints. More...
 
virtual void checkPath () const
 Should be called by child classes after having init. More...
 
void timeRange (const interval_t &timeRange)
 
const TimeParameterizationPtr_ttimeParameterization () const
 
value_type paramLength () const
 
Configuration_t configAtParam (const value_type &param, bool &success) const
 

Additional Inherited Members

- Protected Attributes inherited from hpp::core::Path
interval_t paramRange_
 Interval of parameters. More...
 

Detailed Description

Piecewise linear interpolation between two configurations.

This type of path is the return type of PathProjector algorithms.

Degrees of freedom are interpolated depending on the type of joint they parameterize:

  • linear interpolation for translation joints, bounded rotation joints, and translation part of freeflyer joints,
  • angular interpolation for unbounded rotation joints,
  • constant angular velocity for SO(3) part of freeflyer joints.

Member Typedef Documentation

Constructor & Destructor Documentation

virtual hpp::core::InterpolatedPath::~InterpolatedPath ( )
throw (
)
inlinevirtual

Destructor.

hpp::core::InterpolatedPath::InterpolatedPath ( const DevicePtr_t robot,
ConfigurationIn_t  init,
ConfigurationIn_t  end,
value_type  length 
)
protected

Constructor.

hpp::core::InterpolatedPath::InterpolatedPath ( const DevicePtr_t robot,
ConfigurationIn_t  init,
ConfigurationIn_t  end,
value_type  length,
ConstraintSetPtr_t  constraints 
)
protected

Constructor with constraints.

hpp::core::InterpolatedPath::InterpolatedPath ( const PathPtr_t path,
const DevicePtr_t device,
const std::size_t &  nbSamples 
)
protected

DIscretization of a given path.

hpp::core::InterpolatedPath::InterpolatedPath ( const InterpolatedPath path)
protected

Copy constructor.

hpp::core::InterpolatedPath::InterpolatedPath ( const InterpolatedPath path,
const ConstraintSetPtr_t constraints 
)
protected

Copy constructor with constraints.

Member Function Documentation

virtual PathPtr_t hpp::core::InterpolatedPath::copy ( ) const
inlinevirtual

Return a shared pointer to this.

As StaightPath are immutable, and refered to by shared pointers, they do not need to be copied.

Implements hpp::core::Path.

virtual PathPtr_t hpp::core::InterpolatedPath::copy ( const ConstraintSetPtr_t constraints) const
inlinevirtual

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

Parameters
constraintsconstraints to apply to the copy
Precondition
*this should not have constraints.

Implements hpp::core::Path.

static InterpolatedPathPtr_t hpp::core::InterpolatedPath::create ( const DevicePtr_t device,
ConfigurationIn_t  init,
ConfigurationIn_t  end,
value_type  length 
)
inlinestatic

Create instance and return shared pointer.

Parameters
deviceRobot corresponding to configurations
init,endStart and end configurations of the path
lengthDistance between the configurations.

References init().

Referenced by hpp::core::steeringMethod::Interpolated::impl_compute().

static InterpolatedPathPtr_t hpp::core::InterpolatedPath::create ( const DevicePtr_t device,
ConfigurationIn_t  init,
ConfigurationIn_t  end,
value_type  length,
ConstraintSetPtr_t  constraints 
)
inlinestatic

Create instance and return shared pointer.

Parameters
deviceRobot corresponding to configurations
init,endStart and end configurations of the path
lengthDistance between the configurations.
constraintsthe path is subject to

References init().

static InterpolatedPathPtr_t hpp::core::InterpolatedPath::create ( const PathPtr_t path,
const DevicePtr_t device,
const std::size_t &  nbSamples 
)
static

Create an interpolation of this path.

Parameters
pathpath to interpolate
nbSamplesnumber of samples between the initial and end configuration
Note
it is assume that the constraints are constant along the path
static InterpolatedPathPtr_t hpp::core::InterpolatedPath::createCopy ( const InterpolatedPathPtr_t path)
inlinestatic

Create copy and return shared pointer.

Parameters
pathpath to copy

References create(), and initCopy().

static InterpolatedPathPtr_t hpp::core::InterpolatedPath::createCopy ( const InterpolatedPathPtr_t path,
const ConstraintSetPtr_t constraints 
)
inlinestatic

Create copy and return shared pointer.

Parameters
pathpath to copy
constraintsthe path is subject to

References initCopy().

DevicePtr_t hpp::core::InterpolatedPath::device ( ) const

Return the internal robot.

Configuration_t hpp::core::InterpolatedPath::end ( ) const
inlinevirtual

Get the final configuration.

Implements hpp::core::Path.

virtual bool hpp::core::InterpolatedPath::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.

virtual void hpp::core::InterpolatedPath::impl_derivative ( vectorOut_t  result,
const value_type t,
size_type  order 
) const
protectedvirtual

Virtual implementation of derivative.

Reimplemented from hpp::core::Path.

PathPtr_t hpp::core::InterpolatedPath::impl_extract ( const interval_t subInterval) const
throw (projection_error
)
protectedvirtual

Extraction/Reversion of a sub-path See Path::extract.

Reimplemented from hpp::core::Path.

virtual void hpp::core::InterpolatedPath::impl_velocityBound ( vectorOut_t  bound,
const value_type param0,
const value_type param1 
) const
protectedvirtual

Virtual implementation of velocityBound.

Parameters
param0,param1interval of parameter
Return values
bound

Reimplemented from hpp::core::Path.

void hpp::core::InterpolatedPath::init ( InterpolatedPathPtr_t  self)
protected

Referenced by create().

void hpp::core::InterpolatedPath::initCopy ( InterpolatedPathPtr_t  self)
protected

Referenced by createCopy().

Configuration_t hpp::core::InterpolatedPath::initial ( ) const
inlinevirtual

Get the initial configuration.

Implements hpp::core::Path.

void hpp::core::InterpolatedPath::insert ( const value_type time,
ConfigurationIn_t  config 
)
inline

Insert interpolation point.

const InterpolationPoints_t& hpp::core::InterpolatedPath::interpolationPoints ( ) const
inline
virtual std::ostream& hpp::core::InterpolatedPath::print ( std::ostream &  os) const
inlineprotectedvirtual

Print path in a stream.

Reimplemented from hpp::core::Path.

References hpp::core::Path::print().

virtual PathPtr_t hpp::core::InterpolatedPath::reverse ( ) const
virtual

Reversion of a path.

Returns
a new path that is this one reversed.

Reimplemented from hpp::core::Path.