hpp-constraints: hpp::constraints::DifferentiableFunction Class Reference

hpp-constraints 9.0.2 Definition of basic geometric constraints for motion planning

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
hpp::constraints::DifferentiableFunction Class Referenceabstract
Constraints

`#include <hpp/constraints/differentiable-function.hh>`

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

## Public Member Functions
virtual | ~DifferentiableFunction ()
LiegroupElement | operator() (vectorIn_t argument) const
void | value (LiegroupElementRef result, vectorIn_t argument) const
void | jacobian (matrixOut_t jacobian, vectorIn_t argument) const
const ArrayXb & | activeParameters () const
const ArrayXb & | activeDerivativeParameters () const
size_type | inputSize () const
| Get dimension of input vector.
size_type | inputDerivativeSize () const
LiegroupSpacePtr_t | outputSpace () const
| Get output space.
size_type | outputSize () const
| Get dimension of output vector.
size_type | outputDerivativeSize () const
| Get dimension of output derivative vector.
const std::string & | name () const
| Get function name.
virtual std::ostream & | print (std::ostream &o) const
| Display object in a stream.
std::string | context () const
void | context (const std::string &c)
void | finiteDifferenceForward (matrixOut_t jacobian, vectorIn_t arg, DevicePtr_t robot=DevicePtr_t(), value_type eps=std::sqrt(Eigen::NumTraits< value_type >::epsilon())) const
void | finiteDifferenceCentral (matrixOut_t jacobian, vectorIn_t arg, DevicePtr_t robot=DevicePtr_t(), value_type eps=std::sqrt(Eigen::NumTraits< value_type >::epsilon())) const
bool | operator== (DifferentiableFunction const &other) const
bool | operator!= (DifferentiableFunction const &b) const
virtual std::pair< JointConstPtr_t, JointConstPtr_t > | dependsOnRelPoseBetween (DeviceConstPtr_t) const

## Static Public Member Functions
static DifferentiableFunctionPtr_t | extract (DifferentiableFunctionPtr_t original, interval_t interval)

## Protected Member Functions
| DifferentiableFunction (size_type sizeInput, size_type sizeInputDerivative, size_type sizeOutput, std::string name=std::string())
| Concrete class constructor should call this constructor.
| DifferentiableFunction (size_type sizeInput, size_type sizeInputDerivative, const LiegroupSpacePtr_t &outputSpace, std::string name=std::string())
| Concrete class constructor should call this constructor.
virtual void | impl_compute (LiegroupElementRef result, vectorIn_t argument) const =0
| User implementation of function evaluation.
virtual void | impl_jacobian (matrixOut_t jacobian, vectorIn_t arg) const =0
virtual bool | isEqual (const DifferentiableFunction &other) const
| DifferentiableFunction ()

## Protected Attributes
size_type | inputSize_
| Dimension of input vector.
size_type | inputDerivativeSize_
| Dimension of input derivative.
LiegroupSpacePtr_t | outputSpace_
| Dimension of output vector.
ArrayXb | activeParameters_
ArrayXb | activeDerivativeParameters_

## Friends
class | DifferentiableFunctionSet

## Detailed Description

Differentiable function from a Lie group, for instance the configuration space of a robot (hpp::pinocchio::Device) to a another Lie group.

Note that the input Lie group is only represented by the sizes of the elements and of the velocities: methods inputSize and inputDerivativeSize

The output space can be accessed by method outputSpace.

The value of the function for a given input can be accessed by method value . The Jacobian of the function for a given input can be accessed by method jacobian .

## Constructor & Destructor Documentation

## ◆ ~DifferentiableFunction()

virtual hpp::constraints::DifferentiableFunction::~DifferentiableFunction | ( |  | ) |
| inline virtual

## ◆ DifferentiableFunction() [1/3]

hpp::constraints::DifferentiableFunction::DifferentiableFunction | ( | size_type | sizeInput,
|  | size_type | sizeInputDerivative,
|  | size_type | sizeOutput,
|  | std::string | name = std::string() )
| protected

Concrete class constructor should call this constructor.

Parameters

  sizeInput | dimension of the function input
  sizeInputDerivative | dimension of the function input derivative,
  sizeOutput | dimension of the output,
  name | function's name

## ◆ DifferentiableFunction() [2/3]

hpp::constraints::DifferentiableFunction::DifferentiableFunction | ( | size_type | sizeInput,
|  | size_type | sizeInputDerivative,
|  | const LiegroupSpacePtr_t & | outputSpace,
|  | std::string | name = std::string() )
| protected

Concrete class constructor should call this constructor.

Parameters

  sizeInput | dimension of the function input
  sizeInputDerivative | dimension of the function input derivative,
  outputSpace | output space of the function.
  name | function name

## ◆ DifferentiableFunction() [3/3]

hpp::constraints::DifferentiableFunction::DifferentiableFunction | ( |  | ) |
| inline protected

## Member Function Documentation

## ◆ activeDerivativeParameters()

const ArrayXb & hpp::constraints::DifferentiableFunction::activeDerivativeParameters | ( |  | ) | const
| inline

Returns a vector of booleans that indicates whether the corresponding velocity parameter influences this constraints.

## ◆ activeParameters()

const ArrayXb & hpp::constraints::DifferentiableFunction::activeParameters | ( |  | ) | const
| inline

Returns a vector of booleans that indicates whether the corresponding configuration parameter influences this constraints.

## ◆ context() [1/2]

std::string hpp::constraints::DifferentiableFunction::context | ( |  | ) | const
| inline

## ◆ context() [2/2]

void hpp::constraints::DifferentiableFunction::context | ( | const std::string & | c | ) |
| inline

## ◆ dependsOnRelPoseBetween()

virtual std::pair< JointConstPtr_t, JointConstPtr_t > hpp::constraints::DifferentiableFunction::dependsOnRelPoseBetween | ( | DeviceConstPtr_t |  | ) | const
| inline virtual

Return pair of joints the relative pose between which modifies the function value if any

This method is useful to know whether an instance of Implicit constrains the relative pose between two joints.

Returns
  the pair of joints involved, arranged in order of increasing joint index, or a pair of empty shared pointers.

Note
  - if absolute pose (relative pose with respect to "universe"), "universe" is returned as empty shared pointer
  - child class reimplementing this may require a valid "robot" argument, which the constraints are applied on.

Reimplemented in hpp::constraints::explicit_::ImplicitFunction, hpp::constraints::ConvexShapeContact, hpp::constraints::ConvexShapeContactComplement, hpp::constraints::ConvexShapeContactHold, hpp::constraints::explicit_::RelativeTransformation, and hpp::constraints::GenericTransformation< _Options >.

## ◆ extract()

static DifferentiableFunctionPtr_t hpp::constraints::DifferentiableFunction::extract | ( | DifferentiableFunctionPtr_t | original,
|  | interval_t | interval )
| static

Return a function defined over a subinterval

The function on which this method is called should be defined over a vector space of dimension 1. The output function is the same function defined over a subinterval provided as input.

The input function is assumed to be defined over an interval . Let be the interval provided as input. The output function is defined on interval by:

## ◆ finiteDifferenceCentral()

void hpp::constraints::DifferentiableFunction::finiteDifferenceCentral | ( | matrixOut_t | jacobian,
|  | vectorIn_t | arg,
|  | DevicePtr_t | robot = DevicePtr_t(),
|  | value_type | eps = std::sqrt(Eigen::NumTraits< value_type >::epsilon()) ) const

Approximate the jacobian using forward finite difference.

Return values

  jacobian | jacobian will be stored in this argument

Parameters

  arg | point at which the jacobian will be computed
  robot | use to add configuration and velocities. If set to NULL, the configuration space is considered a vector space.
  eps | refers to in http://en.wikipedia.org/wiki/Numerical_differentiation Evaluate the function 2*x.size() times but more precise the finiteDifferenceForward

## ◆ finiteDifferenceForward()

void hpp::constraints::DifferentiableFunction::finiteDifferenceForward | ( | matrixOut_t | jacobian,
|  | vectorIn_t | arg,
|  | DevicePtr_t | robot = DevicePtr_t(),
|  | value_type | eps = std::sqrt(Eigen::NumTraits< value_type >::epsilon()) ) const

Approximate the jacobian using forward finite difference.

Return values

  jacobian | jacobian will be stored in this argument

Parameters

  arg | point at which the jacobian will be computed
  robot | use to add configuration and velocities. If set to NULL, the configuration space is considered a vector space.
  eps | refers to in http://en.wikipedia.org/wiki/Numerical_differentiation Evaluate the function (x.size() + 1) times but less precise the finiteDifferenceCentral

## ◆ impl_compute()

virtual void hpp::constraints::DifferentiableFunction::impl_compute | ( | LiegroupElementRef | result,
|  | vectorIn_t | argument ) const
| protected pure virtual

User implementation of function evaluation.

Implemented in hpp::constraints::ConstantFunction, hpp::constraints::ActiveSetDifferentiableFunction, hpp::constraints::ConvexShapeContactHold, hpp::constraints::explicit_::ImplicitFunction, hpp::constraints::explicit_::RelativeTransformation, hpp::constraints::Manipulability, hpp::constraints::MinManipulability, hpp::constraints::Identity, hpp::constraints::function::Difference, and hpp::constraints::function::OfParameterSubset.

## ◆ impl_jacobian()

virtual void hpp::constraints::DifferentiableFunction::impl_jacobian | ( | matrixOut_t | jacobian,
|  | vectorIn_t | arg ) const
| protected pure virtual

Implemented in hpp::constraints::function::Difference, hpp::constraints::function::OfParameterSubset, hpp::constraints::Identity, hpp::constraints::ConstantFunction, hpp::constraints::ActiveSetDifferentiableFunction, hpp::constraints::ConvexShapeContactHold, hpp::constraints::explicit_::ImplicitFunction, hpp::constraints::explicit_::RelativeTransformation, hpp::constraints::Manipulability, and hpp::constraints::MinManipulability.

## ◆ inputDerivativeSize()

size_type hpp::constraints::DifferentiableFunction::inputDerivativeSize | ( |  | ) | const
| inline

Get dimension of input derivative vector

The dimension of configuration vectors might differ from the dimension of velocity vectors since some joints are represented by non minimal size vectors: e.g. quaternion for SO(3)

## ◆ inputSize()

size_type hpp::constraints::DifferentiableFunction::inputSize | ( |  | ) | const
| inline

Get dimension of input vector.

## ◆ isEqual()

virtual bool hpp::constraints::DifferentiableFunction::isEqual | ( | const DifferentiableFunction & | other | ) | const
| inline protected virtual

Reimplemented in hpp::constraints::ActiveSetDifferentiableFunction, hpp::constraints::Identity, hpp::constraints::AffineFunction, hpp::constraints::ConstantFunction, hpp::constraints::ComBetweenFeet, hpp::constraints::ConfigurationConstraint, hpp::constraints::ConvexShapeContact, hpp::constraints::ConvexShapeContactComplement, hpp::constraints::ConvexShapeContactHold, hpp::constraints::DifferentiableFunctionSet, hpp::constraints::DistanceBetweenBodies, hpp::constraints::DistanceBetweenPointsInBodies, hpp::constraints::explicit_::ImplicitFunction, hpp::constraints::explicit_::RelativeTransformation, hpp::constraints::function::Difference, hpp::constraints::function::OfParameterSubset, hpp::constraints::GenericTransformation< _Options >, hpp::constraints::Manipulability, hpp::constraints::MinManipulability, hpp::constraints::QPStaticStability, hpp::constraints::RelativeCom, hpp::constraints::StaticStability, and hpp::constraints::SymbolicFunction< Expression >.

## ◆ jacobian()

void hpp::constraints::DifferentiableFunction::jacobian | ( | matrixOut_t | jacobian,
|  | vectorIn_t | argument ) const
| inline

Computes the jacobian.

Return values

  jacobian | jacobian will be stored in this argument

Parameters

  argument | point at which the jacobian will be computed

## ◆ name()

const std::string & hpp::constraints::DifferentiableFunction::name | ( |  | ) | const
| inline

Get function name.

Returns
  Function name.

## ◆ operator!=()

bool hpp::constraints::DifferentiableFunction::operator!= | ( | DifferentiableFunction const & | b | ) | const

## ◆ operator()()

LiegroupElement hpp::constraints::DifferentiableFunction::operator() | ( | vectorIn_t | argument | ) | const
| inline

Evaluate the function at a given parameter.

Note
  parameters should be of the correct size.

## ◆ operator==()

bool hpp::constraints::DifferentiableFunction::operator== | ( | DifferentiableFunction const & | other | ) | const

## ◆ outputDerivativeSize()

size_type hpp::constraints::DifferentiableFunction::outputDerivativeSize | ( |  | ) | const
| inline

Get dimension of output derivative vector.

## ◆ outputSize()

size_type hpp::constraints::DifferentiableFunction::outputSize | ( |  | ) | const
| inline

Get dimension of output vector.

## ◆ outputSpace()

LiegroupSpacePtr_t hpp::constraints::DifferentiableFunction::outputSpace | ( |  | ) | const
| inline

Get output space.

## ◆ print()

virtual std::ostream & hpp::constraints::DifferentiableFunction::print | ( | std::ostream & | o | ) | const
| virtual

Display object in a stream.

Reimplemented in hpp::constraints::ConfigurationConstraint, hpp::constraints::ConvexShapeContact, hpp::constraints::GenericTransformation< _Options >, hpp::constraints::RelativeCom, hpp::constraints::DifferentiableFunctionSet, hpp::constraints::function::Difference, and hpp::constraints::function::OfParameterSubset.

## ◆ value()

void hpp::constraints::DifferentiableFunction::value | ( | LiegroupElementRef | result,
|  | vectorIn_t | argument ) const
| inline

Evaluate the function at a given parameter.

Note
  parameters should be of the correct size.

## Friends And Related Symbol Documentation

## ◆ DifferentiableFunctionSet

friend class DifferentiableFunctionSet
| friend

## Member Data Documentation

## ◆ activeDerivativeParameters_

ArrayXb hpp::constraints::DifferentiableFunction::activeDerivativeParameters_
| protected

Initialized to true by this class. Child class are responsible for updating it.

See also
  activeDerivativeParameters

## ◆ activeParameters_

ArrayXb hpp::constraints::DifferentiableFunction::activeParameters_
| protected

Initialized to true by this class. Child class are responsible for updating it.

See also
  activeParameters

## ◆ inputDerivativeSize_

size_type hpp::constraints::DifferentiableFunction::inputDerivativeSize_
| protected

Dimension of input derivative.

## ◆ inputSize_

size_type hpp::constraints::DifferentiableFunction::inputSize_
| protected

Dimension of input vector.

## ◆ outputSpace_

LiegroupSpacePtr_t hpp::constraints::DifferentiableFunction::outputSpace_
| protected

Dimension of output vector.

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

- include/hpp/constraints/differentiable-function.hh