ikin (with iteration threshold)
This function returns the joint position corresponding to the target TCP position (fSourcePos) while allowing the user to specify iteration thresholds for the IK solver. This extended version provides finer control over the numerical convergence behavior compared to the standard ikin() function.
Definition
DRFLEx.h within class CDRFLEx, public section
LPINVERSE_KINEMATIC_RESPONSE ikin(
float fSourcePos[NUM_TASK],
unsigned char iSolutionSpace,
COORDINATE_SYSTEM eTargetRef,
float fIterThreshold[NUMBER_OF_ITER_THRESHOULD]
) {
return _ikin_add_iter_threshold(_rbtCtrl, fSourcePos, iSolutionSpace, eTargetRef, fIterThreshold);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fSourcePos |
float[6] |
Target TCP position (x, y, z, Rx, Ry, Rz) in task space. |
|
iSolutionSpace |
unsigned char |
Solution space index (0-7), or 255 to let the controller choose the reachable solution. |
|
eTargetRef |
Reference coordinate system for the TCP pose. |
||
fIterThreshold |
float[NUMBER_OF_ITER_THRESHOULD] |
Iteration threshold values used in the IK solver to define |
Return
Value |
Description |
|---|---|
Extended inverse-kinematics response structure containing the calculated |
Note
This call waits for the controller to answer.
Example
float tcp_target[6] = { 400.0f, 500.0f, 600.0f, 90.0f, 0.0f, 180.0f };
// Iteration threshold for IK solver
// NUMBER_OF_ITER_THRESHOULD = 2
float iter_th[NUMBER_OF_ITER_THRESHOULD] = { 0.01f, 0.001f };
LPINVERSE_KINEMATIC_RESPONSE result =
drfl.ikin(tcp_target, 2, COORDINATE_SYSTEM_BASE, iter_th);
if (result && result->_iStatus == 0)
{
float q[6] = {0};
for (int i = 0; i < 6; ++i)
q[i] = result->_fTargetPos[i];
drfl.movej(q, 60, 30);
}
In this example, the function calculates an inverse kinematics solution with a tighter iteration threshold, improving solver precision when working with high-accuracy motion requirements or sensitive tasks such as calibration or assembly.