hpp-core: hpp::core::ConfigProjector Class Reference

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

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
hpp::core::ConfigProjector Class Reference
Constraints

`#include <hpp/core/config-projector.hh>`

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

## Public Types
enum | LineSearchType { Backtracking , ErrorNormBased , FixedSequence , Constant }

## Public Member Functions
virtual ConstraintPtr_t | copy () const
| return shared pointer to copy
virtual | ~ConfigProjector ()
| Destructor.
bool | contains (const constraints::ImplicitPtr_t &numericalConstraint) const
bool | add (const constraints::ImplicitPtr_t &numericalConstraint, const std::size_t priority=0)
void | lastIsOptional (bool optional)
bool | lastIsOptional () const
bool | optimize (ConfigurationOut_t config, std::size_t maxIter=0)
const DevicePtr_t & | robot () const
| Get robot.
void | projectVectorOnKernel (ConfigurationIn_t from, vectorIn_t velocity, vectorOut_t result)
virtual void | projectOnKernel (ConfigurationIn_t from, ConfigurationIn_t to, ConfigurationOut_t result)
void | computeValueAndJacobian (ConfigurationIn_t configuration, vectorOut_t value, matrixOut_t reducedJacobian)
void | maxIterations (size_type iterations)
| Set maximal number of iterations.
size_type | maxIterations () const
| Get maximal number of iterations in config projector.
void | errorThreshold (const value_type &threshold)
| Set error threshold.
value_type | errorThreshold () const
| Get errorimal number of threshold in config projector.
value_type | residualError () const
const value_type & | sigma () const
virtual bool | isSatisfied (ConfigurationIn_t config)
virtual bool | isSatisfied (ConfigurationIn_t config, value_type errorThreshold)
virtual bool | isSatisfied (ConfigurationIn_t config, vector_t &error)
::hpp::statistics::SuccessStatistics & | statistics ()
| Get the statistics.
const NumericalConstraints_t & | numericalConstraints () const
const BySubstitution & | solver () const
BySubstitution & | solver ()
void | lineSearchType (LineSearchType ls)
| Set the line search type.
LineSearchType | lineSearchType () const
| Get the line search type.
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 | numberFreeVariables () const
| Return the number of free variables.
size_type | dimension () const
| Get constraint dimension.
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
Right hand side of equalities - inequalities
vector_t | rightHandSideFromConfig (ConfigurationIn_t config)
void | rightHandSideFromConfig (const constraints::ImplicitPtr_t &nm, ConfigurationIn_t config)
void | rightHandSide (const vector_t &param)
void | rightHandSide (const constraints::ImplicitPtr_t &nm, vectorIn_t rhs)
vector_t | rightHandSide () const
void | rightHandSideAt (const value_type &s)
| Update the right hand side using Implicit::rightHandSideAt.
Public Member Functions inherited from hpp::core::Constraint
bool | apply (ConfigurationOut_t configuration)
const std::string & | name () const
| Get name of constraint.
virtual | ~Constraint ()

## Static Public Member Functions
static ConfigProjectorPtr_t | create (const DevicePtr_t &robot, const std::string &name, value_type errorThreshold, size_type maxIterations)
static ConfigProjectorPtr_t | createCopy (const ConfigProjectorPtr_t cp)
static void | defaultLineSearch (LineSearchType ls)

## Protected Member Functions
| ConfigProjector (const DevicePtr_t &robot, const std::string &name, value_type errorThreshold, size_type maxIterations)
| ConfigProjector (const ConfigProjector &cp)
| Copy constructor.
void | init (const ConfigProjectorPtr_t &self)
| Store weak pointer to itself.
virtual bool | impl_compute (ConfigurationOut_t configuration)
| Numerically solve constraint.
Protected Member Functions inherited from hpp::core::Constraint
| Constraint (const std::string &name)
| Constructor.
| Constraint (const Constraint &constraint)
void | init (const ConstraintPtr_t &self)
| Store shared pointer to itself.

## Detailed Description

Implicit non-linear constraint

This class defines a numerical constraints on a robot configuration of the form:

\begin{eqnarray*} f_1 (\mathbf{q}) & = \mbox{or} \leq & f_1^0 \\ & \vdots\\ f_m (\mathbf{q}) & = \mbox{or} \leq & f_m^0 \end{eqnarray*}

Functions \(f_i\) are differentiable functions. Vectors \(f_i^0\) are called right hand side.

The constraints are solved numerically by a Newton Raphson like method.

Numerical constraints can be added using method ConfigProjector::add. Default parameter of this method define equality constraints, but inequality constraints can also be defined by passing an object of type ComparisonType to method.

## Member Enumeration Documentation

## ◆ LineSearchType

enum hpp::core::ConfigProjector::LineSearchType

Enumerator
Backtracking |
ErrorNormBased |
FixedSequence |
Constant |

## Constructor & Destructor Documentation

## ◆ ~ConfigProjector()

virtual hpp::core::ConfigProjector::~ConfigProjector | ( |  | ) |
| virtual

Destructor.

## ◆ ConfigProjector() [1/2]

hpp::core::ConfigProjector::ConfigProjector | ( | const DevicePtr_t & | robot,
|  | const std::string & | name,
|  | value_type | errorThreshold,
|  | size_type | maxIterations
| ) |  |
| protected

Constructor

Parameters

  robot | robot the constraint applies to.
  errorThreshold | norm of the value of the constraint under which the constraint is considered satified,
  maxIterations | maximal number of iteration in the resolution of the constraint.

## ◆ ConfigProjector() [2/2]

hpp::core::ConfigProjector::ConfigProjector | ( | const ConfigProjector & | cp | ) |
| protected

Copy constructor.

## Member Function Documentation

## ◆ add()

bool hpp::core::ConfigProjector::add | ( | const constraints::ImplicitPtr_t & | numericalConstraint,
|  | const std::size_t | priority = `0`
| ) |  |

Add a numerical constraint

Note
  The intervals are interpreted as a list of couple (index_start, length) and NOT as (index_start, index_end).

Parameters

  numericalConstraint | The numerical constraint.
  priority | priority of the function. The last level might be optional.

Returns
  false if numerical constraint had already been inserted.

## ◆ compressMatrix()

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

Compress matrix

Parameters

  normal | input matrix

Return values

  small | compressed matrix

Parameters

  rows | whether to compress rows and colums or only columns

## ◆ compressVector()

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

Compress Velocity vector by removing output of explicit constraints

Parameters

  normal | input velocity vector

Return values

  small | compressed velocity vectors

## ◆ computeValueAndJacobian()

void hpp::core::ConfigProjector::computeValueAndJacobian | ( | ConfigurationIn_t | configuration,
|  | vectorOut_t | value,
|  | matrixOut_t | reducedJacobian
| ) |  |

Compute value and reduced jacobian at a given configuration

Parameters

  configuration | input configuration

Return values

  value | values of the differentiable functions stacked in a vector,
  reducedJacobian | Reduced Jacobian of the differentiable functions stacked in a matrix. Reduced Jacobian is defined as the Jacobian to which columns corresponding to explicit constraints have been removed and to which columns corresponding to passive dofs are set to 0.

## ◆ contains()

bool hpp::core::ConfigProjector::contains | ( | const constraints::ImplicitPtr_t & | numericalConstraint | ) | const

Check that numerical constraint is in config projector

Parameters

  numericalConstraint | numerical constraint

Returns
  true if numerical constraint is already in config projector whatever the passive dofs are.

## ◆ copy()

virtual ConstraintPtr_t hpp::core::ConfigProjector::copy | ( |  | ) | const
| virtual

return shared pointer to copy

Implements hpp::core::Constraint.

## ◆ create()

static ConfigProjectorPtr_t hpp::core::ConfigProjector::create | ( | const DevicePtr_t & | robot,
|  | const std::string & | name,
|  | value_type | errorThreshold,
|  | size_type | maxIterations
| ) |  |
| static

Return shared pointer to new object

Parameters

  robot | robot the constraint applies to.
  errorThreshold | norm of the value of the constraint under which the constraint is considered satified,
  maxIterations | maximal number of iteration in the resolution of the constraint.

## ◆ createCopy()

static ConfigProjectorPtr_t hpp::core::ConfigProjector::createCopy | ( | const ConfigProjectorPtr_t | cp | ) |
| static

Return shared pointer to copy

Parameters

  cp | shared pointer to object to copy

## ◆ defaultLineSearch()

static void hpp::core::ConfigProjector::defaultLineSearch | ( | LineSearchType | ls | ) |
| static

## ◆ dimension()

size_type hpp::core::ConfigProjector::dimension | ( |  | ) | const

Get constraint dimension.

## ◆ errorThreshold() [1/2]

value_type hpp::core::ConfigProjector::errorThreshold | ( |  | ) | const

Get errorimal number of threshold in config projector.

## ◆ errorThreshold() [2/2]

void hpp::core::ConfigProjector::errorThreshold | ( | const value_type & | threshold | ) |

Set error threshold.

## ◆ impl_compute()

virtual bool hpp::core::ConfigProjector::impl_compute | ( | ConfigurationOut_t | configuration | ) |
| protectedvirtual

Numerically solve constraint.

Implements hpp::core::Constraint.

## ◆ init()

void hpp::core::ConfigProjector::init | ( | const ConfigProjectorPtr_t & | self | ) |
| inlineprotected

Store weak pointer to itself.

## ◆ isSatisfied() [1/3]

virtual bool hpp::core::ConfigProjector::isSatisfied | ( | ConfigurationIn_t | config | ) |
| virtual

Check whether a configuration statisfies the constraint.

Parameters

  config | the configuration to test,

Implements hpp::core::Constraint.

## ◆ isSatisfied() [2/3]

virtual bool hpp::core::ConfigProjector::isSatisfied | ( | ConfigurationIn_t | config,
|  | value_type | errorThreshold
| ) |  |
| virtual

Check whether a configuration statisfies the constraint.

Parameters

  config | the configuration to test,
  errorThreshold | the threshold the norm of each constraint should stay below.

## ◆ isSatisfied() [3/3]

virtual bool hpp::core::ConfigProjector::isSatisfied | ( | ConfigurationIn_t | config,
|  | vector_t & | error
| ) |  |
| virtual

Check whether a configuration statisfies the constraint.

Parameters

  config | the configuration to check

Return values

  error | concatenation of differences between value of numerical constraints and right hand side.

Implements hpp::core::Constraint.

## ◆ lastIsOptional() [1/2]

bool hpp::core::ConfigProjector::lastIsOptional | ( |  | ) | const

## ◆ lastIsOptional() [2/2]

void hpp::core::ConfigProjector::lastIsOptional | ( | bool | optional | ) |

## ◆ lineSearchType() [1/2]

LineSearchType hpp::core::ConfigProjector::lineSearchType | ( |  | ) | const
| inline

Get the line search type.

## ◆ lineSearchType() [2/2]

void hpp::core::ConfigProjector::lineSearchType | ( | LineSearchType | ls | ) |
| inline

Set the line search type.

## ◆ maxIterations() [1/2]

size_type hpp::core::ConfigProjector::maxIterations | ( |  | ) | const

Get maximal number of iterations in config projector.

## ◆ maxIterations() [2/2]

void hpp::core::ConfigProjector::maxIterations | ( | size_type | iterations | ) |

Set maximal number of iterations.

## ◆ numberFreeVariables()

size_type hpp::core::ConfigProjector::numberFreeVariables | ( |  | ) | const

Return the number of free variables.

## ◆ numericalConstraints()

const NumericalConstraints_t & hpp::core::ConfigProjector::numericalConstraints | ( |  | ) | const

Get the numerical constraints of the config-projector (and so of the Constraint Set)

## ◆ optimize()

bool hpp::core::ConfigProjector::optimize | ( | ConfigurationOut_t | config,
|  | std::size_t | maxIter = `0`
| ) |  |

Optimize the configuration while respecting the constraints The input configuration must already satisfy the constraints.

Returns
  true if the configuration was optimized.

Parameters

  maxIter | if 0, use maxIterations().

## ◆ projectOnKernel()

virtual void hpp::core::ConfigProjector::projectOnKernel | ( | ConfigurationIn_t | from,
|  | ConfigurationIn_t | to,
|  | ConfigurationOut_t | result
| ) |  |
| virtual

Project configuration "to" on constraint tangent space in "from"

Parameters

  from | configuration,
  to | configuration to project

\[ \textbf{q}_{res} = \textbf{q}_{from} + \left(I_n - J^{+}J(\textbf{q}_{from})\right) (\textbf{q}_{to} - \textbf{q}_{from}) \]

## ◆ projectVectorOnKernel()

void hpp::core::ConfigProjector::projectVectorOnKernel | ( | ConfigurationIn_t | from,
|  | vectorIn_t | velocity,
|  | vectorOut_t | result
| ) |  |

Project velocity on constraint tangent space in "from"

Parameters

  from | configuration,
  velocity | velocity to project

\[ \textbf{q}_{res} = \left(I_n - J^{+}J(\textbf{q}_{from})\right) (\textbf{v}) \]

## ◆ residualError()

value_type hpp::core::ConfigProjector::residualError | ( |  | ) | const

## ◆ rightHandSide() [1/3]

vector_t hpp::core::ConfigProjector::rightHandSide | ( |  | ) | const

Get the level set parameter.

Returns
  the parameter.

## ◆ rightHandSide() [2/3]

void hpp::core::ConfigProjector::rightHandSide | ( | const constraints::ImplicitPtr_t & | nm,
|  | vectorIn_t | rhs
| ) |  |

Same as rightHandSide(vectorIn_t) but only for the specified constraints::Implicit

## ◆ rightHandSide() [3/3]

void hpp::core::ConfigProjector::rightHandSide | ( | const vector_t & | param | ) |

Set the level set parameter.

Parameters

  param | the level set parameter.

## ◆ rightHandSideAt()

void hpp::core::ConfigProjector::rightHandSideAt | ( | const value_type & | s | ) |

Update the right hand side using Implicit::rightHandSideAt.

## ◆ rightHandSideFromConfig() [1/2]

vector_t hpp::core::ConfigProjector::rightHandSideFromConfig | ( | ConfigurationIn_t | config | ) |

Set the right hand side from a configuration

in such a way that the configuration satisfies the numerical constraints

Parameters

  config | the input configuration.

Returns
  the right hand side

Warning
  Only values of the right hand side corresponding to "equality constraints" are set. As a result, the input configuration may not satisfy the other constraints. The rationale is the following. Equality constraints define a foliation of the configuration space. Leaves of the foliation are defined by the value of the right hand side of the equality constraints. This method is mainly used in manipulation planning to retrieve the leaf a configuration lies on.

## ◆ rightHandSideFromConfig() [2/2]

void hpp::core::ConfigProjector::rightHandSideFromConfig | ( | const constraints::ImplicitPtr_t & | nm,
|  | ConfigurationIn_t | config
| ) |  |

Same as rightHandSideFromConfig(ConfigurationIn_t) but only for the specified constraints::Implicit

## ◆ robot()

const DevicePtr_t & hpp::core::ConfigProjector::robot | ( |  | ) | const
| inline

Get robot.

## ◆ sigma()

const value_type & hpp::core::ConfigProjector::sigma | ( |  | ) | const

## ◆ solver() [1/2]

BySubstitution & hpp::core::ConfigProjector::solver | ( |  | ) |
| inline

## ◆ solver() [2/2]

const BySubstitution & hpp::core::ConfigProjector::solver | ( |  | ) | const
| inline

## ◆ statistics()

::hpp::statistics::SuccessStatistics & hpp::core::ConfigProjector::statistics | ( |  | ) |
| inline

Get the statistics.

## ◆ uncompressMatrix()

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

Uncompress matrix

Parameters

  small | input matrix

Return values

  normal | uncompressed matrix

Parameters

  rows | whether to uncompress rows and colums or only columns

## ◆ uncompressVector()

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

Expand compressed velocity vector

Parameters

  small | compressed velocity vector without output of explicit constraints

Return values

  normal | uncompressed velocity vector.

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

- include/hpp/core/config-projector.hh