hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
hpp::constraints::Implicit Class Reference

#include <hpp/constraints/implicit.hh>

Inheritance diagram for hpp::constraints::Implicit:

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)
 
void rightHandSide (vectorIn_t rhs)
 
vectorIn_t rightHandSide () const
 Return the right hand side of the equation. More...
 
size_type rhsSize () const HPP_CONSTRAINTS_DEPRECATED
 
size_type parameterSize () const
 
size_type rightHandSideSize () const
 
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
 
vectorOut_t rightHandSide ()
 
vectorOut_t nonConstRightHandSide () HPP_CONSTRAINTS_DEPRECATED
 
void rightHandSideFunction (const DifferentiableFunctionPtr_t &rhsF)
 
const DifferentiableFunctionPtr_trightHandSideFunction () const
 
vectorIn_t rightHandSideAt (const value_type &s)
 

Static Public Member Functions

static ImplicitPtr_t create (const DifferentiableFunctionPtr_t &function)
 
static ImplicitPtr_t create (const DifferentiableFunctionPtr_t &function, ComparisonTypes_t comp)
 
static ImplicitPtr_t create (const DifferentiableFunctionPtr_t &function, ComparisonTypes_t comp, vectorIn_t rhs)
 
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)
 
 Implicit (const DifferentiableFunctionPtr_t &function, ComparisonTypes_t comp, vectorIn_t rhs)
 
 Implicit (const Implicit &other)
 Copy constructor. More...
 
virtual bool isEqual (const Implicit &other, bool swapAndTest) const
 
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

◆ ~Implicit()

virtual hpp::constraints::Implicit::~Implicit ( )
inlinevirtual

◆ Implicit() [1/3]

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}\).

◆ Implicit() [2/3]

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}\).

◆ Implicit() [3/3]

hpp::constraints::Implicit::Implicit ( const Implicit other)
protected

Copy constructor.

Member Function Documentation

◆ comparisonType() [1/2]

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

Return the ComparisonType.

◆ comparisonType() [2/2]

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

Set the comparison type.

◆ constantRightHandSide()

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

Whether right hand side is constant

Deprecated:
use (parameterSize () == 0) instead

◆ copy()

virtual ImplicitPtr_t hpp::constraints::Implicit::copy ( ) const
virtual

◆ create() [1/3]

static ImplicitPtr_t hpp::constraints::Implicit::create ( const DifferentiableFunctionPtr_t function)
static

Create a shared pointer to a new instance.

See also
constructors

◆ create() [2/3]

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

◆ create() [3/3]

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

◆ createCopy()

static ImplicitPtr_t hpp::constraints::Implicit::createCopy ( const ImplicitPtr_t other)
static

Create a copy and return shared pointer.

◆ function()

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

Return a reference to function \(h\).

◆ functionPtr()

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

Return a reference to function \(h\).

◆ init()

void hpp::constraints::Implicit::init ( const ImplicitWkPtr_t &  weak)
inlineprotected

◆ isEqual()

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.

◆ nonConstRightHandSide()

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

Return a modifiable reference to right hand side of equation.

Deprecated:
use rightHandSide instead.

◆ operator==()

bool hpp::constraints::Implicit::operator== ( const Implicit other) const
inline

Operator equality.

◆ parameterSize()

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

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

See class documentation for details.

◆ rhsSize()

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.

◆ rightHandSide() [1/3]

void hpp::constraints::Implicit::rightHandSide ( vectorIn_t  rhs)

Set the right hand side of the equation.

Parameters
rhsthe right hand side.

◆ rightHandSide() [2/3]

vectorIn_t hpp::constraints::Implicit::rightHandSide ( ) const

Return the right hand side of the equation.

◆ rightHandSide() [3/3]

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.

◆ rightHandSideAt()

vectorIn_t hpp::constraints::Implicit::rightHandSideAt ( const value_type s)

Evaluate and set right hand side at given time

Parameters
stime

◆ rightHandSideFromConfig()

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.

◆ rightHandSideFunction() [1/2]

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.

◆ rightHandSideFunction() [2/2]

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.

◆ rightHandSideSize()

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

◆ ImplicitConstraintSet

friend class ImplicitConstraintSet
friend

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