hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
hpp::core::ConstraintSet Class Reference

#include <hpp/core/constraint-set.hh>

Inheritance diagram for hpp::core::ConstraintSet:
Collaboration diagram for hpp::core::ConstraintSet:

Public Member Functions

virtual ConstraintPtr_t copy () const
 return shared pointer to copy More...
 
void addConstraint (const ConstraintPtr_t &constraint)
 Add a constraint to the set. More...
 
ConfigProjectorPtr_t configProjector () const
 Return pointer to config projector if any. More...
 
Constraints_t::iterator begin ()
 Iterator over the constraints. More...
 
Constraints_t::iterator end ()
 Iterator over the constraints. More...
 
virtual bool isSatisfied (ConfigurationIn_t config)
 Check whether a configuration statisfies the constraint. More...
 
virtual bool isSatisfied (ConfigurationIn_t config, vector_t &error)
 
Compression of locked degrees of freedom

Degrees of freedom related to locked joint are not taken into account in numerical constraint resolution. The following methods Compress or uncompress vectors or matrices by removing lines and columns corresponding to locked degrees of freedom.

size_type numberNonLockedDof () const
 Get number of non-locked degrees of freedom. More...
 
void compressVector (vectorIn_t normal, vectorOut_t small) const
 
void uncompressVector (vectorIn_t small, vectorOut_t normal) const
 
void compressMatrix (matrixIn_t normal, matrixOut_t small, bool rows=true) const
 
void uncompressMatrix (matrixIn_t small, matrixOut_t normal, bool rows=true) const
 
- Public Member Functions inherited from hpp::core::Constraint
bool apply (ConfigurationOut_t configuration)
 
const std::string & name () const
 Get name of constraint. More...
 
virtual ~Constraint ()
 

Static Public Member Functions

static ConstraintSetPtr_t create (const DevicePtr_t &robot, const std::string &name)
 Return shared pointer to new object. More...
 
static ConstraintSetPtr_t createCopy (const ConstraintSetPtr_t &cs)
 Return shared pointer to new object. More...
 

Protected Member Functions

 ConstraintSet (const DevicePtr_t &robot, const std::string &name)
 
 ConstraintSet (const ConstraintSet &other)
 Copy constructor. More...
 
void init (const ConstraintSetPtr_t &self)
 Store weak pointer to itself. More...
 
virtual bool impl_compute (ConfigurationOut_t configuration)
 User defined implementation of the constraint. More...
 
virtual std::ostream & print (std::ostream &os) const
 
- Protected Member Functions inherited from hpp::core::Constraint
 Constraint (const std::string &name)
 Constructor. More...
 
 Constraint (const Constraint &constraint)
 
void init (const ConstraintPtr_t &self)
 Store shared pointer to itself. More...
 

Detailed Description

Set of constraints applicable to a robot configuration

Warning
If the set is to contain a ConfigProjector and several LockedJoint instances, the configProjector should be inserted first since following numerical projections might affect locked degrees of freedom.

Constructor & Destructor Documentation

◆ ConstraintSet() [1/2]

hpp::core::ConstraintSet::ConstraintSet ( const DevicePtr_t robot,
const std::string &  name 
)
protected

◆ ConstraintSet() [2/2]

hpp::core::ConstraintSet::ConstraintSet ( const ConstraintSet other)
protected

Copy constructor.

Member Function Documentation

◆ addConstraint()

void hpp::core::ConstraintSet::addConstraint ( const ConstraintPtr_t constraint)
inline

Add a constraint to the set.

◆ begin()

Constraints_t::iterator hpp::core::ConstraintSet::begin ( )
inline

Iterator over the constraints.

◆ compressMatrix()

void hpp::core::ConstraintSet::compressMatrix ( matrixIn_t  normal,
matrixOut_t  small,
bool  rows = true 
) const

Compress matrix

Parameters
normalinput matrix
Return values
smallcompressed matrix
Parameters
rowswhether to compress rows and colums or only columns

◆ compressVector()

void hpp::core::ConstraintSet::compressVector ( vectorIn_t  normal,
vectorOut_t  small 
) const

Compress Velocity vector by removing locked degrees of freedom

Parameters
normalinput velocity vector
Return values
smallcompressed velocity vectors

◆ configProjector()

ConfigProjectorPtr_t hpp::core::ConstraintSet::configProjector ( ) const

Return pointer to config projector if any.

◆ copy()

virtual ConstraintPtr_t hpp::core::ConstraintSet::copy ( ) const
virtual

return shared pointer to copy

Implements hpp::core::Constraint.

◆ create()

static ConstraintSetPtr_t hpp::core::ConstraintSet::create ( const DevicePtr_t robot,
const std::string &  name 
)
inlinestatic

Return shared pointer to new object.

◆ createCopy()

static ConstraintSetPtr_t hpp::core::ConstraintSet::createCopy ( const ConstraintSetPtr_t cs)
inlinestatic

Return shared pointer to new object.

◆ end()

Constraints_t::iterator hpp::core::ConstraintSet::end ( )
inline

Iterator over the constraints.

◆ impl_compute()

virtual bool hpp::core::ConstraintSet::impl_compute ( ConfigurationOut_t  configuration)
protectedvirtual

User defined implementation of the constraint.

Implements hpp::core::Constraint.

◆ init()

void hpp::core::ConstraintSet::init ( const ConstraintSetPtr_t self)
inlineprotected

Store weak pointer to itself.

◆ isSatisfied() [1/2]

virtual bool hpp::core::ConstraintSet::isSatisfied ( ConfigurationIn_t  config)
virtual

Check whether a configuration statisfies the constraint.

Implements hpp::core::Constraint.

◆ isSatisfied() [2/2]

virtual bool hpp::core::ConstraintSet::isSatisfied ( ConfigurationIn_t  config,
vector_t error 
)
virtual

Check whether a configuration satisfies the constraint.

Parameters
configthe configuration to check
Return values
errorconcatenation of errors of each constraint.

Implements hpp::core::Constraint.

◆ numberNonLockedDof()

size_type hpp::core::ConstraintSet::numberNonLockedDof ( ) const

Get number of non-locked degrees of freedom.

◆ print()

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

Implements hpp::core::Constraint.

◆ uncompressMatrix()

void hpp::core::ConstraintSet::uncompressMatrix ( matrixIn_t  small,
matrixOut_t  normal,
bool  rows = true 
) const

Uncompress matrix

Parameters
smallinput matrix
Return values
normaluncompressed matrix
Parameters
rowswhether to uncompress rows and colums or only columns

◆ uncompressVector()

void hpp::core::ConstraintSet::uncompressVector ( vectorIn_t  small,
vectorOut_t  normal 
) const

Expand compressed velocity vector

Parameters
smallcompressed velocity vector without locked degrees of freedom,
Return values
normaluncompressed velocity vector.
Note
locked degree of freedom are not set. They should be initialized to zero.

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