For information on the latest version, please have a look at 1.33.5.
set_velj_rt
This function sets the joint velocity value used by servoj_rt in real-time control on DRCF v2; on DRCF v3, servoj_rt does not use it. It does not limit the servoj_rt trajectory, which follows the target position, velocity, acceleration and time of each command, and speedj_rt does not use it.
Definition
DRFLEx.h within class CDRFLEx, public section
bool set_velj_rt(float vel[NUM_JOINT]) {
return _set_velj_rt(_rbtCtrlUDP, vel);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
vel |
float[6] |
Joint velocity [deg/s]. Each value must not exceed the joint velocity limit of the safety settings. |
Note
The controller applies this value only while real-time control is started with start_rt_control. A command sent before start_rt_control is ignored.
A value above the joint velocity limit of the safety settings is rejected, and the controller reports a warning through set_on_log_alarm. The joints before the first out-of-range joint take the new values; that joint and the later ones keep their previous values.
To cap how fast the robot moves under
servoj_rt, use the joint velocity limit of the safety settings; exceeding it stops the robot.The value stays in effect until it is changed or the controller restarts. Ending the real-time control session does not reset it.
Return
Value |
Description |
|---|---|
1 |
The command was sent. This does not confirm that the controller received or applied it. |
0 |
The command datagram could not be sent. |
Note
This function is asynchronous. It returns without waiting for the controller to accept or reject the command, so a return value of 1 does not confirm that the robot acted on it. Rejected commands and motion warnings and errors are reported through set_on_log_alarm. set_on_rt_log_alarm reports only RT session messages, so register both callbacks.
Example
drfl.connect_rt_control("192.168.137.100", 12347);
// The controller applies this value only while real-time control is started.
// Input period 0: no input watchdog, because this example sends a single command.
std::string version = "v1.0";
drfl.set_rt_control_input(version, 0.0f, 4);
drfl.set_rt_control_output(version, 0.001f, 4);
drfl.start_rt_control();
// Joint velocity [deg/s]
float vel[6] = {100.f, 100.f, 100.f, 100.f, 100.f, 100.f};
if (drfl.set_velj_rt(vel))
printf("set_velj_rt sent.\n");
else
printf("set_velj_rt could not be sent.\n");
drfl.disconnect_rt_control();
This example sets the value to 100 deg/s for every joint.
Tips
The value can be changed again without restarting the real-time control session.