For information on the latest version, please have a look at 1.33.5.
get_current_velx
This function retrieves the current task-space velocity of the robot from the controller. It provides the instantaneous linear and angular velocity of the TCP (Tool Center Point) expressed in the task coordinate frame.
Definition
DRFLEx.h within class CDRFLEx, public section
LPROBOT_VEL get_current_velx() {
return _get_current_velx(_rbtCtrl);
};
Parameter
None
Return
Value |
Description |
|---|---|
Pointer to a structure containing the current TCP velocity values. |
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 initialization are complete
LPROBOT_VEL lpVel = drfl.get_current_velx();
if (lpVel) {
printf("Current TCP Velocity:\n");
printf("Linear [mm/s]: vx=%.4f vy=%.4f vz=%.4f\n",
lpVel->_fVelocity[0],
lpVel->_fVelocity[1],
lpVel->_fVelocity[2]);
printf("Angular [deg/s]: wx=%.4f wy=%.4f wz=%.4f\n",
lpVel->_fVelocity[3],
lpVel->_fVelocity[4],
lpVel->_fVelocity[5]);
}
This example queries the controller for the robot’s TCP linear and angular velocities, prints them to the console, and can be used for real-time motion monitoring or velocity feedback control.