addto

This function takes a source joint position (fSourcePos) and an offset vector (fOffset), and returns NULL. To add a joint offset, add fOffset to fSourcePos in your own code, as in the example below.

Definition
DRFLEx.h within class CDRFLEx, public section

LPROBOT_POSE addto(
    float fSourcePos[NUM_JOINT],
    float fOffset[NUM_JOINT]
) {
    return _addto(_rbtCtrl, fSourcePos, fOffset);
};

Parameter

Parameter Name

Data Type

Default Value

Description

fSourcePos

float[6]

Base joint position of the robot (J1–J6).

fOffset

float[6]

Offset values (ΔJ1–ΔJ6) to be added to the source position.
Units are [deg].

Return

Value

Description

LPROBOT_POSE

NULL. See the Caution below.

Caution

The returned pointer is NULL; do not use it. Add fOffset to fSourcePos in your own code, as in the example below.

Example

float q_base[6] = { 0.f, 90.f, 0.f, 90.f, 0.f, 0.f };
float dq[6]     = { 5.f, -5.f, 0.f, 0.f, 0.f, 0.f };

float q_target[6];
for (int i = 0; i < 6; ++i)
    q_target[i] = q_base[i] + dq[i];

drfl.movej(q_target, 50, 20);

This example adds a small offset dq to the base joint position q_base in the application, which gives the summed joint pose (source + offset). The robot then moves to the updated joint configuration using movej().