.. _set_velj_rt: set_velj_rt ------------------------------------------ This function sets the joint velocity value used by :ref:`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 :ref:`speedj_rt ` does not use it. **Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp bool set_velj_rt(float vel[NUM_JOINT]) { return _set_velj_rt(_rbtCtrlUDP, vel); }; **Parameter** .. list-table:: :widths: 25 20 20 35 :header-rows: 1 * - **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 :ref:`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 :ref:`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** .. list-table:: :widths: 20 80 :header-rows: 1 * - **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 :ref:`set_on_log_alarm `. :ref:`set_on_rt_log_alarm ` reports only RT session messages, so register both callbacks. **Example** .. code-block:: cpp 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.