Simox  2.3.74.0
VirtualRobot::ConstrainedOptimizationIK Class Reference
Inheritance diagram for VirtualRobot::ConstrainedOptimizationIK:
VirtualRobot::ConstrainedIK

Data Structures

struct  AdditionalOutputData
 

Public Member Functions

 ConstrainedOptimizationIK (RobotPtr &robot, const RobotNodeSetPtr &nodeSet, float timeout=0.5, float globalTolerance=std::numeric_limits< float >::quiet_NaN())
 
bool initialize () override
 
bool solve (bool stepwise=false) override
 
bool solveStep () override
 
void setRandomSamplingDisplacementFactor (float displacementFactor)
 
- Public Member Functions inherited from VirtualRobot::ConstrainedIK
 ConstrainedIK (RobotPtr &robot, const RobotNodeSetPtr &nodeSet, int maxIterations=1000, float stall_epsilon=0.0001, float raise_epsilon=0.8, bool reduceRobot=false)
 
void addConstraint (const ConstraintPtr &constraint, int priority=0, bool hard_constraint=true)
 
void removeConstraint (const ConstraintPtr &constraint)
 
std::vector< ConstraintPtrgetConstraints ()
 
void addSeed (SeedType type, const Eigen::VectorXf seed=Eigen::VectorXf())
 
void clearSeeds ()
 
void setMaxIterations (int maxIterations)
 
int getMaxIterations ()
 
bool getRunning ()
 
int getCurrentIteration ()
 

Protected Member Functions

double optimizationFunction (const std::vector< double > &x, std::vector< double > &gradient)
 
double optimizationConstraint (const std::vector< double > &x, std::vector< double > &gradient, const OptimizationFunctionSetup &setup)
 
bool hardOptimizationFunction (const std::vector< double > &x, double &error, AdditionalOutputData &data)
 
- Protected Member Functions inherited from VirtualRobot::ConstrainedIK
void getUnitableNodes (const RobotNodePtr &robotNode, const RobotNodeSetPtr &nodeSet, std::vector< std::string > &unitable)
 
RobotPtr buildReducedRobot (const RobotPtr &original)
 

Static Protected Member Functions

static double optimizationFunctionWrapper (const std::vector< double > &x, std::vector< double > &gradient, void *data)
 
static double optimizationConstraintWrapper (const std::vector< double > &x, std::vector< double > &gradient, void *data)
 

Protected Attributes

RobotNodeSetPtr nodeSet
 
OptimizerPtr optimizer
 
float timeout
 
float globalTolerance
 
std::vector< double > currentX
 
unsigned int numIterations
 
float randomSamplingDisplacementFactor
 
float functionValueTolerance
 
float optimizationValueTolerance
 
- Protected Attributes inherited from VirtualRobot::ConstrainedIK
std::vector< ConstraintPtrconstraints
 
std::map< ConstraintPtr, int > priorities
 
std::map< ConstraintPtr, bool > hardConstraints
 
RobotPtr originalRobot
 
RobotPtr robot
 
RobotNodeSetPtr nodeSet
 
Eigen::VectorXf initialConfig
 
std::vector< std::pair< SeedType, Eigen::VectorXf > > seeds
 
int maxIterations
 
int currentIteration
 
bool running
 
float stallEpsilon
 
float raiseEpsilon
 

Additional Inherited Members

- Public Types inherited from VirtualRobot::ConstrainedIK
enum  SeedType { eSeedZero, eSeedInitial, eSeedOther }
 

Constructor & Destructor Documentation

◆ ConstrainedOptimizationIK()

ConstrainedOptimizationIK::ConstrainedOptimizationIK ( RobotPtr robot,
const RobotNodeSetPtr nodeSet,
float  timeout = 0.5,
float  globalTolerance = std::numeric_limits<float>::quiet_NaN() 
)

Member Function Documentation

◆ hardOptimizationFunction()

bool ConstrainedOptimizationIK::hardOptimizationFunction ( const std::vector< double > &  x,
double &  error,
AdditionalOutputData data 
)
protected

◆ initialize()

bool ConstrainedOptimizationIK::initialize ( )
overridevirtual

Reimplemented from VirtualRobot::ConstrainedIK.

◆ optimizationConstraint()

double ConstrainedOptimizationIK::optimizationConstraint ( const std::vector< double > &  x,
std::vector< double > &  gradient,
const OptimizationFunctionSetup setup 
)
protected

◆ optimizationConstraintWrapper()

double ConstrainedOptimizationIK::optimizationConstraintWrapper ( const std::vector< double > &  x,
std::vector< double > &  gradient,
void *  data 
)
staticprotected

◆ optimizationFunction()

double ConstrainedOptimizationIK::optimizationFunction ( const std::vector< double > &  x,
std::vector< double > &  gradient 
)
protected

◆ optimizationFunctionWrapper()

double ConstrainedOptimizationIK::optimizationFunctionWrapper ( const std::vector< double > &  x,
std::vector< double > &  gradient,
void *  data 
)
staticprotected

◆ setRandomSamplingDisplacementFactor()

void ConstrainedOptimizationIK::setRandomSamplingDisplacementFactor ( float  displacementFactor)

This factor limits the interval around the initial robot configuration where random samplings are placed. A value of 1 (the default) means that samplings can in the whole joint limit interval.

◆ solve()

bool ConstrainedOptimizationIK::solve ( bool  stepwise = false)
overridevirtual

Reimplemented from VirtualRobot::ConstrainedIK.

◆ solveStep()

bool ConstrainedOptimizationIK::solveStep ( )
overridevirtual

Field Documentation

◆ currentX

std::vector<double> VirtualRobot::ConstrainedOptimizationIK::currentX
protected

◆ functionValueTolerance

float VirtualRobot::ConstrainedOptimizationIK::functionValueTolerance
protected

◆ globalTolerance

float VirtualRobot::ConstrainedOptimizationIK::globalTolerance
protected

◆ nodeSet

RobotNodeSetPtr VirtualRobot::ConstrainedOptimizationIK::nodeSet
protected

◆ numIterations

unsigned int VirtualRobot::ConstrainedOptimizationIK::numIterations
protected

◆ optimizationValueTolerance

float VirtualRobot::ConstrainedOptimizationIK::optimizationValueTolerance
protected

◆ optimizer

OptimizerPtr VirtualRobot::ConstrainedOptimizationIK::optimizer
protected

◆ randomSamplingDisplacementFactor

float VirtualRobot::ConstrainedOptimizationIK::randomSamplingDisplacementFactor
protected

◆ timeout

float VirtualRobot::ConstrainedOptimizationIK::timeout
protected