hpp::core::ConfigProjector Class Reference

Implicit non-linear constraint. More...

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

Inheritance diagram for hpp::core::ConfigProjector:
Collaboration diagram for hpp::core::ConfigProjector:

List of all members.

Public Member Functions

void addFunction (const DifferentiableFunctionPtr_t &function, ComparisonTypePtr_t comp=ComparisonType::createDefault()) HPP_CORE_DEPRECATED
 Add a function.
void addConstraint (const DifferentiableFunctionPtr_t &constraint, ComparisonTypePtr_t comp=ComparisonType::createDefault()) HPP_CORE_DEPRECATED
 Add constraint.
void add (const NumericalConstraintPtr_t &numericalConstraint, const SizeIntervals_t &passiveDofs=SizeIntervals_t(0))
 Add a numerical constraint.
void add (const LockedJointPtr_t &lockedJoint)
 Add a locked joint.
const DevicePtr_trobot () const
 Get robot.
virtual void projectOnKernel (ConfigurationIn_t from, ConfigurationIn_t to, ConfigurationOut_t result)
 Project configuration "to" on constraint tangent space in "from".
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
virtual bool isSatisfied (ConfigurationIn_t config)
 Check whether a configuration statisfies the constraint.
::hpp::statistics::SuccessStatistics & statistics ()
 Get the statistics.
Right hand side of equalities - inequalities
vector_t rightHandSideFromConfig (ConfigurationIn_t config)
 Set the right hand side from a configuration.
void rightHandSide (const vector_t &param)
 Set the level set parameter.
vector_t rightHandSide () const
 Get the level set parameter.
void updateRightHandSide ()
 Regenerate the right hand side from the numerical constraint right hand sides.

Static Public Member Functions

static ConfigProjectorPtr_t create (const DevicePtr_t &robot, const std::string &name, value_type errorThreshold, size_type maxIterations)
 Return shared pointer to new object.

Protected Member Functions

 ConfigProjector (const DevicePtr_t &robot, const std::string &name, value_type errorThreshold, size_type maxIterations)
 Constructor.
void init (const ConfigProjectorPtr_t &self)
 Store weak pointer to itself.
virtual bool impl_compute (ConfigurationOut_t configuration)
 Numerically solve constraint.
void computeLockedDofs (ConfigurationOut_t configuration)
 Set locked degrees of freedom to their locked values.

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. Instances store locked degrees of freedom for performance optimisation.

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


Constructor & Destructor Documentation

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

Constructor.

Parameters:
robotrobot the constraint applies to.
errorThresholdnorm of the value of the constraint under which the constraint is considered satified,
maxIterationsmaximal number of iteration in the resolution of the constraint.

Member Function Documentation

void hpp::core::ConfigProjector::add ( const NumericalConstraintPtr_t numericalConstraint,
const SizeIntervals_t passiveDofs = SizeIntervals_t(0) 
)

Add a numerical constraint.

Parameters:
numericalConstraintThe numerical constraint.
passiveDofscolumn indexes of the jacobian vector that will be set to zero when solving.
Note:
The intervals are interpreted as a list of couple (index_start, length) and NOT as (index_start, index_end).
void hpp::core::ConfigProjector::add ( const LockedJointPtr_t lockedJoint)

Add a locked joint.

Parameters:
lockedJointThe locked joint.
void hpp::core::ConfigProjector::addConstraint ( const DifferentiableFunctionPtr_t constraint,
ComparisonTypePtr_t  comp = ComparisonType::createDefault () 
) [inline]

Add constraint.

Parameters:
constraintThe function.
compFor equality constraint, keep the default value. For inequality constraint, it does a comparison to whether the constraint is active.
Deprecated:
Use hpp::core::ConfigProjector::add (NumericalConstraintPtr_t) instead.

References hpp::core::NumericalConstraint::create().

void hpp::core::ConfigProjector::addFunction ( const DifferentiableFunctionPtr_t function,
ComparisonTypePtr_t  comp = ComparisonType::createDefault() 
) [inline]

Add a function.

Parameters:
functionThe function.
compFor equality constraint, keep the default value. For inequality constraint, it does a comparison to whether the constraint is active.
Deprecated:
Use hpp::core::ConfigProjector::add (NumericalConstraintPtr_t) instead.

References hpp::core::NumericalConstraint::create().

void hpp::core::ConfigProjector::computeLockedDofs ( ConfigurationOut_t  configuration) [protected]

Set locked degrees of freedom to their locked values.

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:
robotrobot the constraint applies to.
errorThresholdnorm of the value of the constraint under which the constraint is considered satified,
maxIterationsmaximal number of iteration in the resolution of the constraint.
void hpp::core::ConfigProjector::errorThreshold ( const value_type threshold) [inline]

Set error threshold.

value_type hpp::core::ConfigProjector::errorThreshold ( ) const [inline]

Get errorimal number of threshold in config projector.

virtual bool hpp::core::ConfigProjector::impl_compute ( ConfigurationOut_t  configuration) [protected, virtual]

Numerically solve constraint.

Implements hpp::core::Constraint.

void hpp::core::ConfigProjector::init ( const ConfigProjectorPtr_t self) [inline, protected]

Store weak pointer to itself.

References hpp::core::Constraint::init().

virtual bool hpp::core::ConfigProjector::isSatisfied ( ConfigurationIn_t  config) [virtual]

Check whether a configuration statisfies the constraint.

Implements hpp::core::Constraint.

void hpp::core::ConfigProjector::maxIterations ( size_type  iterations) [inline]

Set maximal number of iterations.

size_type hpp::core::ConfigProjector::maxIterations ( ) const [inline]

Get maximal number of iterations in config projector.

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:
fromconfiguration,
toconfiguration to project

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

value_type hpp::core::ConfigProjector::residualError ( ) const [inline]
void hpp::core::ConfigProjector::rightHandSide ( const vector_t param)

Set the level set parameter.

Parameters:
paramthe level set parameter.
vector_t hpp::core::ConfigProjector::rightHandSide ( ) const

Get the level set parameter.

Returns:
the parameter.
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:
configthe 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.
const DevicePtr_t& hpp::core::ConfigProjector::robot ( ) const [inline]

Get robot.

::hpp::statistics::SuccessStatistics& hpp::core::ConfigProjector::statistics ( ) [inline]

Get the statistics.

void hpp::core::ConfigProjector::updateRightHandSide ( )

Regenerate the right hand side from the numerical constraint right hand sides.

Note:
Class NumericalConstraint contains a cache for its own RHS. Its value is simply copied in the ConfigProjector RHS. This allow a finer control on the RHS.