For information on the latest version, please have a look at 1.33.5.
servol (Auto Mode)
This function is an asynchronous motion command; the next command is executed as soon as the motion starts. It follows the most recent target position among consecutive commands, within the maximum speed and acceleration.
Unlike servoj, which operates in joint space, servol performs motion in task (Cartesian) space.
This API works in Auto (Run) mode only. It is not available in Manual (Teach) mode.
Definition
DRFLEx.h within class CDRFLEx, public section
bool servol(float fTargetPos[NUM_TASK],
float fLimitVel[2],
float fLimitAcc[2],
float fTargetTime)
{
return _servol(_rbtCtrl, fTargetPos, fLimitVel, fLimitAcc, fTargetTime);
}
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fTargetPos |
float[6] |
Target TCP position for six axes [X, Y, Z, Rx, Ry, Rz]. |
|
fLimitVel |
float[2] |
Translation and rotation velocity limits. |
|
fLimitAcc |
float[2] |
Translation and rotation acceleration limits. |
|
fTargetTime |
float |
Desired motion time [sec]. Automatically adjusted if infeasible. -10000 = not specified; the controller uses its automatic value. |
Return
Value |
Description |
|---|---|
0 |
Failed |
1 |
Success |
Note
Returns false without a message when the robot is in STATE_EMERGENCY_STOP, STATE_SAFE_OFF, STATE_SAFE_OFF2, STATE_SAFE_STOP or STATE_SAFE_STOP2.
A return of true does not confirm that the controller applied the request. Confirm the motion with get_current_posj, get_current_posx or the monitoring data callback.
Example
// Preconditions: Connected, servo ON, Auto mode active
// Define Cartesian target pose
float q0[6] = {368.f, 34.5f, 442.f, 50.f, -180.f, 50.f};
float jvel[2] = {10.f, 10.f};
float jacc[2] = {20.f, 20.f};
// Execute Cartesian motion
drfl.servol(q0, jvel, jacc, -10000.f);
Note
If
fTargetTimeis specified but cannot be maintained due to speed or acceleration limits, the controller automatically adjusts the motion time and displays a notification message.servolis not linked with the speed adjustment functionchange_operation_speed.When
DR_VAR_VEL(variable velocity) mode is used among singularity options, it is automatically converted toDR_AVOIDmode and a warning message is shown.servolis not linked with force/stiffness control commands.Used for smooth Cartesian interpolation and real-time target updates in automatic operation.