moveb (Auto Mode)
This function moves the robot at constant velocity along path information consisting of one or more lines or arcs, blending the segments with the blending radius set in the path information.
Definition
DRFLEx.h within class CDRFLEx, public section
// motion control: blending move
bool moveb(MOVE_POSB tTargetPos[MAX_MOVEB_POINT],
unsigned char nPosCount,
float fTargetVel[2],
float fTargetAcc[2],
float fTargetTime = 0.f,
MOVE_MODE eMoveMode = MOVE_MODE_ABSOLUTE,
MOVE_REFERENCE eMoveReference = MOVE_REFERENCE_BASE,
DR_MV_APP eAppType = DR_MV_APP_NONE) {
return _moveb(_rbtCtrl, tTargetPos, nPosCount, fTargetVel, fTargetAcc,
fTargetTime, eMoveMode, eMoveReference, eAppType);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
tTargetPos |
MOVE_POSB [MAX_MOVEB_POINT] |
Path information |
|
nPosCount |
unsigned char |
Number of valid paths. nPosCount must be 1 to 50. |
|
fTargetVel |
float[2] |
Linear Velocity, Angular Velocity [mm/s, deg/s] |
|
fTargetAcc |
float[2] |
Linear Acceleration, Angular Acceleration [mm/s2, deg/s2] |
|
fTargetTime |
float |
0.f |
Reach Time [sec] |
eMoveMode |
|
Refer to the Definition of Enumeration Type |
|
eMoveReference |
|
Refer to the Definition of Enumeration Type |
|
eAppType |
|
Refer to the Definition of Enumeration Type. Accepted but not sent to the controller. |
Note
If a value is passed to
fTargetVel(e.g.,{30, 0}), the input corresponds to the linear velocity of the motion, while the angular velocity is determined proportionally to the linear velocity.If a value is passed to
fTargetAcc(e.g.,{60, 0}), the input corresponds to the linear acceleration of the motion, while the angular acceleration is determined proportionally to the linear acceleration.If
fTargetTimeis specified, values are processed based onfTargetTime, ignoringfTargetVelandfTargetAcc.When
eMoveModeisMOVE_MODE_RELATIVE, each pos in the posb list is defined as a relative coordinate with respect to the preceding pos.
Caution
A user input error is generated if the blending radius in
tTargetPosis 0.A user input error is generated due to the duplicated input of Line if contiguous Line–Line segments have the same direction.
If the blending condition causes a rapid change in direction, a user input error is generated to prevent sudden acceleration.
This function does not support online blending of previous and subsequent motions.
Return
Value |
Description |
|---|---|
0 |
Error |
1 |
Success |
Note
Returns false without a message when the robot is in STATE_EMERGENCY_STOP, STATE_SAFE_OFF, STATE_SAFE_OFF2, STATE_SAFE_STOP or STATE_SAFE_STOP2.
Example
MOVE_POSB xb[4];
memset(xb, 0x00, sizeof(xb));
unsigned char seqNum = 4;
float tvel[2] = { 50, 50 };
float tacc[2] = { 100, 100 };
xb[0]._iBlendType = 0; // line
xb[0]._fBlendRad = 50;
xb[0]._fTargetPos[0][0] = 559;
xb[0]._fTargetPos[0][1] = 234.5;
xb[0]._fTargetPos[0][2] = 651.5;
xb[0]._fTargetPos[0][3] = 0;
xb[0]._fTargetPos[0][4] = 180;
xb[0]._fTargetPos[0][5] = 0;
xb[1]._iBlendType = 1; // circle
xb[1]._fBlendRad = 50;
xb[1]._fTargetPos[0][0] = 559; // via point
xb[1]._fTargetPos[0][1] = 134.5;
xb[1]._fTargetPos[0][2] = 551.5;
xb[1]._fTargetPos[0][3] = 0;
xb[1]._fTargetPos[0][4] = 180;
xb[1]._fTargetPos[0][5] = 0;
xb[1]._fTargetPos[1][0] = 559; // end point
xb[1]._fTargetPos[1][1] = 234.5;
xb[1]._fTargetPos[1][2] = 451.5;
xb[1]._fTargetPos[1][3] = 0;
xb[1]._fTargetPos[1][4] = 180;
xb[1]._fTargetPos[1][5] = 0;
xb[2]._iBlendType = 0; // line
xb[2]._fBlendRad = 50;
xb[2]._fTargetPos[0][0] = 559;
xb[2]._fTargetPos[0][1] = 434.5;
xb[2]._fTargetPos[0][2] = 451.5;
xb[2]._fTargetPos[0][3] = 0;
xb[2]._fTargetPos[0][4] = 180;
xb[2]._fTargetPos[0][5] = 0;
xb[3]._iBlendType = 0; // line
xb[3]._fBlendRad = 50;
xb[3]._fTargetPos[0][0] = 559;
xb[3]._fTargetPos[0][1] = 234.5;
xb[3]._fTargetPos[0][2] = 251.5;
xb[3]._fTargetPos[0][3] = 0;
xb[3]._fTargetPos[0][4] = 180;
xb[3]._fTargetPos[0][5] = 0;
// Moves the robot from the current position through a trajectory consisting of LINE–CIRCLE–LINE–LINE,
// maintaining velocity 50 (mm/sec, deg/sec) and acceleration 100 (mm/sec2, deg/sec2).
// Blending to the next segment begins when the distance of 50 mm from the end point of each segment is reached.
drfl.moveb(xb, seqNum, tvel, tacc);
This example executes a blended path of line and circular segments at constant speed/acceleration, using a 50 mm blend radius to smoothly connect each segment.