ikin (extension)
This function returns the joint position, among the 8 joint configurations, that corresponds to iSolutionSpace and is equivalent to the robot pose in task space.
Definition
DRFLEx.h within class CDRFLEx, public section
LPINVERSE_KINEMATIC_RESPONSE ikin(
float fSourcePos[NUM_TASK],
unsigned char iSolutionSpace,
COORDINATE_SYSTEM eTargetRef,
unsigned char iRefPosOpt
) {
return _ikin_ex(_rbtCtrl, fSourcePos, iSolutionSpace, eTargetRef, iRefPosOpt);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fSourcePos |
float[6] |
Target task location for six axes (TCP pose to be solved for). |
|
iSolutionSpace |
unsigned char |
Solution space index (0-7) selecting one of eight IK configurations, or 255 to let the controller choose the reachable solution. |
|
eTargetRef |
Reference coordinate system for the TCP. |
||
iRefPosOpt |
unsigned char |
Reference pose option. The function does not send this value to the controller, so every value gives the same result. |
Return
Value |
Description |
|---|---|
Extended inverse-kinematics response including the solved joint position (and related metadata). |
Note
This call waits for the controller to answer.
The returned pointer refers to storage in the CDRFLEx object that other DRFL calls and every reconnect reuse; copy the structure before making another DRFL call. The 3-argument ikin returns its result in storage shared by all CDRFLEx objects in the process instead; see ikin. Except for get_user_home, the pointer is never NULL; do not use a NULL check to detect failure.
Example
float x6[6] = { 370.9f, 719.7f, 651.5f, 90.f, -180.f, 0.f };
LPINVERSE_KINEMATIC_RESPONSE res = drfl.ikin(x6, 2, COORDINATE_SYSTEM_BASE, (unsigned char)0);
float q[6] = {0};
for (int i = 0; i < 6; ++i) {
q[i] = res->_fTargetPos[i]; // copy solved joints
}
drfl.movej(q, 60, 30);
This example solves IK for the TCP pose x6 in the BASE frame with solution space = 2 and ref-pose option = 0. The solved joint values are copied from res->_fTargetPos into q, then executed via movej(q, 60, 30) (velocity 60, acceleration 30). Use different solution spaces (0-7) to select another valid joint configuration for the same TCP pose.