Aikido
aikido::constraint::NewtonsMethodProjectable Class Reference

Uses Newton's method to project state. More...

#include <aikido/constraint/NewtonsMethodProjectable.hpp>

Inheritance diagram for aikido::constraint::NewtonsMethodProjectable:
aikido::constraint::Projectable

Public Member Functions

 NewtonsMethodProjectable (DifferentiablePtr _differentiable, std::vector< double > _tolerance, int _maxIteration=1000, double _minStepSize=1e-5)
 Constructor. More...
 
bool project (const statespace::StateSpace::State *_s, statespace::StateSpace::State *_out) const override
 Projection _s to _out. More...
 
statespace::ConstStateSpacePtr getStateSpace () const override
 Gets the StateSpace that this constraint operates on. More...
 
- Public Member Functions inherited from aikido::constraint::Projectable
virtual ~Projectable ()=default
 
virtual bool project (statespace::StateSpace::State *_s) const
 Performs an in-place projection. More...
 

Private Member Functions

bool contains (const statespace::StateSpace::State *_s) const
 

Private Attributes

DifferentiablePtr mDifferentiable
 
std::vector< double > mTolerance
 
int mMaxIteration
 
double mMinStepSize
 
statespace::ConstStateSpacePtr mStateSpace
 

Detailed Description

Uses Newton's method to project state.

Constructor & Destructor Documentation

◆ NewtonsMethodProjectable()

aikido::constraint::NewtonsMethodProjectable::NewtonsMethodProjectable ( DifferentiablePtr  _differentiable,
std::vector< double >  _tolerance,
int  _maxIteration = 1000,
double  _minStepSize = 1e-5 
)

Constructor.

Parameters
_differentiableDifferentiable constraint to be projected.
_toleranceTolerances for checking whether the constraints are been satisfied. e.g. For equality, |_differentiable->getValue(state)| <= tolerance The size of tolerances should match _differentiable's constraint dimension.
_maxIterationMax iteration for Newton's method.
_minStepSizeMinimum step size to be taken in Newton's method.

Member Function Documentation

◆ contains()

bool aikido::constraint::NewtonsMethodProjectable::contains ( const statespace::StateSpace::State _s) const
private

◆ getStateSpace()

statespace::ConstStateSpacePtr aikido::constraint::NewtonsMethodProjectable::getStateSpace ( ) const
overridevirtual

Gets the StateSpace that this constraint operates on.

Implements aikido::constraint::Projectable.

◆ project()

bool aikido::constraint::NewtonsMethodProjectable::project ( const statespace::StateSpace::State _s,
statespace::StateSpace::State _out 
) const
overridevirtual

Projection _s to _out.

Returns false if projection cannot be done.

Parameters
_sstate to be projected.
_outresulting projection.

Implements aikido::constraint::Projectable.

Member Data Documentation

◆ mDifferentiable

DifferentiablePtr aikido::constraint::NewtonsMethodProjectable::mDifferentiable
private

◆ mMaxIteration

int aikido::constraint::NewtonsMethodProjectable::mMaxIteration
private

◆ mMinStepSize

double aikido::constraint::NewtonsMethodProjectable::mMinStepSize
private

◆ mStateSpace

statespace::ConstStateSpacePtr aikido::constraint::NewtonsMethodProjectable::mStateSpace
private

◆ mTolerance

std::vector<double> aikido::constraint::NewtonsMethodProjectable::mTolerance
private