se2ez
se2ez::IKSolver Class Reference

Common components of IK solvers. More...

#include <ik.h>

Inheritance diagram for se2ez::IKSolver:
[legend]

Public Types

enum  Request {
  NONE = 0,
  X_AXIS = 1 << 0,
  Y_AXIS = 1 << 1,
  ROTATION = 1 << 2,
  POSITION = X_AXIS | Y_AXIS,
  ALL = POSITION | ROTATION
}
 A bitmask specification of what task components should this IK request satisfy. More...
 

Public Member Functions

 IKSolver (const IKSolver &)=delete
 
 IKSolver (IKSolver &&)=delete
 
void setRestarts (unsigned int restarts)
 Sets the number of random restarts to use when solving a request. More...
 
virtual void setJointWeight (const std::string &frame, const Eigen::VectorXd &weights)
 Sets the weights on a specific joint in the robot for IK solving. More...
 
virtual void setJointWeights (const Eigen::VectorXd &weights)
 Sets the weights for all joints in the robot for IK solving. More...
 
virtual void setLambda (double lambda)
 Sets lambda, damping constant in WDLS. More...
 

Protected Types

enum  Index {
  POS_X = 0,
  POS_Y = 1,
  POS_Z = 2,
  ROT_X = 3,
  ROT_Y = 4,
  ROT_Z = 5
}
 KDL specific indices for different components of the task matrix. More...
 

Protected Member Functions

 IKSolver (const RobotPtr &robot, unsigned int frames)
 Constructor. Protected so only derived classes can create this. More...
 
void setRequest (unsigned int task, Request request)
 Sets the task matrix values for a task at index task according to a request. More...
 
void setTask (unsigned int task, Index index, bool active)
 Sets the specific index component of a task to active. More...
 
void setRandom (KDL::JntArray &array) const
 Sets a KDL array to random values between joint limits. More...
 

Protected Attributes

const unsigned int n_
 Number of joint variables. More...
 
const unsigned int t_
 Number of tasks. More...
 
const RobotPtr robot_
 Reference to robot. More...
 
const KDL::JntArray min_
 Joint minimums. More...
 
const KDL::JntArray max_
 Joint maximums. More...
 
KDL::MatrixXd weights_
 Joint variable weights. More...
 
KDL::MatrixXd tasks_
 Task weights. More...
 
double lambda_ {0.01}
 Lambda, WDLS constant. More...
 
unsigned int restarts_ {10}
 Number of random restarts. More...
 

Detailed Description

Common components of IK solvers.

Definition at line 36 of file ik.h.

Member Enumeration Documentation

◆ Index

enum se2ez::IKSolver::Index
protected

KDL specific indices for different components of the task matrix.

Enumerator
POS_X 

X Position.

POS_Y 

Y Position.

POS_Z 

Z Position, Ignored as we are 2D.

ROT_X 

X Rotation, Ignored as we are 2D.

ROT_Y 

Y Rotation, Ignored as we are 2D.

ROT_Z 

Z Rotation.

Definition at line 79 of file ik.h.

◆ Request

A bitmask specification of what task components should this IK request satisfy.

Enumerator
NONE 

No components.

X_AXIS 

X component.

Y_AXIS 

Y component.

ROTATION 

Rotation component.

POSITION 

X- and Y-axis components.

ALL 

All components.

Definition at line 41 of file ik.h.

Constructor & Destructor Documentation

◆ IKSolver() [1/3]

se2ez::IKSolver::IKSolver ( const IKSolver )
delete

◆ IKSolver() [2/3]

se2ez::IKSolver::IKSolver ( IKSolver &&  )
delete

◆ IKSolver() [3/3]

IKSolver::IKSolver ( const RobotPtr robot,
unsigned int  frames 
)
protected

Constructor. Protected so only derived classes can create this.

IKSolver

Definition at line 18 of file ik.cpp.

Member Function Documentation

◆ setJointWeight()

void IKSolver::setJointWeight ( const std::string frame,
const Eigen::VectorXd &  weights 
)
virtual

Sets the weights on a specific joint in the robot for IK solving.

Parameters
[in]frameFrame to set weights for.
[in]weightsWeights to use for frame.

Reimplemented in se2ez::TreeIK.

Definition at line 41 of file ik.cpp.

◆ setJointWeights()

void IKSolver::setJointWeights ( const Eigen::VectorXd &  weights)
virtual

Sets the weights for all joints in the robot for IK solving.

Parameters
[in]weightsWeights to use.

Reimplemented in se2ez::TreeIK.

Definition at line 56 of file ik.cpp.

◆ setLambda()

void IKSolver::setLambda ( double  lambda)
virtual

Sets lambda, damping constant in WDLS.

Parameters
[in]lambdaLambda to use.

Reimplemented in se2ez::TreeIK.

Definition at line 69 of file ik.cpp.

◆ setRandom()

void IKSolver::setRandom ( KDL::JntArray &  array) const
protected

Sets a KDL array to random values between joint limits.

Parameters
[out]arrayArray to randomly set.

Definition at line 80 of file ik.cpp.

◆ setRequest()

void IKSolver::setRequest ( unsigned int  task,
Request  request 
)
protected

Sets the task matrix values for a task at index task according to a request.

Parameters
[in]taskIndex of task to set.
[in]requestRequest to set.

Definition at line 90 of file ik.cpp.

◆ setRestarts()

void IKSolver::setRestarts ( unsigned int  restarts)

Sets the number of random restarts to use when solving a request.

Parameters
[in]restartsThe number of random restarts to use.

< Add one since we do at least one iteration without random restart.

Definition at line 36 of file ik.cpp.

◆ setTask()

void IKSolver::setTask ( unsigned int  task,
Index  index,
bool  active 
)
protected

Sets the specific index component of a task to active.

Parameters
[in]taskIndex of task to set.
[in]indexIndex of component to set.
[in]activeValue to set component to.

Definition at line 98 of file ik.cpp.

Member Data Documentation

◆ lambda_

double se2ez::IKSolver::lambda_ {0.01}
protected

Lambda, WDLS constant.

Definition at line 120 of file ik.h.

◆ max_

const KDL::JntArray se2ez::IKSolver::max_
protected

Joint maximums.

Definition at line 116 of file ik.h.

◆ min_

const KDL::JntArray se2ez::IKSolver::min_
protected

Joint minimums.

Definition at line 115 of file ik.h.

◆ n_

const unsigned int se2ez::IKSolver::n_
protected

Number of joint variables.

Definition at line 111 of file ik.h.

◆ restarts_

unsigned int se2ez::IKSolver::restarts_ {10}
protected

Number of random restarts.

Definition at line 122 of file ik.h.

◆ robot_

const RobotPtr se2ez::IKSolver::robot_
protected

Reference to robot.

Definition at line 113 of file ik.h.

◆ t_

const unsigned int se2ez::IKSolver::t_
protected

Number of tasks.

Definition at line 112 of file ik.h.

◆ tasks_

KDL::MatrixXd se2ez::IKSolver::tasks_
protected

Task weights.

Definition at line 119 of file ik.h.

◆ weights_

KDL::MatrixXd se2ez::IKSolver::weights_
protected

Joint variable weights.

Definition at line 118 of file ik.h.


The documentation for this class was generated from the following files: