ikin (extension)

This function returns the joint position corresponding iSolutionSpace, which is equivalent to the robot pose in the operating space, among 8 joint shapes.

Definition
DRFLEx.h within class CDRFLEx, public section (line 667)

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.

eTargetRef

COORDINATE_SYSTEM

COORDINATE_SYSTEM_BASE

Reference coordinate system for the TCP.

iRefPosOpt

unsigned char

Reference-pose option used by the extended IK solver (implementation-specific option).

Return

Value

Description

LPINVERSE_KINEMATIC_RESPONSE

Extended inverse-kinematics response including the solved joint position (and related meta data).

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, 0);

float q[6] = {0};
for (int i = 0; i < 6; ++i) {
    q[i] = res->_fJoint[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->_fJoint 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.