DART  6.7.3
dart::dynamics::HierarchicalIK::Constraint Class Referencefinal

The HierarchicalIK::Constraint Function is simply used to merge the constraints of the InverseKinematics modules that belong to the hierarchy of this HierarchicalIK module. More...

#include <HierarchicalIK.hpp>

Inheritance diagram for dart::dynamics::HierarchicalIK::Constraint:
dart::dynamics::HierarchicalIK::Function dart::optimizer::Function

Public Member Functions

 Constraint (const std::shared_ptr< HierarchicalIK > &_ik)
 Constructor. More...
 
virtual ~Constraint ()=default
 Virtual destructor. More...
 
optimizer::FunctionPtr clone (const std::shared_ptr< HierarchicalIK > &_newIK) const override
 Enable this function to be cloned to a new IK module. More...
 
double eval (const Eigen::VectorXd &_x) override
 Evaluates and returns the objective function at the point x. More...
 
void evalGradient (const Eigen::VectorXd &_x, Eigen::Map< Eigen::VectorXd > _grad) override
 Evaluates and returns the objective function at the point x. More...
 
virtual void setName (const std::string &newName)
 Sets the name of this Function. More...
 
const std::string & getName () const
 Returns the name of this Function. More...
 
void evalGradient (const Eigen::VectorXd &_x, Eigen::VectorXd &_grad)
 Evaluates and return the objective function at the point x. More...
 
virtual void evalHessian (const Eigen::VectorXd &_x, Eigen::Map< Eigen::VectorXd, Eigen::RowMajor > _Hess)
 Evaluates and return the objective function at the point x. More...
 

Protected Attributes

std::weak_ptr< HierarchicalIKmIK
 Pointer to this Constraint's HierarchicalIK module. More...
 
Eigen::VectorXd mLevelGradCache
 Cache for the gradient of a level. More...
 
Eigen::VectorXd mTempGradCache
 Cache for temporary gradients. More...
 
std::string mName
 Name of this function. More...
 

Detailed Description

The HierarchicalIK::Constraint Function is simply used to merge the constraints of the InverseKinematics modules that belong to the hierarchy of this HierarchicalIK module.

This class is not meant to be extended or instantiated by a user. Call HierarchicalIK::resetProblem() to set the constraint of the module's Problem to an HierarchicalIK::Constraint.

Constructor & Destructor Documentation

◆ Constraint()

dart::dynamics::HierarchicalIK::Constraint::Constraint ( const std::shared_ptr< HierarchicalIK > &  _ik)

Constructor.

◆ ~Constraint()

virtual dart::dynamics::HierarchicalIK::Constraint::~Constraint ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ clone()

optimizer::FunctionPtr dart::dynamics::HierarchicalIK::Constraint::clone ( const std::shared_ptr< HierarchicalIK > &  _newIK) const
overridevirtual

Enable this function to be cloned to a new IK module.

Implements dart::dynamics::HierarchicalIK::Function.

◆ eval()

double dart::dynamics::HierarchicalIK::Constraint::eval ( const Eigen::VectorXd &  x)
overridevirtual

Evaluates and returns the objective function at the point x.

Implements dart::optimizer::Function.

◆ evalGradient() [1/2]

void dart::dynamics::HierarchicalIK::Constraint::evalGradient ( const Eigen::VectorXd &  _x,
Eigen::Map< Eigen::VectorXd >  _grad 
)
overridevirtual

Evaluates and returns the objective function at the point x.

Reimplemented from dart::optimizer::Function.

◆ evalGradient() [2/2]

void dart::optimizer::Function::evalGradient ( const Eigen::VectorXd &  _x,
Eigen::VectorXd &  _grad 
)
inherited

Evaluates and return the objective function at the point x.

If you have a raw array that the gradient will be passed in, then use evalGradient(const Eigen::VectorXd&, Eigen::Map<Eigen::VectorXd>) for better performance.

◆ evalHessian()

void dart::optimizer::Function::evalHessian ( const Eigen::VectorXd &  _x,
Eigen::Map< Eigen::VectorXd, Eigen::RowMajor >  _Hess 
)
virtualinherited

Evaluates and return the objective function at the point x.

Reimplemented in dart::optimizer::NullFunction, and dart::optimizer::ModularFunction.

◆ getName()

const std::string & dart::optimizer::Function::getName ( ) const
inherited

Returns the name of this Function.

◆ setName()

void dart::optimizer::Function::setName ( const std::string &  newName)
virtualinherited

Sets the name of this Function.

Member Data Documentation

◆ mIK

std::weak_ptr<HierarchicalIK> dart::dynamics::HierarchicalIK::Constraint::mIK
protected

Pointer to this Constraint's HierarchicalIK module.

◆ mLevelGradCache

Eigen::VectorXd dart::dynamics::HierarchicalIK::Constraint::mLevelGradCache
protected

Cache for the gradient of a level.

◆ mName

std::string dart::optimizer::Function::mName
protectedinherited

Name of this function.

◆ mTempGradCache

Eigen::VectorXd dart::dynamics::HierarchicalIK::Constraint::mTempGradCache
protected

Cache for temporary gradients.