You're reading the documentation for an older, but still supported version (1.33.4).
For information on the latest version, please have a look at 1.33.5.

trans

This function translates/rotates the input parameter (fSourcePos), expressed in the reference coordinate system, by fOffset in the same coordinate system, and returns the result converted to the eTargetRef coordinate system.

Definition
DRFLEx.h within class CDRFLEx, public section

LPROBOT_POSE trans(
    float fSourcePos[NUM_TASK],
    float fOffset[NUM_TASK],
    COORDINATE_SYSTEM eSourceRef = COORDINATE_SYSTEM_BASE,
    COORDINATE_SYSTEM eTargetRef = COORDINATE_SYSTEM_BASE
) {
    return _trans(_rbtCtrl, fSourcePos, fOffset, eSourceRef, eTargetRef);
};

Parameter

Parameter Name

Data Type

Default Value

Description

fSourcePos

float[6]

Target joint or task position for six axes (x, y, z, Rx, Ry, Rz)

fOffset

float[6]

Offset information for six axes (translation/rotation delta)

eSourceRef

COORDINATE_SYSTEM

COORDINATE_SYSTEM_BASE

Source coordinate system reference.

eTargetRef

COORDINATE_SYSTEM

COORDINATE_SYSTEM_BASE

Target coordinate system reference.

Return

Value

Description

ROBOT_POSE

Returns the transformed position and orientation result (pose)
calculated by applying fOffset to fSourcePos and converting
the result into the eTargetRef coordinate system.

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 point[6]  = { 30, 30, 30, 30, 30, 30 };
float offset[6] = { 100, 100, 100, 100, 100, 100 };
LPROBOT_POSE res = drfl.trans(point, offset);
for (int i = 0; i < 6; i++)
    printf("%.1f\n", res->_fPosition[i]);

In this example, the function calculates the translated pose of the tool by applying a 100 mm translation and 100° rotation offset to the original pose. This function is useful for computing relative motion targets, such as incremental path planning, tool offset compensation, or dynamic coordinate conversion.