hpp::constraints::Implicit Class Reference

This class represents a parameterizable numerical constraint that compares the output of a function \(h\) to a right hand side vector. More...

#include <hpp/constraints/implicit.hh>

Inheritance diagram for hpp::constraints::Implicit:
[legend]

Public Member Functions

bool operator== (const Implicit &other) const
 Operator equality. More...
 
virtual ImplicitPtr_t copy () const
 Copy object and return shared pointer to copy. More...
 
virtual ~Implicit ()
 
DifferentiableFunctionfunction () const
 Return a reference to function \(h\). More...
 
const DifferentiableFunctionPtr_tfunctionPtr () const
 Return a reference to function \(h\). More...
 
Right hand side
void rightHandSideFromConfig (ConfigurationIn_t config)
 Set the right hand side from a configuration. More...
 
void rightHandSide (vectorIn_t rhs)
 Set the right hand side of the equation. More...
 
vectorIn_t rightHandSide () const
 Return the right hand side of the equation. More...
 
size_type rhsSize () const HPP_CONSTRAINTS_DEPRECATED
 Return the dimension of the left hand side function tangent output space. More...
 
size_type parameterSize () const
 Get size of parameter defining the right hand side of the constraint. More...
 
size_type rightHandSideSize () const
 Get size of right hand side of the constraint. More...
 
const ComparisonTypes_tcomparisonType () const
 Return the ComparisonType. More...
 
void comparisonType (const ComparisonTypes_t &comp)
 Set the comparison type. More...
 
bool constantRightHandSide () const HPP_CONSTRAINTS_DEPRECATED
 Whether right hand side is constant. More...
 
vectorOut_t rightHandSide ()
 Return a modifiable reference to right hand side of equation. More...
 
vectorOut_t nonConstRightHandSide () HPP_CONSTRAINTS_DEPRECATED
 Return a modifiable reference to right hand side of equation. More...
 
void rightHandSideFunction (const DifferentiableFunctionPtr_t &rhsF)
 Set time-varying right hand side. More...
 
const DifferentiableFunctionPtr_trightHandSideFunction () const
 Get time-varying right hand side. More...
 
vectorIn_t rightHandSideAt (const value_type &s)
 Evaluate and set right hand side at given time. More...
 

Static Public Member Functions

static ImplicitPtr_t create (const DifferentiableFunctionPtr_t &function)
 Create a shared pointer to a new instance. More...
 
static ImplicitPtr_t create (const DifferentiableFunctionPtr_t &function, ComparisonTypes_t comp)
 Create a shared pointer to a new instance. More...
 
static ImplicitPtr_t create (const DifferentiableFunctionPtr_t &function, ComparisonTypes_t comp, vectorIn_t rhs)
 Create a shared pointer to a new instance. More...
 
static ImplicitPtr_t createCopy (const ImplicitPtr_t &other)
 Create a copy and return shared pointer. More...
 

Protected Member Functions

 Implicit (const DifferentiableFunctionPtr_t &function, ComparisonTypes_t comp)
 Constructor. More...
 
 Implicit (const DifferentiableFunctionPtr_t &function, ComparisonTypes_t comp, vectorIn_t rhs)
 Constructor. More...
 
 Implicit (const Implicit &other)
 Copy constructor. More...
 
virtual bool isEqual (const Implicit &other, bool swapAndTest) const
 Test equality with other instance. More...
 
void init (const ImplicitWkPtr_t &weak)
 

Friends

class ImplicitConstraintSet
 

Detailed Description

This class represents a parameterizable numerical constraint that compares the output of a function \(h\) to a right hand side vector.

Definition
  • The function \(h\) takes input in a configuration space \(\mathcal{C}\) and output in a Lie group \(\mathbf{L}\),
  • the dimensions of \(\mathbf{L}\) and of its tangent space are respectively \((n_q,n_v)\).
  • The comparison is represented by a vector \(\mathbf{c}\) of dimension \(n_v\) with values in enum hpp::contraints::ComparisonType = { \(\mathbf{Equality}\), \(\mathbf{EqualToZero}\), \(\mathbf{Inferior}\), \(\mathbf{Superior}\) }.
  • The right hand side is a vector of dimension \(n_q\).
Error
A configuration \(\mathbf{q}\) is said to satisfy the constraint for a given right hand side if and only if the error \(e\) as computed below is smaller in norm than a given threshold.

Let

\[ \Delta = h (\mathbf{q}) - rhs \in \mathbf{R}^{n_v}, \]

for each component \(i\in\{0,\cdots,n_v-1\}\),

  • if \(c_i\) is \(\mathbf{Inferior}\), \(e_i = \max (0,\Delta_i)\),
  • if \(c_i\) is \(\mathbf{Superior}\), \(e_i = \min (0,\Delta_i)\),
  • if \(c_i\) is \(\mathbf{Equality}\), \(e_i = \Delta_i\),
  • if \(c_i\) is \(\mathbf{EqualToZero}\), \(e_i = \Delta_i\).
Parameterizable right hand side
Lines with {Equality} comparator in the above definition of the error need a parameter, while lines with comparators {Inferior}, {Superior}, or {EqualToZero} do not. As a consequence, the right hand side of the constraint is defined by a vector \(\lambda\) of parameters of size the number of {Equality} occurences in vector \(\mathbf{c}\). The right hand side is then defined as in the following example:

\[ rhs = \exp\left(\begin{array}{c}\lambda_1 \\ 0 \\ 0 \\ \lambda_2 \\ \vdots \end{array}\right) \ \ \ \ \mathbf{c} = \left(\begin{array}{c}\mathbf{Equality} \\ \mathbf{EqualToZero} \\ \mathbf{Inferior} \\ \mathbf{Equality} \\ \vdots \end{array}\right) \]

To retrieve the size of vector \(\lambda\), call method Implicit::parameterSize (). To set and get the right hand side value, use method Implicit::rightHandSide.
Time varying right hand side

The right hand side of the constraint may depend on time, for instance if the constraint is associated to a trajectory following task. In this case, the right hand side is a function from \(\mathbf{R}\) to \(\mathbf{L}\).

To set or get a time varying right hand side, use methods Implicit::rightHandSideFunction, Implicit::rightHandSideFromConfig. To get the value of the right hand side for a given time, use method Implicit::rightHandSideAt.

Constructor & Destructor Documentation

virtual hpp::constraints::Implicit::~Implicit ( )
inlinevirtual
hpp::constraints::Implicit::Implicit ( const DifferentiableFunctionPtr_t function,
ComparisonTypes_t  comp 
)
protected

Constructor.

Parameters
functionthe differentiable function
compvector of comparison \(\mathbf{c}\). size of comp should be equal to size of tangent space to function output space \(\mathbf{L}\).
hpp::constraints::Implicit::Implicit ( const DifferentiableFunctionPtr_t function,
ComparisonTypes_t  comp,
vectorIn_t  rhs 
)
protected

Constructor.

Parameters
functionthe differentiable function,
compvector of comparison \(\mathbf{c}\),
rhsthe right hand side of the equation. size of comp and size of rhs should be equal to size of tangent space to function output space \(\mathbf{L}\).
hpp::constraints::Implicit::Implicit ( const Implicit other)
protected

Copy constructor.

Member Function Documentation

const ComparisonTypes_t& hpp::constraints::Implicit::comparisonType ( ) const

Return the ComparisonType.

void hpp::constraints::Implicit::comparisonType ( const ComparisonTypes_t comp)

Set the comparison type.

bool hpp::constraints::Implicit::constantRightHandSide ( ) const

Whether right hand side is constant.

Deprecated:
use (parameterSize () == 0) instead
virtual ImplicitPtr_t hpp::constraints::Implicit::copy ( ) const
virtual
static ImplicitPtr_t hpp::constraints::Implicit::create ( const DifferentiableFunctionPtr_t function)
static

Create a shared pointer to a new instance.

See also
constructors
static ImplicitPtr_t hpp::constraints::Implicit::create ( const DifferentiableFunctionPtr_t function,
ComparisonTypes_t  comp 
)
static

Create a shared pointer to a new instance.

See also
constructors
static ImplicitPtr_t hpp::constraints::Implicit::create ( const DifferentiableFunctionPtr_t function,
ComparisonTypes_t  comp,
vectorIn_t  rhs 
)
static

Create a shared pointer to a new instance.

See also
constructors
static ImplicitPtr_t hpp::constraints::Implicit::createCopy ( const ImplicitPtr_t other)
static

Create a copy and return shared pointer.

DifferentiableFunction& hpp::constraints::Implicit::function ( ) const
inline

Return a reference to function \(h\).

const DifferentiableFunctionPtr_t& hpp::constraints::Implicit::functionPtr ( ) const
inline

Return a reference to function \(h\).

void hpp::constraints::Implicit::init ( const ImplicitWkPtr_t &  weak)
inlineprotected
virtual bool hpp::constraints::Implicit::isEqual ( const Implicit other,
bool  swapAndTest 
) const
protectedvirtual

Test equality with other instance.

Parameters
otherobject to copy
swapAndTestwhether we should also check other == this

Reimplemented in hpp::constraints::LockedJoint.

vectorOut_t hpp::constraints::Implicit::nonConstRightHandSide ( )

Return a modifiable reference to right hand side of equation.

Deprecated:
use rightHandSide instead.
bool hpp::constraints::Implicit::operator== ( const Implicit other) const
inline

Operator equality.

size_type hpp::constraints::Implicit::parameterSize ( ) const

Get size of parameter defining the right hand side of the constraint.

See class documentation for details.

size_type hpp::constraints::Implicit::rhsSize ( ) const

Return the dimension of the left hand side function tangent output space.

Deprecated:
Use function ()->outputSpace ()->nv () instead.
void hpp::constraints::Implicit::rightHandSide ( vectorIn_t  rhs)

Set the right hand side of the equation.

Parameters
rhsthe right hand side.
vectorIn_t hpp::constraints::Implicit::rightHandSide ( ) const

Return the right hand side of the equation.

vectorOut_t hpp::constraints::Implicit::rightHandSide ( )

Return a modifiable reference to right hand side of equation.

Deprecated:
In future versions, right hand side will not be a member of the class anymore.
vectorIn_t hpp::constraints::Implicit::rightHandSideAt ( const value_type s)

Evaluate and set right hand side at given time.

Parameters
stime
void hpp::constraints::Implicit::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.
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.
void hpp::constraints::Implicit::rightHandSideFunction ( const DifferentiableFunctionPtr_t rhsF)

Set time-varying right hand side.

Parameters
rhsFMapping from \(\mathbf{R}\) to output space \(\mathbf{L}\) of \(h\) defining the variation along time of the right hand side.
const DifferentiableFunctionPtr_t& hpp::constraints::Implicit::rightHandSideFunction ( ) const
inline

Get time-varying right hand side.

Returns
the mapping from \(\mathbf{R}\) to output space \(\mathbf{L}\) of \(h\) defining the variation along time of the right hand side.
size_type hpp::constraints::Implicit::rightHandSideSize ( ) const

Get size of right hand side of the constraint.

This is the dimension (nq) of the output space of the function

Friends And Related Function Documentation

friend class ImplicitConstraintSet
friend