.. _auto_moveb: 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. .. figure:: /tutorials/images/mode/moveb_overview.png :alt: moveb :width: 80% :align: center .. raw:: html
**Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp // 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** .. list-table:: :widths: 22 20 18 40 :header-rows: 1 * - **Parameter Name** - **Data Type** - **Default Value** - **Description** * - tTargetPos - :ref:`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/s\ :sup:`2`, deg/s\ :sup:`2`] * - fTargetTime - float - 0.f - Reach Time [sec] * - eMoveMode - :ref:`MOVE_MODE ` - ``MOVE_MODE_ABSOLUTE`` - Refer to the Definition of Enumeration Type * - eMoveReference - :ref:`MOVE_REFERENCE ` - ``MOVE_REFERENCE_BASE`` - Refer to the Definition of Enumeration Type * - eAppType - :ref:`DR_MV_APP ` - ``DR_MV_APP_NONE`` - 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 ``fTargetTime`` is specified, values are processed based on ``fTargetTime``, ignoring ``fTargetVel`` and ``fTargetAcc``. - When ``eMoveMode`` is ``MOVE_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 ``tTargetPos`` is **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** .. list-table:: :widths: 20 80 :header-rows: 1 * - **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** .. code-block:: cpp 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.