.. _servoj: servoj (Auto Mode) ------------------------------------------ This is an asynchronous motion command; the next command is executed as soon as the motion begins. In Override mode, it follows the most recent target joint position among the continuously delivered commands, within the maximum speed and acceleration. In Queue mode, it stores the commands and follows them in order. The call returns as soon as the command is sent, without waiting for the queued waypoints. If an Override command is passed during Queue mode, it ignores the previously stored waypoints and follows the most recent target joint position. This API works in **Auto (Run) mode only**. It does **not** operate in **Manual (Teach) mode**. **Definition** |br| ``DRFLEx.h`` within class ``CDRFLEx``, public section .. code-block:: cpp bool servoj(float fTargetPos[NUM_JOINT], float fLimitVel[NUM_JOINT], float fLimitAcc[NUM_JOINT], float fTargetTime, DR_SERVOJ_TYPE eTargetMod = DR_SERVO_OVERRIDE) { return _servoj(_rbtCtrl, fTargetPos, fLimitVel, fLimitAcc, fTargetTime, eTargetMod); } **Parameter** .. list-table:: :widths: 22 18 18 42 :header-rows: 1 * - **Parameter Name** - **Data Type** - **Default Value** - **Description** * - fTargetPos - float[6] - - - Target **joint** position for six axes [deg]. * - fLimitVel - float[6] - - - Per-axis **velocity limit** applied to this command. * - fLimitAcc - float[6] - - - Per-axis **acceleration limit** applied to this command. * - fTargetTime - float - - - Desired motion time [sec] for the segment (see **Notes**). * - eTargetMod - ``DR_SERVOJ_TYPE`` - ``DR_SERVO_OVERRIDE`` - **Waypoint execution mode** |br| ``DR_SERVO_OVERRIDE``: Follow the **most recent** command (override previous). |br| ``DR_SERVO_QUEUE``: **Queue** waypoints (keep and execute in order). **Return** .. list-table:: :widths: 16 84 :header-rows: 1 * - **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** .. code-block:: cpp // Preconditions: Connected, servo ON, **Auto mode** active // Target joint pose and limits float q[6] = { 0.f, 0.f, 90.f, 0.f, 0.f, 0.f }; float jvel[6] = { 10.f, 10.f, 10.f, 10.f, 10.f, 10.f }; float jacc[6] = { 10.f, 10.f, 10.f, 10.f, 10.f, 10.f }; // Override: keep following the most recent target drfl.servoj(q, jvel, jacc, 0.02f, DR_SERVO_OVERRIDE); // Queue example (buffer waypoints) // drfl.servoj(q, jvel, jacc, 0.02f, DR_SERVO_QUEUE); .. Note:: - If ``fTargetTime`` cannot be satisfied due to **max velocity/acceleration** limits, the controller **automatically adjusts** the timing and may display a notification. - Not linked to the operation speed adjustment of ``change_operation_speed`` (no coupling with that setting). - In **Queue** mode, commands are stored and followed in order; an **Override** call during Queue mode clears the buffered path and follows the latest command.