set_velx_rt
This function sets the global task-space velocity limit used in real-time servo motion control. It defines both the linear and rotational velocity bounds applied to task-level commands such as servol_rt or speedl_rt.
Definition
DRFLEx.h within class CDRFLEx, public section (line 594)
bool set_velx_rt(float fTransVel, float fRotationVel = -10000) {
return _set_velx_rt(_rbtCtrlUDP, fTransVel, fRotationVel);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fTransVel |
float |
Task linear velocity limit [mm/s]. |
|
fRotationVel |
float |
-10000 |
Task rotational velocity limit [deg/s]. |
Note
If the servo motion velocity exceeds the global task-space limit, an Info message is generated by the controller.
The system continues motion, but logs this event for diagnostic purposes.
The default rotational velocity (if unspecified) is derived from the translational velocity to maintain proportional motion scaling.
Return
Value |
Description |
|---|---|
1 |
Success — task velocity limits successfully applied. |
0 |
Error — invalid parameters or communication issue. |
Example
#include "DRFLEx.h"
#include <iostream>
using namespace DRAFramework;
int main() {
CDRFLEx drfl;
drfl.connect_rt_control("192.168.137.100", 12347);
// Define task-space velocity limits
float fTransVel = 100.0f; // Linear velocity [mm/s]
float fRotationVel = 60.0f; // Rotational velocity [deg/s]
// Apply task-space velocity limits for real-time servo motion
if (drfl.set_velx_rt(fTransVel, fRotationVel))
std::cout << "Global task velocity limits set successfully." << std::endl;
else
std::cout << "Failed to set task velocity limits." << std::endl;
drfl.disconnect_rt_control();
return 0;
}
This example defines a maximum task-space velocity of 100 mm/s for translation and 60 deg/s for rotation to ensure stable and safe real-time motion execution.
Tips
Recommended for use with speedl_rt or servol_rt functions.
If only translational motion is required, set
fRotationVel = -10000to auto-scale it.Adjust limits based on application safety requirements or workspace constraints.