Simox  2.3.74.0
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

◆ GazeIK()

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

◆ applyJLA()

void VirtualRobot::GazeIK::applyJLA ( const Eigen::Vector3f &  goal,
int  steps,
float  stepSize 
)
protected

◆ checkTolerances()

bool VirtualRobot::GazeIK::checkTolerances ( const Eigen::Vector3f &  goal)
protected

◆ computeStep()

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

◆ enableJointLimitAvoidance()

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.

◆ getCurrentError()

float VirtualRobot::GazeIK::getCurrentError ( const Eigen::Vector3f &  goal)
protected

◆ getMaxPosError()

float VirtualRobot::GazeIK::getMaxPosError ( )

◆ setJointsRandom() [1/2]

void VirtualRobot::GazeIK::setJointsRandom ( )
protected

◆ setJointsRandom() [2/2]

void VirtualRobot::GazeIK::setJointsRandom ( const Eigen::Vector3f &  goal,
int  bestOfTries 
)
protected

◆ setup()

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

◆ setupIK()

void VirtualRobot::GazeIK::setupIK ( )
protected

◆ setVerbose()

void VirtualRobot::GazeIK::setVerbose ( bool  v)

◆ solve()

bool VirtualRobot::GazeIK::solve ( const Eigen::Vector3f &  goal,
float  stepSize = 0.6f 
)

◆ trySolve()

bool VirtualRobot::GazeIK::trySolve ( const Eigen::Vector3f &  goal,
float  stepSize 
)
protected

Field Documentation

◆ enableJLA

bool VirtualRobot::GazeIK::enableJLA
protected

◆ ikGaze

DifferentialIKPtr VirtualRobot::GazeIK::ikGaze
protected

◆ ikJointLimits

JointLimitAvoidanceJacobiPtr VirtualRobot::GazeIK::ikJointLimits
protected

◆ ikSolver

HierarchicalIKPtr VirtualRobot::GazeIK::ikSolver
protected

◆ maxGradientDecentSteps

int VirtualRobot::GazeIK::maxGradientDecentSteps
protected

◆ maxLoops

int VirtualRobot::GazeIK::maxLoops
protected

◆ maxPosError

float VirtualRobot::GazeIK::maxPosError
protected

◆ nodes

std::vector<RobotNodePtr> VirtualRobot::GazeIK::nodes
protected

◆ randomTriesToGetBestConfig

int VirtualRobot::GazeIK::randomTriesToGetBestConfig
protected

◆ rns

RobotNodeSetPtr VirtualRobot::GazeIK::rns
protected

◆ verbose

bool VirtualRobot::GazeIK::verbose
protected

◆ virtualTranslationJoint

RobotNodePrismaticPtr VirtualRobot::GazeIK::virtualTranslationJoint
protected