hpp::rbprm::ParabolaPath Class Reference

Linear interpolation between two configurations. More...

#include <hpp/rbprm/planner/parabola-path.hh>

Inheritance diagram for hpp::rbprm::ParabolaPath:
[legend]
Collaboration diagram for hpp::rbprm::ParabolaPath:
[legend]

Public Types

typedef Path parent_t
 

Public Member Functions

virtual ~ParabolaPath () throw ()
 Destructor. More...
 
virtual core::PathPtr_t copy () const
 Return a shared pointer to this. More...
 
virtual core::PathPtr_t copy (const core::ConstraintSetPtr_t &constraints) const
 Return a shared pointer to a copy of this and set constraints. More...
 
virtual core::PathPtr_t extract (const core::interval_t &subInterval) const throw (core::projection_error)
 Extraction/Reversion of a sub-path. More...
 
virtual core::PathPtr_t reverse () const
 Reversion of a path. More...
 
void initialConfig (core::ConfigurationIn_t initial)
 Modify initial configuration. More...
 
void endConfig (core::ConfigurationIn_t end)
 Modify end configuration. More...
 
core::DevicePtr_t device () const
 Return the internal robot. More...
 
core::Configuration_t initial () const
 Get the initial configuration. More...
 
core::Configuration_t end () const
 Get the final configuration. More...
 
virtual core::value_type length () const
 Get previously computed length. More...
 
void coefficients (core::vector_t coefs) const
 Set the three parabola coefficients. More...
 
core::vector_t coefficients () const
 Get path coefficients. More...
 
virtual core::value_type computeLength (const core::ConfigurationIn_t q1, const core::ConfigurationIn_t q2) const
 
core::vector_t evaluateVelocity (const core::value_type t) const
 Evaluate velocity vector at path abcissa t. More...
 

Static Public Member Functions

static ParabolaPathPtr_t create (const core::DevicePtr_t &device, core::ConfigurationIn_t init, core::ConfigurationIn_t end, core::value_type length, core::vector_t coefficients)
 Create instance and return shared pointer. More...
 
static ParabolaPathPtr_t create (const core::DevicePtr_t &device, core::ConfigurationIn_t init, core::ConfigurationIn_t end, core::value_type length, core::vector_t coefficients, core::vector_t V0, core::vector_t Vimp, std::vector< std::string > initialROMnames, std::vector< std::string > endROMnames)
 Create instance and return shared pointer. More...
 
static ParabolaPathPtr_t createCopy (const ParabolaPathPtr_t &path)
 Create copy and return shared pointer. More...
 
static ParabolaPathPtr_t createCopy (const ParabolaPathPtr_t &path, const core::ConstraintSetPtr_t &)
 Create copy and return shared pointer. More...
 

Public Attributes

core::value_type alpha_
 
core::value_type alphaMin_
 
core::value_type alphaMax_
 
core::value_type Xtheta_
 
core::value_type Z_
 
core::vector_t V0_
 
core::vector_t Vimp_
 
std::vector< std::string > initialROMnames_
 
std::vector< std::string > endROMnames_
 

Protected Member Functions

virtual std::ostream & print (std::ostream &os) const
 Print path in a stream. More...
 
 ParabolaPath (const core::DevicePtr_t &robot, core::ConfigurationIn_t init, core::ConfigurationIn_t end, core::value_type length, core::vector_t coefficients)
 Constructor. More...
 
 ParabolaPath (const core::DevicePtr_t &device, core::ConfigurationIn_t init, core::ConfigurationIn_t end, core::value_type length, core::vector_t coefs, core::vector_t V0_, core::vector_t Vimp, std::vector< std::string > initialROMnames, std::vector< std::string > endROMnames)
 Constructor with velocities and ROMnames. More...
 
 ParabolaPath (const ParabolaPath &path)
 Copy constructor. More...
 
core::value_type lengthFunction (const core::value_type x) const
 
void init (ParabolaPathPtr_t self)
 
virtual bool impl_compute (core::ConfigurationOut_t result, core::value_type param) const
 Param is the curvilinear abcissa [0 : pathLength] The pathLength can be computed as long as the coefficients_ are known Finally: config(0) = x(param) = (1 - param/length)*x1 + param/length*x2 config(1) = coefs(0)*x(param)^2 + coefs(1)*x(param) + coefs(2) More...
 

Detailed Description

Linear interpolation between two configurations.

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

◆ parent_t

Constructor & Destructor Documentation

◆ ~ParabolaPath()

virtual hpp::rbprm::ParabolaPath::~ParabolaPath ( )
throw (
)
inlinevirtual

Destructor.

◆ ParabolaPath() [1/3]

hpp::rbprm::ParabolaPath::ParabolaPath ( const core::DevicePtr_t robot,
core::ConfigurationIn_t  init,
core::ConfigurationIn_t  end,
core::value_type  length,
core::vector_t  coefficients 
)
protected

Constructor.

Referenced by create(), createCopy(), and print().

◆ ParabolaPath() [2/3]

hpp::rbprm::ParabolaPath::ParabolaPath ( const core::DevicePtr_t device,
core::ConfigurationIn_t  init,
core::ConfigurationIn_t  end,
core::value_type  length,
core::vector_t  coefs,
core::vector_t  V0_,
core::vector_t  Vimp,
std::vector< std::string >  initialROMnames,
std::vector< std::string >  endROMnames 
)
protected

Constructor with velocities and ROMnames.

◆ ParabolaPath() [3/3]

hpp::rbprm::ParabolaPath::ParabolaPath ( const ParabolaPath path)
protected

Copy constructor.

Member Function Documentation

◆ coefficients() [1/2]

void hpp::rbprm::ParabolaPath::coefficients ( core::vector_t  coefs) const
inline

Set the three parabola coefficients.

◆ coefficients() [2/2]

core::vector_t hpp::rbprm::ParabolaPath::coefficients ( ) const
inline

Get path coefficients.

References computeLength(), and evaluateVelocity().

Referenced by hpp::rbprm::TimedParabolaPath::length(), and print().

◆ computeLength()

virtual core::value_type hpp::rbprm::ParabolaPath::computeLength ( const core::ConfigurationIn_t  q1,
const core::ConfigurationIn_t  q2 
) const
virtual

Referenced by coefficients().

◆ copy() [1/2]

virtual core::PathPtr_t hpp::rbprm::ParabolaPath::copy ( ) const
inlinevirtual

Return a shared pointer to this.

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

Reimplemented in hpp::rbprm::TimedParabolaPath.

References createCopy().

◆ copy() [2/2]

virtual core::PathPtr_t hpp::rbprm::ParabolaPath::copy ( const core::ConstraintSetPtr_t &  constraints) const
inlinevirtual

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

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

Reimplemented in hpp::rbprm::TimedParabolaPath.

References createCopy(), extract(), and reverse().

◆ create() [1/2]

static ParabolaPathPtr_t hpp::rbprm::ParabolaPath::create ( const core::DevicePtr_t device,
core::ConfigurationIn_t  init,
core::ConfigurationIn_t  end,
core::value_type  length,
core::vector_t  coefficients 
)
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(), and ParabolaPath().

◆ create() [2/2]

static ParabolaPathPtr_t hpp::rbprm::ParabolaPath::create ( const core::DevicePtr_t device,
core::ConfigurationIn_t  init,
core::ConfigurationIn_t  end,
core::value_type  length,
core::vector_t  coefficients,
core::vector_t  V0,
core::vector_t  Vimp,
std::vector< std::string >  initialROMnames,
std::vector< std::string >  endROMnames 
)
inlinestatic

Create instance and return shared pointer.

Parameters
deviceRobot corresponding to configurations
init,endStart and end configurations of the path
lengthDistance between the configurations.
V0,Vimpinitial and final velocity vectors
initialROMnames,endROMnamesinitial and final ROM names

References init(), and ParabolaPath().

◆ createCopy() [1/2]

static ParabolaPathPtr_t hpp::rbprm::ParabolaPath::createCopy ( const ParabolaPathPtr_t path)
inlinestatic

Create copy and return shared pointer.

Parameters
pathpath to copy

References init(), and ParabolaPath().

Referenced by copy().

◆ createCopy() [2/2]

static ParabolaPathPtr_t hpp::rbprm::ParabolaPath::createCopy ( const ParabolaPathPtr_t path,
const core::ConstraintSetPtr_t &   
)
inlinestatic

Create copy and return shared pointer.

Parameters
pathpath to copy
constraintsthe path is subject to <!> constraints part NOT IMPLEMENTED YET

References init(), and ParabolaPath().

◆ device()

core::DevicePtr_t hpp::rbprm::ParabolaPath::device ( ) const

Return the internal robot.

Referenced by endConfig().

◆ end()

core::Configuration_t hpp::rbprm::ParabolaPath::end ( ) const
inline

Get the final configuration.

Referenced by endConfig(), and print().

◆ endConfig()

void hpp::rbprm::ParabolaPath::endConfig ( core::ConfigurationIn_t  end)
inline

Modify end configuration.

Parameters
endnew end configuration
Precondition
input configuration should be of the same size as current end configuration

References assert(), device(), and end().

◆ evaluateVelocity()

core::vector_t hpp::rbprm::ParabolaPath::evaluateVelocity ( const core::value_type  t) const

Evaluate velocity vector at path abcissa t.

Referenced by coefficients().

◆ extract()

virtual core::PathPtr_t hpp::rbprm::ParabolaPath::extract ( const core::interval_t &  subInterval) const
throw (core::projection_error
)
virtual

Extraction/Reversion of a sub-path.

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

Reimplemented in hpp::rbprm::TimedParabolaPath.

Referenced by copy().

◆ impl_compute()

virtual bool hpp::rbprm::ParabolaPath::impl_compute ( core::ConfigurationOut_t  result,
core::value_type  param 
) const
protectedvirtual

Param is the curvilinear abcissa [0 : pathLength] The pathLength can be computed as long as the coefficients_ are known Finally: config(0) = x(param) = (1 - param/length)*x1 + param/length*x2 config(1) = coefs(0)*x(param)^2 + coefs(1)*x(param) + coefs(2)

Reimplemented in hpp::rbprm::TimedParabolaPath.

Referenced by init().

◆ init()

void hpp::rbprm::ParabolaPath::init ( ParabolaPathPtr_t  self)
inlineprotected

◆ initial()

core::Configuration_t hpp::rbprm::ParabolaPath::initial ( ) const
inline

Get the initial configuration.

Referenced by initialConfig().

◆ initialConfig()

void hpp::rbprm::ParabolaPath::initialConfig ( core::ConfigurationIn_t  initial)
inline

Modify initial configuration.

Parameters
initialnew initial configuration
Precondition
input configuration should be of the same size as current initial configuration

References assert(), and initial().

◆ length()

virtual core::value_type hpp::rbprm::ParabolaPath::length ( ) const
inlinevirtual

Get previously computed length.

Reimplemented in hpp::rbprm::TimedParabolaPath.

Referenced by print().

◆ lengthFunction()

core::value_type hpp::rbprm::ParabolaPath::lengthFunction ( const core::value_type  x) const
protected

Referenced by print().

◆ print()

virtual std::ostream& hpp::rbprm::ParabolaPath::print ( std::ostream &  os) const
inlineprotectedvirtual

Print path in a stream.

Reimplemented in hpp::rbprm::TimedParabolaPath.

References coefficients(), end(), init(), length(), lengthFunction(), and ParabolaPath().

◆ reverse()

virtual core::PathPtr_t hpp::rbprm::ParabolaPath::reverse ( ) const
virtual

Reversion of a path.

Returns
a new path that is this one reversed.

Reimplemented in hpp::rbprm::TimedParabolaPath.

Referenced by copy().

Member Data Documentation

◆ alpha_

core::value_type hpp::rbprm::ParabolaPath::alpha_

◆ alphaMax_

core::value_type hpp::rbprm::ParabolaPath::alphaMax_

◆ alphaMin_

core::value_type hpp::rbprm::ParabolaPath::alphaMin_

◆ endROMnames_

std::vector<std::string> hpp::rbprm::ParabolaPath::endROMnames_

◆ initialROMnames_

std::vector<std::string> hpp::rbprm::ParabolaPath::initialROMnames_

◆ V0_

core::vector_t hpp::rbprm::ParabolaPath::V0_

◆ Vimp_

core::vector_t hpp::rbprm::ParabolaPath::Vimp_

◆ Xtheta_

core::value_type hpp::rbprm::ParabolaPath::Xtheta_

◆ Z_

core::value_type hpp::rbprm::ParabolaPath::Z_