Implicit non-linear constraint. More...
#include <hpp/core/config-projector.hh>
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_t & | robot () 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 ¶m) |
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. |
Implicit non-linear constraint.
This class defines a numerical constraints on a robot configuration of the form:
Functions are differentiable functions. Vectors
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.
hpp::core::ConfigProjector::ConfigProjector | ( | const DevicePtr_t & | robot, |
const std::string & | name, | ||
value_type | errorThreshold, | ||
size_type | maxIterations | ||
) | [protected] |
Constructor.
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. |
void hpp::core::ConfigProjector::add | ( | const NumericalConstraintPtr_t & | numericalConstraint, |
const SizeIntervals_t & | passiveDofs = SizeIntervals_t(0) |
||
) |
Add a numerical constraint.
numericalConstraint | The numerical constraint. |
passiveDofs | column indexes of the jacobian vector that will be set to zero when solving. |
void hpp::core::ConfigProjector::add | ( | const LockedJointPtr_t & | lockedJoint | ) |
Add a locked joint.
lockedJoint | The locked joint. |
void hpp::core::ConfigProjector::addConstraint | ( | const DifferentiableFunctionPtr_t & | constraint, |
ComparisonTypePtr_t | comp = ComparisonType::createDefault () |
||
) | [inline] |
Add constraint.
constraint | The function. |
comp | For equality constraint, keep the default value. For inequality constraint, it does a comparison to whether the constraint is active. |
References hpp::core::NumericalConstraint::create().
void hpp::core::ConfigProjector::addFunction | ( | const DifferentiableFunctionPtr_t & | function, |
ComparisonTypePtr_t | comp = ComparisonType::createDefault() |
||
) | [inline] |
Add a function.
function | The function. |
comp | For equality constraint, keep the default value. For inequality constraint, it does a comparison to whether the constraint is active. |
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.
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. |
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".
from | configuration, |
to | configuration to project |
value_type hpp::core::ConfigProjector::residualError | ( | ) | const [inline] |
void hpp::core::ConfigProjector::rightHandSide | ( | const vector_t & | param | ) |
Set the level set parameter.
param | the level set parameter. |
vector_t hpp::core::ConfigProjector::rightHandSide | ( | ) | const |
Get the level set 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
config | the input configuration. |
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.