servol_g (Auto Mode)
This function performs asynchronous Cartesian interpolation using velocity and acceleration blending, enabling smooth, continuous TCP (Tool Center Point) motion. It updates position targets in real time while maintaining the specified kinematic constraints.
This API operates only in Auto (Run) mode. It is not available in Manual (Teach) mode.
Definition
DRFLEx.h within class CDRFLEx, public section
bool servol_g(float fTargetPos[NUM_TASK],
float fTargetVel[2],
float fTargetAcc[2],
float fTargetTime = 0.f)
{
return _servol_g(_rbtCtrl, fTargetPos, fTargetVel, fTargetAcc, fTargetTime);
}
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fTargetPos |
float[6] |
Target Cartesian pose [X, Y, Z, Rx, Ry, Rz]. Rx, Ry, Rz are fixed X-Y-Z angles in deg. |
|
fTargetVel |
float[2] |
Translational and rotational velocity limits. |
|
fTargetAcc |
float[2] |
Translational and rotational acceleration limits. |
|
fTargetTime |
float |
0.0f |
Transition time [sec] |
Caution
The function converts Rx, Ry, Rz to ZYZ Euler angles and writes them back into fTargetPos[3] to fTargetPos[5]. Pass a fresh copy of the target pose on every call; reusing the same array converts the angles again.
Return
Value |
Description |
|---|---|
0 |
Failed |
1 |
Success |
Example
// Preconditions: Connected, servo ON, Auto mode active
float tcp[6] = {400.f, 200.f, 300.f, 180.f, 0.f, 0.f};
float vel[2] = {100.f, 50.f};
float acc[2] = {200.f, 100.f};
drfl.servol_g(tcp, vel, acc, 0.4f);
Note
servol_gprovides continuous TCP motion with velocity/acceleration blending.Ideal for path streaming, sensor-based control, and hybrid trajectory updates.
If
fTargetTimecannot be met, motion parameters are internally optimized.It is not linked with
change_operation_speed()orforce/stiffness controlAPIs.Use for smooth Cartesian trajectory generation and real-time feedback control.