speedj (Auto Mode)
It is an asynchronous type motion command and executes the next command at the same time as the motion starts. It is a motion that follows within the maximum speed and acceleration set for the most recent target joint speed among commands transmitted continuously.
Also, this API is valid only in Auto (Run) mode. It is not available in Manual (Teach) mode.
Definition
DRFLEx.h within class CDRFLEx, public section (line 815)
bool speedj(float fTargetVel[NUM_JOINT],
float fTargetAcc[NUM_JOINT],
float fTargetTime)
{
return _speedj(_rbtCtrl, fTargetVel, fTargetAcc, fTargetTime);
}
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fTargetVel |
float[6] |
Target joint velocity for six axes [deg/s or rad/s per system setting]. |
|
fTargetAcc |
float[6] |
Joint acceleration [deg/s² or rad/s²]. |
|
fTargetTime |
float |
Command duration [sec]. Automatically adjusted if infeasible. |
Return
Value |
Description |
|---|---|
0 |
Failed |
1 |
Success |
Example
#include "DRFLEx.h"
using namespace DRAFramework;
int main() {
CDRFLEx drfl;
// Preconditions: Connected, servo ON, Auto mode active
// Define joint velocity and acceleration
float jvel[6] = {10.f, 10.f, 10.f, 10.f, 10.f, 10.f};
float jacc[6] = {20.f, 20.f, 20.f, 20.f, 20.f, 20.f};
// Execute velocity control in joint space
drfl.speedj(jvel, jacc, -10000.f);
return 0;
}
Note
If
fTargetTimeis entered but cannot be maintained due to the maximum speed or acceleration condition, it automatically adjusts and displays a notification message.If you want to stop gradually, set
fTargetVel = {0,0,0,0,0,0}or callstop().For safety, if no new
speedjcommand is received for 0.1 sec during motion, an error message is displayed and motion stops automatically.speedjis not linked with the operation speed adjustment functionchange_operation_speed().Recommended for continuous joint velocity control, trajectory following, or real-time motion update loops.