Simox  2.3.74.0
VirtualRobot::AdvancedIKSolver Class Referenceabstract
Inheritance diagram for VirtualRobot::AdvancedIKSolver:
VirtualRobot::IKSolver VirtualRobot::GenericIKSolver

Public Member Functions

 AdvancedIKSolver (RobotNodeSetPtr rns)
 Initialize a IK solver without collision detection. More...
 
virtual void collisionDetection (SceneObjectPtr avoidCollisionsWith)
 
virtual void collisionDetection (ObstaclePtr avoidCollisionsWith)
 
virtual void collisionDetection (SceneObjectSetPtr avoidCollisionsWith)
 
virtual void collisionDetection (CDManagerPtr avoidCollision)
 
virtual void setMaximumError (float maxErrorPositionMM=1.0f, float maxErrorOrientationRad=0.02)
 
virtual void setReachabilityCheck (ReachabilityPtr reachabilitySpace)
 
virtual bool solve (const Eigen::Matrix4f &globalPose, CartesianSelection selection=All, int maxLoops=1)=0
 
virtual std::vector< float > solveNoRNSUpdate (const Eigen::Matrix4f &globalPose, CartesianSelection selection=All)
 
virtual bool solve (const Eigen::Vector3f &globalPosition)
 
virtual GraspPtr solve (ManipulationObjectPtr object, CartesianSelection selection=All, int maxLoops=1)
 
virtual bool solve (ManipulationObjectPtr object, GraspPtr grasp, CartesianSelection selection=All, int maxLoops=1)
 
virtual GraspPtr sampleSolution (ManipulationObjectPtr object, GraspSetPtr graspSet, CartesianSelection selection=All, bool removeGraspFromSet=false, int maxLoops=1)
 
virtual bool checkReachable (const Eigen::Matrix4f &globalPose)
 
RobotNodeSetPtr getRobotNodeSet ()
 
RobotNodePtr getTcp ()
 
void setVerbose (bool enable)
 
- Public Member Functions inherited from VirtualRobot::IKSolver
 IKSolver ()
 

Protected Member Functions

virtual bool _sampleSolution (const Eigen::Matrix4f &globalPose, CartesianSelection selection, int maxLoops=1)
 This method should deliver solution sample out of the set of possible solutions. More...
 

Protected Attributes

RobotNodeSetPtr rns
 
RobotNodePtr tcp
 
CDManagerPtr cdm
 
float maxErrorPositionMM
 
float maxErrorOrientationRad
 
ReachabilityPtr reachabilitySpace
 
bool verbose
 

Additional Inherited Members

- Public Types inherited from VirtualRobot::IKSolver
enum  CartesianSelection {
  X = 1, Y = 2, Z = 4, Position = 7,
  Orientation = 8, All = 15
}
 Flags for the selection of the target components. More...
 

Detailed Description

An advanced IK solver: Can reject configurations that are in collision. Can consider reachability information. Can handle ManipulationObjects and associated grasping information.

Constructor & Destructor Documentation

◆ AdvancedIKSolver()

VirtualRobot::AdvancedIKSolver::AdvancedIKSolver ( RobotNodeSetPtr  rns)

Initialize a IK solver without collision detection.

Parameters
rnsThe robotNodes (i.e., joints) for which the Jacobians should be calculated.

Member Function Documentation

◆ _sampleSolution()

virtual bool VirtualRobot::AdvancedIKSolver::_sampleSolution ( const Eigen::Matrix4f &  globalPose,
CartesianSelection  selection,
int  maxLoops = 1 
)
inlineprotectedvirtual

This method should deliver solution sample out of the set of possible solutions.

Reimplemented in VirtualRobot::GenericIKSolver.

◆ checkReachable()

bool VirtualRobot::AdvancedIKSolver::checkReachable ( const Eigen::Matrix4f &  globalPose)
virtual

This method returns true, when no reachability data is specified for this IK solver. If there is an reachability space defined, it is queried weather the pose is within the reachability or not and the result is returned.

◆ collisionDetection() [1/4]

void VirtualRobot::AdvancedIKSolver::collisionDetection ( SceneObjectPtr  avoidCollisionsWith)
virtual

Setup collision detection

Parameters
avoidCollisionsWithThe IK solver will consider collision checks between rns and avoidCollisionsWith

◆ collisionDetection() [2/4]

void VirtualRobot::AdvancedIKSolver::collisionDetection ( ObstaclePtr  avoidCollisionsWith)
virtual

Setup collision detection

Parameters
avoidCollisionsWithThe IK solver will consider collision checks between rns and avoidCollisionsWith

◆ collisionDetection() [3/4]

void VirtualRobot::AdvancedIKSolver::collisionDetection ( SceneObjectSetPtr  avoidCollisionsWith)
virtual

Setup collision detection

Parameters
avoidCollisionsWithThe IK solver will consider collision checks between rns and avoidCollisionsWith

◆ collisionDetection() [4/4]

void VirtualRobot::AdvancedIKSolver::collisionDetection ( CDManagerPtr  avoidCollision)
virtual

Setup collision detection

Parameters
avoidCollisionThe IK solver will consider collision checks, defined in this CDManager instance.

◆ getRobotNodeSet()

VirtualRobot::RobotNodeSetPtr VirtualRobot::AdvancedIKSolver::getRobotNodeSet ( )

◆ getTcp()

VirtualRobot::RobotNodePtr VirtualRobot::AdvancedIKSolver::getTcp ( )

◆ sampleSolution()

GraspPtr VirtualRobot::AdvancedIKSolver::sampleSolution ( ManipulationObjectPtr  object,
GraspSetPtr  graspSet,
CartesianSelection  selection = All,
bool  removeGraspFromSet = false,
int  maxLoops = 1 
)
virtual

Try to find a solution for grasping the object with the given GraspSet.

Returns
On success: The grasp for which an IK-solution was found, otherwise an empty GraspPtr

◆ setMaximumError()

void VirtualRobot::AdvancedIKSolver::setMaximumError ( float  maxErrorPositionMM = 1.0f,
float  maxErrorOrientationRad = 0.02 
)
virtual

Here, the default values of the maximum allowed error in translation and orientation can be changed.

Parameters
maxErrorPositionMMThe maximum position error that is allowed, given in millimeter.
maxErrorOrientationRadThe maximum orientation error that is allowed, given in radian (0.02 is approx 1 degree).

◆ setReachabilityCheck()

void VirtualRobot::AdvancedIKSolver::setReachabilityCheck ( ReachabilityPtr  reachabilitySpace)
virtual

When set, the reachability data is used to quickly decide if a given pose or grasp is reachable or not. This option can be enabled by setting the reachability space and it can be disabled by setting an empty ReachabilityPtr.

◆ setVerbose()

void VirtualRobot::AdvancedIKSolver::setVerbose ( bool  enable)

◆ solve() [1/4]

virtual bool VirtualRobot::AdvancedIKSolver::solve ( const Eigen::Matrix4f &  globalPose,
CartesianSelection  selection = All,
int  maxLoops = 1 
)
pure virtual

This method solves the IK up to the specified max error. On success, the joints of the the corresponding RobotNodeSet are set to the IK solution.

Parameters
globalPoseThe target pose given in global coordinate system.
selectionSelect the parts of the global pose that should be used for IK solving. (e.g. you can just consider the position and ignore the target orientation)
maxLoopsAn optional parameter, if multiple tries should be made
Returns
true on success

Implemented in VirtualRobot::GenericIKSolver.

◆ solve() [2/4]

bool VirtualRobot::AdvancedIKSolver::solve ( const Eigen::Vector3f &  globalPosition)
virtual

Convenient method to solve IK queries without considering orientations.

◆ solve() [3/4]

GraspPtr VirtualRobot::AdvancedIKSolver::solve ( ManipulationObjectPtr  object,
CartesianSelection  selection = All,
int  maxLoops = 1 
)
virtual

This method solves the IK up to the specified max error. On success, the joints of the the corresponding RobotNodeSet are set to the IK solution.

Parameters
objectThe object.
selectionSelect the parts of the global pose that should be used for IK solving. (e.g. you can just consider the position and ignore the target orientation)
maxLoopsHow many tries.
Returns
On success: The grasp for which an IK-solution was found, otherwise an empty GraspPtr

Reimplemented in VirtualRobot::GenericIKSolver.

◆ solve() [4/4]

bool VirtualRobot::AdvancedIKSolver::solve ( ManipulationObjectPtr  object,
GraspPtr  grasp,
CartesianSelection  selection = All,
int  maxLoops = 1 
)
virtual

Reimplemented in VirtualRobot::GenericIKSolver.

◆ solveNoRNSUpdate()

std::vector< float > VirtualRobot::AdvancedIKSolver::solveNoRNSUpdate ( const Eigen::Matrix4f &  globalPose,
CartesianSelection  selection = All 
)
virtual

This method solves the IK up to the specified max error. The joints of the robot node set are not updated.

Parameters
globalPoseThe target pose given in global coordinate system.
selectionSelect the parts of the global pose that should be used for IK solving. (e.g. you can just consider the position and ignore the target orientation)
Returns
The joint angles are returned as std::vector

Field Documentation

◆ cdm

CDManagerPtr VirtualRobot::AdvancedIKSolver::cdm
protected

◆ maxErrorOrientationRad

float VirtualRobot::AdvancedIKSolver::maxErrorOrientationRad
protected

◆ maxErrorPositionMM

float VirtualRobot::AdvancedIKSolver::maxErrorPositionMM
protected

◆ reachabilitySpace

ReachabilityPtr VirtualRobot::AdvancedIKSolver::reachabilitySpace
protected

◆ rns

RobotNodeSetPtr VirtualRobot::AdvancedIKSolver::rns
protected

◆ tcp

RobotNodePtr VirtualRobot::AdvancedIKSolver::tcp
protected

◆ verbose

bool VirtualRobot::AdvancedIKSolver::verbose
protected