Simox  2.3.49
VirtualRobot::GazeIK Class Reference
Inheritance diagram for VirtualRobot::GazeIK:

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW GazeIK (RobotNodeSetPtr rns, RobotNodePrismaticPtr virtualTranslationJoint)
 
void setup (float maxPosError, int maxLoops, int maxGradientDecentSteps)
 
void enableJointLimitAvoidance (bool enable)
 
Eigen::VectorXf computeStep (const Eigen::Vector3f &goal, float stepSize=0.6f)
 
bool solve (const Eigen::Vector3f &goal, float stepSize=0.6f)
 
float getMaxPosError ()
 
void setVerbose (bool v)
 

Protected Member Functions

void setupIK ()
 
void setJointsRandom ()
 
void setJointsRandom (const Eigen::Vector3f &goal, int bestOfTries)
 
bool trySolve (const Eigen::Vector3f &goal, float stepSize)
 
float getCurrentError (const Eigen::Vector3f &goal)
 
void applyJLA (const Eigen::Vector3f &goal, int steps, float stepSize)
 
bool checkTolerances (const Eigen::Vector3f &goal)
 

Protected Attributes

std::vector< RobotNodePtrnodes
 
RobotNodeSetPtr rns
 
RobotNodePrismaticPtr virtualTranslationJoint
 
HierarchicalIKPtr ikSolver
 
DifferentialIKPtr ikGaze
 
JointLimitAvoidanceJacobiPtr ikJointLimits
 
bool enableJLA
 
int maxLoops
 
int maxGradientDecentSteps
 
float maxPosError
 
int randomTriesToGetBestConfig
 
bool verbose
 

Detailed Description

A specialized IK solver for gaze related tasks. The gaze is represented by a virtual translational joint and the IK problem is solved by searching a solution for the head joints and the virtual gaze joint so that the position of the end point is at the requested gaze position. By default joint limit avoidance is considered as secondary task in order to generate more naturally looking configurations.

Constructor & Destructor Documentation

VirtualRobot::GazeIK::GazeIK ( RobotNodeSetPtr  rns,
RobotNodePrismaticPtr  virtualTranslationJoint 
)

Constructor

Parameters
rnsThe RobotNodeSet containing the neck (optionally a common eye tilt joint) and the virtual translational joint that represents the gaze. The TCP of the RNS is tried to position at the goal pose.
virtualTranslationJointA prismatic joint (usually without any models and physics properties) that represents the gaze

Member Function Documentation

void VirtualRobot::GazeIK::applyJLA ( const Eigen::Vector3f &  goal,
int  steps,
float  stepSize 
)
protected
bool VirtualRobot::GazeIK::checkTolerances ( const Eigen::Vector3f &  goal)
protected
Eigen::VectorXf VirtualRobot::GazeIK::computeStep ( const Eigen::Vector3f &  goal,
float  stepSize = 0.6f 
)

Compute a gradient descent step.

Parameters
goalThe goal position of the gaze in global coordinate system.
stepSizeCan be used to limit the error step.
Returns
the joint delta vector
void VirtualRobot::GazeIK::enableJointLimitAvoidance ( bool  enable)

Joint Limit Avoidance is considered as secondary task.

Parameters
enableThe joint limit avoidance can be enabled (standard) or disabled.
float VirtualRobot::GazeIK::getCurrentError ( const Eigen::Vector3f &  goal)
protected
float VirtualRobot::GazeIK::getMaxPosError ( )
void VirtualRobot::GazeIK::setJointsRandom ( )
protected
void VirtualRobot::GazeIK::setJointsRandom ( const Eigen::Vector3f &  goal,
int  bestOfTries 
)
protected
void VirtualRobot::GazeIK::setup ( float  maxPosError,
int  maxLoops,
int  maxGradientDecentSteps 
)

The standard setup can be changed with this method.

Parameters
maxPosErrorSpecifies how exact the target should be reached (standard 5mm).
maxLoopsSpecifies how many seeds should be generate for starting a gradient descent search (standard 30)
maxGradientDecentStepsThe maximum number of steps that should be taken to decent the gradient
void VirtualRobot::GazeIK::setupIK ( )
protected
void VirtualRobot::GazeIK::setVerbose ( bool  v)
bool VirtualRobot::GazeIK::solve ( const Eigen::Vector3f &  goal,
float  stepSize = 0.6f 
)
bool VirtualRobot::GazeIK::trySolve ( const Eigen::Vector3f &  goal,
float  stepSize 
)
protected

Field Documentation

bool VirtualRobot::GazeIK::enableJLA
protected
DifferentialIKPtr VirtualRobot::GazeIK::ikGaze
protected
JointLimitAvoidanceJacobiPtr VirtualRobot::GazeIK::ikJointLimits
protected
HierarchicalIKPtr VirtualRobot::GazeIK::ikSolver
protected
int VirtualRobot::GazeIK::maxGradientDecentSteps
protected
int VirtualRobot::GazeIK::maxLoops
protected
float VirtualRobot::GazeIK::maxPosError
protected
std::vector<RobotNodePtr> VirtualRobot::GazeIK::nodes
protected
int VirtualRobot::GazeIK::randomTriesToGetBestConfig
protected
RobotNodeSetPtr VirtualRobot::GazeIK::rns
protected
bool VirtualRobot::GazeIK::verbose
protected
RobotNodePrismaticPtr VirtualRobot::GazeIK::virtualTranslationJoint
protected