get_current_velj

This function retrieves the current joint-space velocity of the robot from the controller. It returns the instantaneous angular velocity of each joint, in degrees per second [deg/s].

Definition
DRFLEx.h within class CDRFLEx, public section

LPROBOT_VEL get_current_velj() {
    return _get_current_velj(_rbtCtrl);
};

Parameter
None

Return

Value

Description

LPROBOT_VEL

Pointer to a structure containing the current joint angular velocities.
The array represents the angular velocity of each joint (J1–J6) in [deg/s].

Note

Returns the most recent monitoring value. All fields are 0 until monitoring data has been received: after open_connection, after setup_monitoring_version, and after a reconnect. The returned pointer is never NULL. Before using the value, wait for the first monitoring callback after connecting.

Example

// Assume robot connection and mode setup are already done

LPROBOT_VEL lpVel = drfl.get_current_velj();
if (lpVel) {
    printf("Current Joint Velocities [deg/s]:\n");
    for (int j = 0; j < NUMBER_OF_JOINT; ++j) {
        printf("Joint %d: %.4f\n", j + 1, lpVel->_fVelocity[j]);
    }
} else {
    fprintf(stderr, "Failed to read joint velocity (null pointer)\n");
}

This example queries and prints the current angular velocity of each joint in degrees per second [deg/s]. This is useful for motion monitoring, feedback analysis, or verifying speed constraints during trajectory execution.