For information on the latest version, please have a look at 1.33.5.
movel_h2r
This function moves the robot to a target position in task space (linear move). It is a hold-to-run version of the movel command. It initiates the motion, which must be sustained by periodically calling the hold2run command.
Definition
DRFLEx.h within class CDRFLEx
bool movel_h2r(float fTargetPos[NUM_TASK], float fTargetVel[2], float fTargetAcc[2], float fTargetTime = 0.f, MOVE_MODE eMoveMode = MOVE_MODE_ABSOLUTE, MOVE_REFERENCE eMoveReference = MOVE_REFERENCE_BASE, float fBlendingRadius = 0.f, BLENDING_SPEED_TYPE eBlendingType = BLENDING_SPEED_TYPE_DUPLICATE)
{
return _safe_movel_h2r(_rbtCtrl, fTargetPos, fTargetVel, fTargetAcc, fTargetTime, eMoveMode, eMoveReference, fBlendingRadius, eBlendingType);
}
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
fTargetPos |
float [NUM_TASK] |
Target task position (Unit: mm, deg) |
|
fTargetVel |
float [2] |
Target velocity (Unit: mm/s, deg/s) |
|
fTargetAcc |
float [2] |
Target acceleration (Unit: mm/s², deg/s²) |
|
fTargetTime |
float |
|
Target arrival time (Unit: sec) |
eMoveMode |
|
Motion mode |
|
eMoveReference |
|
Motion reference |
|
fBlendingRadius |
float |
|
Blending radius (Unit: mm) |
eBlendingType |
|
Blending speed type |
Return
Value |
Type |
Description |
|---|---|---|
True |
bool |
Success |
False |
bool |
Fail |
Note
Returns false while a DRL program is running or paused.
Example
float target_pos[6] = {500, 100, 500, 0, 180, 0};
float target_vel[2] = {100.0, 20.0};
float target_acc[2] = {200.0, 40.0};
drfl.movel_h2r(target_pos, target_vel, target_acc); // Initiate hold2run motion
bool target_reached = false; // set by your own position check
while (!target_reached) {
drfl.hold2run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// Additional processing can be done here
}