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)

fTargetAcc

float [2]

Target acceleration (Unit: mm/s²)

fTargetTime

float

Target arrival time (Unit: sec)

eMoveMode

MOVE_MODE

Motion mode

eMoveReference

MOVE_REFERENCE

Motion reference

fBlendingRadius

float

Blending radius (Unit: mm)

eBlendingType

BLENDING_SPEED_TYPE

Blending speed type

Return

Value

Type

Description

True

bool

Success

False

bool

Fail

Example

CDRFLEx drfl;
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
while (!drfl.get_current_pos() == target_pos) {
     drfl._hold2run();
     time.sleep(0.1);
    // Additional processing can be done here
}