For information on the latest version, please have a look at 1.33.5.
ikin_norm
This function performs inverse kinematics with normalization applied to the resulting joint angles. It calculates the joint position corresponding to the given TCP pose (fSourcePos) and adjusts the output to remain within normalized joint limits, ensuring consistent solutions across different configurations.
Definition
DRFLEx.h within class CDRFLEx, public section
LPINVERSE_KINEMATIC_RESPONSE ikin_norm(
float fSourcePos[NUM_TASK],
unsigned char iSolutionSpace,
COORDINATE_SYSTEM eTargetRef,
unsigned char iRefPosOpt
) {
return _ikin_norm(_rbtCtrl, fSourcePos, iSolutionSpace, eTargetRef, iRefPosOpt);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fSourcePos |
float[6] |
Target TCP position in task space (x, y, z, Rx, Ry, Rz). |
|
iSolutionSpace |
unsigned char |
Solution space index (0-7) selecting one of eight valid IK configurations, or 255 to let the controller choose the reachable solution closest to the reference joint position set by iRefPosOpt. |
|
eTargetRef |
Reference coordinate system for the TCP. |
||
iRefPosOpt |
unsigned char |
Reference joint position option used when selecting among multiple IK solutions. |
Return
Value |
Description |
|---|---|
Normalized inverse-kinematics response structure containing |
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 tcp_pose[6] = { 500.0f, 400.0f, 300.0f, 180.0f, 0.0f, 90.0f };
LPINVERSE_KINEMATIC_RESPONSE res =
drfl.ikin_norm(tcp_pose, 1, COORDINATE_SYSTEM_BASE, 1);
if (res && res->_iStatus == 0)
{
// Use the joint solution returned by ikin_norm.
float q[6] = {0};
for (int i = 0; i < 6; ++i)
q[i] = res->_fTargetPos[i];
drfl.movej(q, 50, 20);
}
else
{
// status:
// 0: Valid joint solution returned
// 1: Target pose is outside the robot workspace
// 2: Wrist-axis singularity detected
}
In this example, the target TCP pose tcp_pose is solved for solution space 1 in the BASE frame. The resulting joint angles are normalized to the range -180 to +180 deg to prevent discontinuities. This is useful when performing continuous path motions or calibration that require consistent joint states.