Robot movement ======================== .. toctree:: :maxdepth: 5 Jog movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Jog movement * @param [in] refType 0-joint jog, 2-base coordinate jog, 4-tool coordinate jog, 8-workpiece coordinate jog * @param [in] nb 1-joint 1 (or x-axis), 2-joint 2 (or y-axis), 3-joint 3 (or z-axis), 4-joint 4 (or rotation about x-axis), 5-joint 5 (or rotation about y-axis), 6-joint 6 (or rotation about z-axis) * @param [in] dir 0-negative direction, 1-positive direction * @param [in] vel Speed percentage, [0~100] * @param [in] acc Acceleration percentage, [0~100] * @param [in] max_dis Maximum angle per jog movement in [°] or distance in [mm] * @return Error code */ int StartJOG(int refType, int nb, int dir, double vel, double acc, double max_dis); Jog deceleration stop ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Jog deceleration stop * @param [in] stopType 1-joint jog stop, 3-base coordinate jog stop, 5-tool coordinate jog stop, 9-workpiece coordinate jog stop * @return Error code */ int StopJOG(int stopType); Jog immediate stop ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Jog immediate stop * @return Error code */ int ImmStopJOG(); Robot jog control code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestJOG(Robot robot) { for (int i = 0; i < 6; i++) { robot.StartJOG(0, i + 1, 0, 20.0, 20.0, 30.0); robot.Sleep(1000); robot.ImmStopJOG(); robot.Sleep(1000); } for (int i = 0; i < 6; i++) { robot.StartJOG(2, i + 1, 0, 20.0, 20.0, 30.0); robot.Sleep(1000); robot.ImmStopJOG(); robot.Sleep(1000); } for (int i = 0; i < 6; i++) { robot.StartJOG(4, i + 1, 0, 20.0, 20.0, 30.0); robot.Sleep(1000); robot.StopJOG(5); robot.Sleep(1000); } for (int i = 0; i < 6; i++) { robot.StartJOG(8, i + 1, 0, 20.0, 20.0, 30.0); robot.Sleep(1000); robot.StopJOG(9); robot.Sleep(1000); } return 0; } Joint space movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Joint space movement * @param [in] joint_pos Target joint position in deg * @param [in] desc_pos Target cartesian pose * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Speed percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not currently available * @param [in] ovl Speed scaling factor, range [0~100] * @param [in] epos Extended axis position in mm * @param [in] blendT [-1.0]-move to position (blocking), [0~500.0]-smoothing time (non-blocking) in ms * @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate, 2-offset in tool coordinate * @param [in] offset_pos Pose offset * @return Error code */ int MoveJ(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, ExaxisPos epos, double blendT, int offset_flag, DescPose offset_pos); Joint space motion (automatic forward kinematics calculation) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: java :linenos: /** * @brief Joint space motion (automatic forward kinematics calculation) * @param [in] joint_pos Target joint position, unit deg * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not open yet * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] epos Extended axis position, unit mm * @param [in] blendT [-1.0]-move to position (blocking), [0~500.0]-smoothing time (non-blocking), unit ms * @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system * @param [in] offset_pos Pose offset * @return Error code */ int MoveJ(JointPos joint_pos, int tool, int user, double vel, double acc, double ovl, ExaxisPos epos, double blendT, int offset_flag, DescPose offset_pos) Cartesian space linear movement +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionchanged:: Java SDK-v1.0.5-3.8.2 .. code-block:: Java :linenos: /** * @brief Cartesian Space Linear Motion (Overloaded Function 1 with blendMode) * @param joint_pos Target joint positions, unit: deg * @param desc_pos Target Cartesian pose * @param tool Tool coordinate system index, range [1~15] * @param user Workpiece/User coordinate system index, range [1~15] * @param vel Velocity percentage, range [0~100] * @param acc Acceleration percentage, range [0~100], currently unavailable * @param ovl Velocity scaling factor [0~100] / Physical velocity (mm/s) * @param blendR [-1.0]-Block until motion completes (blocking), [0~1000.0]-Blend radius (non-blocking), unit: mm * @param blendMode Transition method; 0-Tangent blend; 1-Corner blend * @param epos Extended axis position, unit: mm * @param search 0-No wire search, 1-Wire search * @param offset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param offset_pos Pose offset value * @param oacc Acceleration scaling factor [0-100] / Physical acceleration (mm/s²) * @param velAccParamMode Velocity/acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s²) * @param overSpeedStrategy Overspeed handling strategy; 1-Standard; 2-Stop with error on overspeed; 3-Adaptive speed reduction, default 0 * @param speedPercent Allowable speed reduction threshold percentage [0-100], default 10% * @return Error code */ public int MoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, double oacc,int velAccParamMode, int overSpeedStrategy, int speedPercent) Cartesian space linear motion (automatic inverse kinematics calculation) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: java :linenos: /** * @brief Cartesian space linear motion (automatic inverse kinematics calculation) * @param [in] desc_pos Target cartesian pose * @param [in] tool Tool coordinate number, range [1~15] * @param [in] user Workpiece coordinate number, range [1~15] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not open yet * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] blendR [-1.0]-move to position (blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm * @param [in] blendMode Transition mode; 0-tangent transition; 1-corner transition * @param [in] epos Extended axis position, unit mm * @param [in] search 0-no wire search, 1-wire search * @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system * @param [in] offset_pos Pose offset * @param [in] config Inverse kinematics joint space configuration, [-1]-calculate based on current joint position, [0~7]-solve according to specific joint space configuration * @param [in] overSpeedStrategy Overspeed handling strategy, 1-standard; 2-stop on error when overspeed; 3-adaptive speed reduction, default is 0 * @param [in] speedPercent Allowed speed reduction threshold percentage [0-100], default 10% * @return Error code */ int MoveL(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int config, int overSpeedStrategy, int speedPercent) Cartesian Space Linear Motion (Added velAccParamMode parameter for velocity and acceleration modes) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: Java :linenos: /** * @brief Cartesian Space Linear Motion (Added velAccParamMode parameter for velocity and acceleration modes) * @param [in] joint_pos Target joint position, unit deg * @param [in] desc_pos Target Cartesian pose * @param [in] tool Tool coordinate number, range [1~15] * @param [in] user Workpiece coordinate number, range [1~15] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not yet open * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] blendR [-1.0]-Motion complete (blocking), [0~1000.0]-Blending radius (non-blocking), unit mm * @param [in] epos Extended axis position, unit mm * @param [in] search 0-No wire search, 1-Wire search * @param [in] offset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos Pose offset * @param [in] velAccParamMode Velocity and acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s^2) * @param [in] overSpeedStrategy Overspeed handling strategy, 1-Standard; 2-Stop with error on overspeed; 3-Adaptive deceleration, default is 0 * @param [in] speedPercent Allowed deceleration threshold percentage [0-100], default 10% * @return Error code */ public int MoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int velAccParamMode, int overSpeedStrategy, int speedPercent) Cartesian Space Linear Motion (Overload Function 1, Added blendMode) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: Java :linenos: /** * @brief Cartesian Space Linear Motion (Overload Function 1, Added blendMode) * @param [in] joint_pos Target joint position, unit deg * @param [in] desc_pos Target Cartesian pose * @param [in] tool Tool coordinate number, range [1~15] * @param [in] user Workpiece coordinate number, range [1~15] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not yet open * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] blendR [-1.0]-Motion complete (blocking), [0~1000.0]-Blending radius (non-blocking), unit mm * @param [in] blendMode Transition mode; 0-Tangent transition; 1-Corner transition * @param [in] epos Extended axis position, unit mm * @param [in] search 0-No wire search, 1-Wire search * @param [in] offset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos Pose offset * @param [in] velAccParamMode Velocity and acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s^2) * @param [in] overSpeedStrategy Overspeed handling strategy, 1-Standard; 2-Stop with error on overspeed; 3-Adaptive deceleration, default is 0 * @param [in] speedPercent Allowed deceleration threshold percentage [0-100], default 10% * @return Error code */ public int MoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int velAccParamMode, int overSpeedStrategy, int speedPercent) Cartesian Space Linear Motion (Overload Function 2, No Joint Position Input Required) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: Java :linenos: /** * @brief Cartesian Space Linear Motion (Overload Function 2, No Joint Position Input Required) * @param [in] desc_pos Target Cartesian pose * @param [in] tool Tool coordinate number, range [1~15] * @param [in] user Workpiece coordinate number, range [1~15] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not yet open * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] blendR [-1.0]-Motion complete (blocking), [0~1000.0]-Blending radius (non-blocking), unit mm * @param [in] blendMode Transition mode; 0-Tangent transition; 1-Corner transition * @param [in] epos Extended axis position, unit mm * @param [in] search 0-No wire search, 1-Wire search * @param [in] offset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos Pose offset * @param [in] config Inverse kinematic joint space configuration, [-1]-Reference current joint position for calculation, [0~7]-Solve based on specific joint space configuration * @param [in] velAccParamMode Velocity and acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s^2) * @param [in] overSpeedStrategy Overspeed handling strategy, 1-Standard; 2-Stop with error on overspeed; 3-Adaptive deceleration, default is 0 * @param [in] speedPercent Allowed deceleration threshold percentage [0-100], default 10% * @return Error code */ public int MoveL(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int config, int velAccParamMode, int overSpeedStrategy, int speedPercent) Cartesian space circular movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Cartesian Space Circular Arc Motion * @param joint_pos_p Path point joint positions, unit: deg * @param desc_pos_p Path point Cartesian pose * @param ptool Tool coordinate system index, range [1~15] * @param puser Workpiece/User coordinate system index, range [1~15] * @param pvel Velocity percentage, range [0~100] * @param pacc Acceleration percentage, range [0~100], currently unavailable * @param epos_p Extended axis position, unit: mm * @param poffset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param offset_pos_p Pose offset value * @param joint_pos_t Target point joint positions, unit: deg * @param desc_pos_t Target point Cartesian pose * @param ttool Tool coordinate system index, range [1~15] * @param tuser Workpiece/User coordinate system index, range [1~15] * @param tvel Velocity percentage, range [0~100] * @param tacc Acceleration percentage, range [0~100], currently unavailable * @param epos_t Extended axis position, unit: mm * @param toffset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param offset_pos_t Pose offset value * @param ovl Velocity scaling factor [0~100] / Physical velocity (mm/s) * @param blendR [-1.0]-Block until motion completes (blocking), [0~1000.0]-Blend radius (non-blocking), unit: mm * @param oacc Acceleration scaling factor [0-100] / Physical acceleration (mm/s²) * @param velAccParamMode Velocity/acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s²) * @return Error code */ public int MoveC(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR, double oacc, int velAccParamMode) Cartesian Space Arc Motion (Added velAccParamMode parameter for velocity and acceleration modes) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: Java :linenos: /** * @brief Cartesian Space Arc Motion (Added velAccParamMode parameter for velocity and acceleration modes) * @param [in] joint_pos_p Path point joint position, unit deg * @param [in] desc_pos_p Path point Cartesian pose * @param [in] ptool Tool coordinate number, range [1~15] * @param [in] puser Workpiece coordinate number, range [1~15] * @param [in] pvel Velocity percentage, range [0~100] * @param [in] pacc Acceleration percentage, range [0~100], not yet open * @param [in] epos_p Extended axis position, unit mm * @param [in] poffset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos_p Pose offset * @param [in] joint_pos_t Target point joint position, unit deg * @param [in] desc_pos_t Target point Cartesian pose * @param [in] ttool Tool coordinate number, range [1~15] * @param [in] tuser Workpiece coordinate number, range [1~15] * @param [in] tvel Velocity percentage, range [0~100] * @param [in] tacc Acceleration percentage, range [0~100], not yet open * @param [in] epos_t Extended axis position, unit mm * @param [in] toffset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos_t Pose offset * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] blendR [-1.0]-Motion complete (blocking), [0~1000.0]-Blending radius (non-blocking), unit mm * @param [in] velAccParamMode Velocity and acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s^2) * @return Error code */ public int MoveC(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR, int velAccParamMode) Cartesian Space Arc Motion (Overload Function 1, No Joint Position Input Required) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: Java :linenos: /** * @brief Cartesian Space Arc Motion (Overload Function 1, No Joint Position Input Required) * @param [in] desc_pos_p Path point Cartesian pose * @param [in] ptool Tool coordinate number, range [1~15] * @param [in] puser Workpiece coordinate number, range [1~15] * @param [in] pvel Velocity percentage, range [0~100] * @param [in] pacc Acceleration percentage, range [0~100], not yet open * @param [in] epos_p Extended axis position, unit mm * @param [in] poffset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos_p Pose offset * @param [in] desc_pos_t Target point Cartesian pose * @param [in] ttool Tool coordinate number, range [1~15] * @param [in] tuser Workpiece coordinate number, range [1~15] * @param [in] tvel Velocity percentage, range [0~100] * @param [in] tacc Acceleration percentage, range [0~100], not yet open * @param [in] epos_t Extended axis position, unit mm * @param [in] toffset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos_t Pose offset * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] blendR [-1.0]-Motion complete (blocking), [0~1000.0]-Blending radius (non-blocking), unit mm * @param [in] config Inverse kinematic joint space configuration, [-1]-Reference current joint position for calculation, [0~7]-Solve based on specific joint space configuration * @param [in] velAccParamMode Velocity and acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s^2) * @return Error code */ public int MoveC(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR, int config, int velAccParamMode) Cartesian space full circle movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionchanged:: Java SDK-v1.0.6-3.8.3 .. code-block:: Java :linenos: /** * @brief Cartesian Space Full Circle Motion * @param joint_pos_p Path point 1 joint positions, unit: deg * @param desc_pos_p Path point 1 Cartesian pose * @param ptool Tool coordinate system index, range [1~15] * @param puser Workpiece/User coordinate system index, range [1~15] * @param pvel Velocity percentage, range [0~100] * @param pacc Acceleration percentage, range [0~100], currently unavailable * @param epos_p Extended axis position, unit: mm * @param joint_pos_t Path point 2 joint positions, unit: deg * @param desc_pos_t Path point 2 Cartesian pose * @param ttool Tool coordinate system index, range [1~15] * @param tuser Workpiece/User coordinate system index, range [1~15] * @param tvel Velocity percentage, range [0~100] * @param tacc Acceleration percentage, range [0~100], currently unavailable * @param epos_t Extended axis position, unit: mm * @param ovl Velocity scaling factor [0~100] / Physical velocity (mm/s) * @param offset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param offset_pos Pose offset value * @param oacc Acceleration scaling factor [0-100] / Physical acceleration (mm/s²) * @param blendR -1: Blocking; 0~1000: Blend radius * @param velAccParamMode Velocity/acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s²) * @return Error code */ public int Circle(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, double ovl, int offset_flag, DescPose offset_pos, double oacc, double blendR, int velAccParamMode) Cartesian space full circle motion (automatic inverse kinematics calculation) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: java :linenos: /** * @brief Cartesian space full circle motion (automatic inverse kinematics calculation) * @param [in] desc_pos_p Path point 1 cartesian pose * @param [in] ptool Tool coordinate number, range [0~14] * @param [in] puser Workpiece coordinate number, range [0~14] * @param [in] pvel Velocity percentage, range [0~100] * @param [in] pacc Acceleration percentage, range [0~100], not open yet * @param [in] epos_p Extended axis position, unit mm * @param [in] desc_pos_t Path point 2 cartesian pose * @param [in] ttool Tool coordinate number, range [0~14] * @param [in] tuser Workpiece coordinate number, range [0~14] * @param [in] tvel Velocity percentage, range [0~100] * @param [in] tacc Acceleration percentage, range [0~100], not open yet * @param [in] epos_t Extended axis position, unit mm * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system * @param [in] offset_pos Pose offset * @param [in] oacc Acceleration percentage * @param [in] blendR -1: blocking; 0~1000: smoothing radius * @param [in] config Inverse kinematics joint space configuration, [-1]-calculate based on current joint position, [0~7]-solve according to specific joint space configuration * @return Error code */ int Circle(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, double ovl, int offset_flag, DescPose offset_pos, double oacc, double blendR,int config) Cartesian Space Full Circle Motion (Added velAccParamMode parameter for velocity and acceleration modes) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: Java :linenos: /** *@brief Cartesian Space Full Circle Motion (Added velAccParamMode parameter for velocity and acceleration modes) *@param [in] joint_pos_p Path point 1 joint position, unit deg *@param [in] desc_pos_p Path point 1 Cartesian pose *@param [in] ptool Tool coordinate number, range [1~15] *@param [in] puser Workpiece coordinate number, range [1~15] *@param [in] pvel Velocity percentage, range [0~100] *@param [in] pacc Acceleration percentage, range [0~100], not yet open *@param [in] epos_p Extended axis position, unit mm *@param [in] joint_pos_t Path point 2 joint position, unit deg *@param [in] desc_pos_t Path point 2 Cartesian pose *@param [in] ttool Tool coordinate number, range [1~15] *@param [in] tuser Workpiece coordinate number, range [1~15] *@param [in] tvel Velocity percentage, range [0~100] *@param [in] tacc Acceleration percentage, range [0~100], not yet open *@param [in] epos_t Extended axis position, unit mm *@param [in] ovl Velocity scaling factor, range [0~100] *@param [in] offset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system *@param [in] offset_pos Pose offset *@param [in] oacc Acceleration percentage *@param [in] blendR -1: Blocking; 0~1000: Blending radius *@param [in] velAccParamMode Velocity and acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s^2) *@return Error code */ public int Circle(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, double ovl, int offset_flag, DescPose offset_pos, double oacc, double blendR, int velAccParamMode) Cartesian Space Full Circle Motion (Overload Function 1, No Joint Position Input Required) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: Java :linenos: /** * @brief Cartesian Space Full Circle Motion (Overload Function 1, No Joint Position Input Required) * @param [in] desc_pos_p Path point 1 Cartesian pose * @param [in] ptool Tool coordinate number, range [0~14] * @param [in] puser Workpiece coordinate number, range [0~14] * @param [in] pvel Velocity percentage, range [0~100] * @param [in] pacc Acceleration percentage, range [0~100], not yet open * @param [in] epos_p Extended axis position, unit mm * @param [in] desc_pos_t Path point 2 Cartesian pose * @param [in] ttool Tool coordinate number, range [0~14] * @param [in] tuser Workpiece coordinate number, range [0~14] * @param [in] tvel Velocity percentage, range [0~100] * @param [in] tacc Acceleration percentage, range [0~100], not yet open * @param [in] epos_t Extended axis position, unit mm * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] offset_flag 0-No offset, 1-Offset in base/workpiece coordinate system, 2-Offset in tool coordinate system * @param [in] offset_pos Pose offset * @param [in] oacc Acceleration percentage * @param [in] blendR -1: Blocking; 0~1000: Blending radius * @param [in] config Inverse kinematic joint space configuration, [-1]-Reference current joint position for calculation, [0~7]-Solve based on specific joint space configuration * @param [in] velAccParamMode Velocity and acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) and acceleration (mm/s^2) * @return Error code */ public int Circle(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, double ovl, int offset_flag, DescPose offset_pos, double oacc, double blendR, int config, int velAccParamMode) Cartesian space point-to-point movement +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Cartesian space point-to-point movement * @param [in] desc_pos Target cartesian pose or pose increment * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Speed percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not currently available * @param [in] ovl Speed scaling factor, range [0~100] * @param [in] blendT [-1.0]-move to position (blocking), [0~500.0]-smoothing time (non-blocking) in ms * @param [in] config Joint space configuration, [-1]-calculate with reference to current joint position, [0~7]-calculate with reference to specific joint space configuration, default -1 * @return Error code */ int MoveCart(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendT, int config); Basic robot movement command code example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestMove(Robot robot) { int rtn=-1; JointPos j1=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos j2=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); JointPos j3=new JointPos(-29.777, -84.536, 109.275, -114.075, -86.655, 74.257); JointPos j4=new JointPos(-31.154, -95.317, 94.276, -88.079, -89.740, 74.256); DescPose desc_pos1=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose desc_pos2=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); DescPose desc_pos3=new DescPose(-487.434, 154.362, 308.576, 176.600, 0.268, -14.061); DescPose desc_pos4=new DescPose(-443.165, 147.881, 480.951, 179.511, -0.775, -15.409); DescPose offset_pos=new DescPose(0, 0, 0, 0, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); int tool = 0; int user = 0; double vel = 100.0; double acc = 100.0; double ovl = 100.0; double oacc = 100.0; double blendT = 0.0; double blendR = 0.0; int flag = 0; int search = 0; int blendMode = 0; int velAccMode = 0; robot.SetSpeed(20); rtn = robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); System.out.printf("movej errcode:%d\n", rtn); rtn = robot.MoveL(j2, desc_pos2, tool, user, vel, acc, ovl, blendR, blendMode, epos, search, flag, offset_pos, oacc, velAccMode,0,10); System.out.printf("movel errcode:%d\n", rtn); rtn = robot.MoveC(j3, desc_pos3, tool, user, vel, acc, epos, flag, offset_pos, j4, desc_pos4, tool, user, vel, acc, epos, flag, offset_pos, ovl, blendR, oacc, velAccMode); System.out.printf("movec errcode:%d\n", rtn); rtn = robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); System.out.printf("movej errcode:%d\n", rtn); rtn = robot.Circle(j3, desc_pos3, tool, user, vel, acc, epos, j1, desc_pos1, tool, user, vel, acc, epos, ovl, flag, offset_pos, oacc, -1, velAccMode); System.out.printf("circle errcode:%d\n", rtn); rtn = robot.MoveCart(desc_pos4, tool, user, vel, acc, ovl, blendT, -1); System.out.printf("MoveCart errcode:%d\n", rtn); rtn = robot.MoveJ(j1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); System.out.printf("movej errcode:%d\n", rtn); rtn = robot.MoveL(desc_pos2, tool, user, vel, acc, ovl, blendR, blendMode, epos, search, flag, offset_pos, -1, velAccMode,0,10); System.out.printf("movel errcode:%d\n", rtn); rtn = robot.MoveC(desc_pos3, tool, user, vel, acc, epos, flag, offset_pos, desc_pos4, tool, user, vel, acc, epos, flag, offset_pos, ovl, blendR, -1, velAccMode); System.out.printf("movec errcode:%d\n", rtn); rtn = robot.MoveJ(j2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); System.out.printf("movej errcode:%d\n", rtn); rtn = robot.Circle(desc_pos3, tool, user, vel, acc, epos, desc_pos1, tool, user, vel, acc, epos, ovl, flag, offset_pos, oacc, blendR, -1, velAccMode); System.out.printf("circle errcode:%d\n", rtn); return 0; } Cartesian space spiral movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Cartesian space spiral movement * @param [in] joint_pos Target joint position in deg * @param [in] desc_pos Target cartesian pose * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Speed percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not currently available * @param [in] epos Extended axis position in mm * @param [in] ovl Speed scaling factor, range [0~100] * @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate, 2-offset in tool coordinate * @param [in] offset_pos Pose offset * @return Error code */ int NewSpiral(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, ExaxisPos epos, double ovl, int offset_flag, DescPose offset_pos, SpiralParam spiral_param); Cartesian space spiral motion (automatic inverse kinematics calculation) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: java :linenos: /** * @brief Cartesian space spiral motion (automatic inverse kinematics calculation) * @param [in] desc_pos Target cartesian pose * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not open yet * @param [in] epos Extended axis position, unit mm * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system * @param [in] offset_pos Pose offset * @param [in] spiral_param Spiral parameters * @param [in] config Inverse kinematics joint space configuration, [-1]-calculate based on current joint position, [0~7]-solve according to specific joint space configuration * @return Error code */ int NewSpiral(DescPose desc_pos, int tool, int user, double vel, double acc, ExaxisPos epos, double ovl, int offset_flag, DescPose offset_pos, SpiralParam spiral_param,int config) Spiral movement code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestSpiral(Robot robot) { int rtn=-1; JointPos j=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); DescPose desc_pos=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose offset_pos1=new DescPose(50, 0, 0, -30, 0, 0); DescPose offset_pos2=new DescPose(50, 0, 0, -5, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); SpiralParam sp=new SpiralParam(1,5.0,50.0,10.0,10.0,0); int tool = 0; int user = 0; double vel = 100.0; double acc = 100.0; double ovl = 100.0; double blendT = 0.0; int flag = 2; rtn = robot.MoveJ(j, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos1); System.out.println("movej errcode:"+ rtn); rtn = robot.NewSpiral(desc_pos, tool, user, vel, acc, epos, ovl, flag, offset_pos2, sp,-1); System.out.println("newspiral errcode:"+ rtn); return 0; } Servo Motion Start +++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Start servo motion, used with ServoJ and ServoCart commands * @param comType Command sending type; 0-xmlrpc; 1-UDP (corresponding to robot port 20007) * @return Error code */ public int ServoMoveStart (int comType) Servo Motion End +++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief End servo motion, used with ServoJ and ServoCart commands * @param comType Command sending type; 0-xmlrpc; 1-UDP (corresponding to robot port 20007) * @return Error code */ public int ServoMoveEnd (int comType) Joint Space Servo Mode Motion ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionchanged:: Java SDK-v1.0.6-3.8.3 .. code-block:: Java :linenos: /** * @brief Joint space servo mode motion * @param joint_pos Target joint position, unit deg * @param axisPos External axis position, unit mm * @param acc Acceleration percentage, range [0~100], temporarily not open, default is 0 * @param vel Velocity percentage, range [0~100], temporarily not open, default is 0 * @param cmdT Command sending period, unit s, recommended range [0.001~0.0016] * @param filterT Filter time, unit s, temporarily not open, default is 0 * @param gain Proportional amplifier for target position, temporarily not open, default is 0 * @param id ServoJ command ID, default is 0 * @param comType Command sending type; 0-xmlrpc; 1-UDP (corresponding to robot port 20007) * @return Error code */ public int ServoJ(JointPos joint_pos, ExaxisPos axisPos, float acc, float vel, float cmdT, float filterT, float gain, int id, int comType) UDP Communication-Based ServoJ, ServoMoveStart, ServoMoveEnd SDK Code Example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestServoJ(Robot robot) { robot.udpCmdClient.SetUDPCmdRpyCallback((srcType, count, cmdID, dataLen, content) -> { System.out.println("\n[Received UDP reply from robot]"); System.out.println("srcType: " + srcType); System.out.println("count: " + count); System.out.println("cmdID: " + cmdID); System.out.println("dataLen: " + dataLen); System.out.println("content: " + content); return 0; }); int rtn=-1; JointPos j=new JointPos(0, 0, 0, 0, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); double vel = 0.0; double acc = 0.0; double cmdT = 0.016; double filterT = 0.0; double gain = 0.0; int flag = 0; int count = 300; double dt = 0.1; int cmdID = 0; int comType = 1; int ret = robot.GetActualJointPosDegree(j); if (ret == 0) { robot.ServoMoveStart(comType); count = 300; while (count>0) { robot.ServoJ(j, epos, acc, vel, cmdT, filterT, gain, cmdID, comType); j.J1 += dt; j.J2 += dt; j.J4 += dt; j.J5 += dt; j.J6 += dt; epos.axis1 += dt; count -= 1; robot.Sleep(10); } robot.ServoMoveEnd(comType); robot.Sleep(1000); robot.ServoMoveStart(comType); count = 300; while (count>0) { robot.ServoJ(j, epos, acc, vel, cmdT, filterT, gain, cmdID, comType); j.J1 -= dt; j.J2 -= dt; j.J4 -= dt; j.J5 -= dt; j.J6 -= dt; epos.axis1 -= dt; count -= 1; robot.Sleep(10); } robot.ServoMoveEnd(comType); } else { System.out.println("GetActualJointPosDegree errcode:"+ ret); } } Joint space servo mode movement example program ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static void TestServoJ() { Robot robot = new Robot(); robot.SetReconnectParam(true,20,500);//Set reconnection times and interval robot.LoggerInit(FrLogType.DIRECT, FrLogLevel.INFO, "D://log", 10, 10); int rtn = robot.RPC("192.168.58.2"); if(rtn == 0) { System.out.println("rpc connection success"); } else { System.out.println("rpc connection fail"); return ; } JointPos j5 = new JointPos(); ExaxisPos ePos=new ExaxisPos(); int ret = robot.GetActualJointPosDegree(j5); if (ret == 0) { int count = 200; while (count > 0) { robot.ServoJ(j5, ePos,100, 100, 0.008, 0, 0); j5.J1 += 0.2;//Joint 1 position increase count -= 1; robot.WaitMs((int)(8)); } } } Joint Torque Control Start +++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Start joint torque control * @param comType Command sending type; 0-xmlrpc; 1-UDP (corresponding to robot port 20007) * @return Error code */ public int ServoJTStart (int comType) Joint Torque Control +++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Joint torque control * @param torque j1~j6 joint torque, unit Nm * @param interval Command period, unit s, range [0.001~0.008] * @param checkFlag Detection strategy 0-no restriction; 1-power limitation; 2-velocity limitation; 3-both power and velocity limitation * @param jPowerLimit Joint maximum power limit (W) * @param jVelLimit Joint maximum velocity (°/s) * @param comType Command sending type; 0-xmlrpc; 1-UDP (corresponding to robot port 20007) * @return Error code */ public int ServoJT(double[] torque, double interval, int checkFlag, double[] jPowerLimit, double[] jVelLimit, int comType) Joint Torque Control End +++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief End joint torque control * @param comType Command sending type; 0-xmlrpc; 1-UDP (corresponding to robot port 20007) * @return Error code */ public int ServoJTEnd (int comType) Joint space servo mode movement example program ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestServoJT(Robot robot) { robot.DragTeachSwitch(1); List joint_toq=new ArrayList<>(); joint_toq=robot.GetJointTorques(1); int count = 100; robot.ServoJTStart(); // #servoJT start int error = 0; while (count > 0) { error = robot.ServoJT(torques, 0.001); count = count - 1; robot.Sleep(1); } error = robot.ServoJTEnd(); robot.DragTeachSwitch(0); robot.CloseRPC(); return 0; } UDP Communication-Based ServoJT, ServoJTStart, ServoJTEnd SDK Code Example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static void ServoJTWithSafety(Robot robot) { robot.udpCmdClient.SetUDPCmdRpyCallback((srcType, count, cmdID, dataLen, content) -> { System.out.println("\n[Received UDP reply from robot]"); System.out.println("srcType: " + srcType); System.out.println("count: " + count); System.out.println("cmdID: " + cmdID); System.out.println("dataLen: " + dataLen); System.out.println("content: " + content); return 0; }); while (true) { robot.ResetAllError(); robot.Sleep(500); List torques; torques=robot.GetJointTorques(1); robot.ServoJTStart(1); // #servoJT start ROBOT_STATE_PKG pkg=new ROBOT_STATE_PKG(); robot.DragTeachSwitch(1); int checkFlag = 3;//-1,3 double[] jPowerLimit = { 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 }; double[] jVelLimit = { 50, 50, 50, 50, 50, 50};//180.1,-1 int count = 800000; int error = 0; int comType = 1; double[] tor=new double[]{(double)torques.get(1),(double)torques.get(2),(double)torques.get(3),(double)torques.get(4),(double)torques.get(5),(double)torques.get(6)}; while (true) { tor[0] = 0.08;// #Increase axis 1 torque by 0.01 Nm each time, 100 movements error = robot.ServoJT(tor, 0.01, checkFlag, jPowerLimit, jVelLimit, comType); //# Joint space servo mode motion System.out.printf("ServoJT rtn is %d\n", error); count = count - 1; robot.Sleep(1); pkg = robot.GetRobotRealTimeState(); System.out.printf("maincode %d, subcode %d\n", pkg.main_code, pkg.sub_code); if (pkg.jt_cur_pos[0] > 30) break; } tor = new double[]{(double) torques.get(1), (double) torques.get(2), (double) torques.get(3), (double) torques.get(4), (double) torques.get(5), (double) torques.get(6)}; while (true) { tor[0] = -0.08;// #Decrease axis 1 torque by 0.01 Nm each time, 100 movements error = robot.ServoJT(tor, 0.01, checkFlag, jPowerLimit, jVelLimit, 1); //# Joint space servo mode motion System.out.printf("ServoJT rtn is %d\n", error); count = count - 1; robot.Sleep(1); pkg = robot.GetRobotRealTimeState(); System.out.printf("maincode %d, subcode %d\n", pkg.main_code, pkg.sub_code); if (pkg.jt_cur_pos[0] < 0) break; } robot.DragTeachSwitch(0); error = robot.ServoJTEnd(1); //#End servo motion } } Joint Torque Control Code Example with Overspeed Protection +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static void ServoJTWithSafety(Robot robot) { robot.ResetAllError(); robot.Sleep(500); List torques; torques = robot.GetJointTorques(1); robot.ServoJTStart(); // Start servoJT ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG(); robot.DragTeachSwitch(1); int checkFlag = 3; // -1,3 - Both power and velocity limits // double[] jPowerLimit = {1.0,1.0,1.0,1.0,1.0,1.0}; // 5001 double[] jPowerLimit = { 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 }; // Power limits for each joint (W) double[] jVelLimit = { 50, 50, 50, 50, 50, 50 }; // 180.1,-1 - Velocity limits for each joint (°/s) int count = 800000; int error = 0; double[] tor = new double[]{(double)torques.get(1), (double)torques.get(2), (double)torques.get(3), (double)torques.get(4), (double)torques.get(5), (double)torques.get(6)}; while (count > 0) { tor[2] = tor[2] + 0.01; // Increase torque of axis 1 by 0.01NM each time, moving 100 times error = robot.ServoJT(tor, 0.01, checkFlag, jPowerLimit, jVelLimit); // Joint space servo mode motion System.out.printf("ServoJT return is %d\n", error); count = count - 1; robot.Sleep(1); pkg = robot.GetRobotRealTimeState(); System.out.printf("maincode %d, subcode %d\n", pkg.main_code, pkg.sub_code); } robot.DragTeachSwitch(0); error = robot.ServoJTEnd(); // End servo motion } Cartesian Space Servo Mode Motion +++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Cartesian space servo mode motion * @param mode 0-Absolute motion (base coordinate system), 1-Incremental motion (base coordinate system), 2-Incremental motion (tool coordinate system) * @param desc_pose Target Cartesian pose or pose increment * @param exaxis Extended axis position * @param pos_gain Pose increment proportionality coefficient, only effective in incremental motion, range [0~1] * @param acc Acceleration percentage, range [0~100], temporarily not available, default 0 * @param vel Velocity percentage, range [0~100], temporarily not available, default 0 * @param cmdT Command transmission period, unit s, recommended range [0.001~0.016] * @param filterT Filter time, unit s, temporarily not available, default 0 * @param gain Proportional amplifier for target position, temporarily not available, default 0 * @return Error code */ public int ServoCart(int mode, DescPose desc_pose, ExaxisPos exaxis, double[] pos_gain, double acc, double vel, double cmdT, double filterT, double gain) Cartesian Space Servo Mode Motion Code Example +++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static void TestServoCart1(Robot robot) { DescPose desc_pos_dt = new DescPose(83.00800, 50.525000 , 29.246 , 179.629 , -7.138 , -166.975 ); ExaxisPos exaxis = new ExaxisPos( 100.0, 0.0, 0.0, 0.0 ); double[] pos_gain = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; int mode = 0; double vel = 0.0; double acc = 0.0; double cmdT = 0.001; double filterT = 0.0; double gain = 0.0; int flag = 0; int count = 5000; robot.SetSpeed(20); while (count>0) { int rtn = robot.ServoCart(mode, desc_pos_dt, exaxis, pos_gain, acc, vel, cmdT, filterT, gain); System.out.printf("ServoCart rtn is %d\n", rtn); count -= 1; desc_pos_dt.tran.x += 0.01; exaxis.axis1 += 0.01; } robot.CloseRPC(); } Spline movement start ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Spline movement start * @return Error code */ int SplineStart(); Joint movement PTP ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Joint space spline movement * @param [in] joint_pos Target joint position in deg * @param [in] desc_pos Target cartesian pose * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Speed percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not currently available * @param [in] ovl Speed scaling factor, range [0~100] * @return Error code */ int SplinePTP(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl); Joint space spline motion (automatic forward kinematics calculation) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: java :linenos: /** * @brief Joint space spline motion (automatic forward kinematics calculation) * @param [in] joint_pos Target joint position, unit deg * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not open yet * @param [in] ovl Velocity scaling factor, range [0~100] * @return Error code */ int SplinePTP(JointPos joint_pos, int tool, int user, double vel, double acc, double ovl) Spline movement end ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Spline movement end * @return Error code */ int SplineEnd(); Spline movement code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestSpline(Robot robot) { JointPos j1=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos j2=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); JointPos j3=new JointPos(-61.954, -84.409, 108.153, -116.316, -91.283, 74.260); JointPos j4=new JointPos(-89.575, -80.276, 102.713, -116.302, -91.284, 74.267); DescPose offset_pos=new DescPose(0, 0, 0, 0, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); int tool = 0; int user = 0; double vel = 100.0; double acc = 100.0; double ovl = 100.0; double blendT = -1.0; int flag = 0; int err1 = robot.MoveJ(j1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); System.out.println("movej errcode:"+ err1); robot.SplineStart(); robot.SplinePTP(j1, tool, user, vel, acc, ovl); robot.SplinePTP(j2, tool, user, vel, acc, ovl); robot.SplinePTP(j3, tool, user, vel, acc, ovl); robot.SplinePTP(j4, tool, user, vel, acc, ovl); robot.SplineEnd(); return 0; } New spline movement start ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief New spline movement start * @param [in] type 0-circular transition, 1-given points as path points * @param [in] averageTime Global average transition time(ms)(10 ~ ), default 2000 * @return Error code */ int NewSplineStart(int type, int averageTime); New spline command point ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Add spline movement command point * @param [in] joint_pos Target joint position in deg * @param [in] desc_pos Target cartesian pose * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Speed percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not currently available * @param [in] ovl Speed scaling factor, range [0~100] * @param [in] blendR [-1.0]-move to position (blocking), [0~1000.0]-smoothing radius (non-blocking) in mm * @param [in] lastFlag Whether it is the last point, 0-no, 1-yes * @return Error code */ int NewSplinePoint(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int lastFlag); New spline command point (automatic inverse kinematics calculation) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.8-3.8.5 .. code-block:: java :linenos: /** * @brief New spline command point (automatic inverse kinematics calculation) * @param [in] desc_pos Target cartesian pose * @param [in] tool Tool coordinate number, range [0~14] * @param [in] user Workpiece coordinate number, range [0~14] * @param [in] vel Velocity percentage, range [0~100] * @param [in] acc Acceleration percentage, range [0~100], not open yet * @param [in] ovl Velocity scaling factor, range [0~100] * @param [in] blendR [-1.0]-move to position (blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm * @param [in] lastFlag Whether it is the last point, 0-no, 1-yes * @param [in] config Inverse kinematics joint space configuration, [-1]-calculate based on current joint position, [0~7]-solve according to specific joint space configuration * @return Error code */ int NewSplinePoint(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int lastFlag,int config) New spline movement end ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief New spline movement start * @return Error code */ int NewSplineEnd(); New spline movement code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestNewSpline(Robot robot) { JointPos j1=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); DescPose desc_pos1=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose desc_pos2=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); DescPose desc_pos3=new DescPose(-327.622, 402.230, 320.402, -178.067, 2.127, -46.207); DescPose desc_pos4=new DescPose(-104.066, 544.321, 327.023, -177.715, 3.371, -73.818); DescPose desc_pos5=new DescPose(-33.421, 732.572, 275.103, -177.907, 2.709, -79.482); DescPose offset_pos=new DescPose(0, 0, 0, 0, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); int tool = 0; int user = 0; double vel = 100.0; double acc = 100.0; double ovl = 100.0; double blendT = -1.0; int flag = 0; int err1 = robot.MoveJ(j1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); System.out.println("movej errcode:"+ err1); robot.NewSplineStart(1, 2000); robot.NewSplinePoint(desc_pos1, tool, user, vel, acc, ovl, -1, 0,-1); robot.NewSplinePoint(desc_pos2, tool, user, vel, acc, ovl, -1, 0,-1); robot.NewSplinePoint(desc_pos3, tool, user, vel, acc, ovl, -1, 0,-1); robot.NewSplinePoint(desc_pos4, tool, user, vel, acc, ovl, -1, 0,-1); robot.NewSplinePoint(desc_pos5, tool, user, vel, acc, ovl, -1, 0,-1); robot.NewSplineEnd(); return 0; } Stop movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Stop movement * @return Error code */ int StopMotion(); Pause movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Pause movement * @return Error code */ int PauseMotion(); Resume movement ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Resume movement * @return Error code */ int ResumeMotion(); Movement pause, resume, stop code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestPause(Robot robot) { JointPos j1=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos j5=new JointPos(-95.228, -54.621, 73.691, -112.245, -91.280, 74.268); DescPose desc_pos1=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose desc_pos5=new DescPose(-33.421, 732.572, 275.103, -177.907, 2.709, -79.482); DescPose offset_pos=new DescPose(0, 0, 0, 0, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); int tool = 0; int user = 0; double vel = 100.0; double acc = 100.0; double ovl = 100.0; double blendT = -1.0; int flag = 0; robot.SetSpeed(20); int rtn=-1; rtn = robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); rtn = robot.MoveJ(j5, desc_pos5, tool, user, vel, acc, ovl, epos, 1, flag, offset_pos); robot.Sleep(1000); robot.PauseMotion(); robot.Sleep(1000); robot.ResumeMotion(); robot.Sleep(1000); robot.StopMotion(); robot.Sleep(1000); return 0; } Point global offset start +++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Point global offset start * @param [in] flag 0-offset in base/workpiece coordinate, 2-offset in tool coordinate * @param [in] offset_pos Pose offset * @return Error code */ int PointsOffsetEnable(int flag, DescPose offset_pos); Point global offset end ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Point global offset end * @return Error code */ int PointsOffsetDisable(); Point offset code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestOffset(Robot robot) { JointPos j1=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos j2=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); DescPose desc_pos1=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose desc_pos2=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); DescPose offset_pos=new DescPose(0, 0, 0, 0, 0, 0); DescPose offset_pos1=new DescPose(0, 0, 50, 0, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); int tool = 0; int user = 0; double vel = 100.0; double acc = 100.0; double ovl = 100.0; double blendT = -1.0; int flag = 0; robot.SetSpeed(20); robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.Sleep(1000); robot.PointsOffsetEnable(0, offset_pos1); robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.PointsOffsetDisable(); return 0; } Controller AO flying start +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Controller AO flying start * @param [in] AONum Controller AO number * @param [in] maxTCPSpeed Maximum TCP speed value[1-5000mm/s], default 1000 * @param [in] maxAOPercent AO percentage corresponding to maximum TCP speed, default 100% * @param [in] zeroZoneCmp Dead zone compensation value AO percentage, integer, default 20%, range [0-100] * @return Error code */ int MoveAOStart(int AONum, int maxTCPSpeed, int maxAOPercent, int zeroZoneCmp); Controller AO flying stop +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Controller AO flying stop * @return Error code */ int MoveAOStop(); End effector AO flying start +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief End effector AO flying start * @param [in] AONum End effector AO number * @param [in] maxTCPSpeed Maximum TCP speed value[1-5000mm/s], default 1000 * @param [in] maxAOPercent AO percentage corresponding to maximum TCP speed, default 100% * @param [in] zeroZoneCmp Dead zone compensation value AO percentage, integer, default 20%, range [0-100] * @return Error code */ int MoveToolAOStart(int AONum, int maxTCPSpeed, int maxAOPercent, int zeroZoneCmp); End effector AO flying stop +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief End effector AO flying stop * @return Error code */ int MoveToolAOStop(); AO flying code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestMoveAO(Robot robot) { JointPos j1=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos j2=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); DescPose desc_pos1=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose desc_pos2=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); DescPose offset_pos=new DescPose(0, 0, 0, 0, 0, 0); DescPose offset_pos1=new DescPose(0, 0, 50, 0, 0, 0); ExaxisPos epos=new ExaxisPos(0, 0, 0, 0); int tool = 0; int user = 0; double vel = 20.0; double acc = 20.0; double ovl = 100.0; double blendT = -1.0; int flag = 0; robot.SetSpeed(20); robot.MoveAOStart(0, 100, 100, 20); robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.MoveAOStop(); robot.Sleep(1000); robot.MoveToolAOStart(0, 100, 100, 20); robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos); robot.MoveToolAOStop(); return 0; } Start Ptp movement FIR filtering +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionchanged:: Java SDK-v1.0.5-3.8.2 .. code-block:: Java :linenos: /** * @brief Start Ptp movement FIR filtering * @param [in] maxAcc Maximum acceleration limit (deg/s2) * @param [in] maxJek Unified joint jerk limit (deg/s3) * @return Error code */ int PtpFIRPlanningStart(double maxAcc,double maxJek); Close Ptp movement FIR filtering +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Close Ptp movement FIR filtering * @return Error code */ int PtpFIRPlanningEnd(); Start LIN, ARC movement FIR filtering +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Start LIN, ARC movement FIR filtering * @param [in] maxAccLin Linear acceleration limit (mm/s2) * @param [in] maxAccDeg Angular acceleration limit (deg/s2) * @param [in] maxJerkLin Linear jerk limit (mm/s3) * @param [in] maxJerkDeg Angular jerk limit (deg/s3) * @return Error code */ int LinArcFIRPlanningStart(double maxAccLin, double maxAccDeg, double maxJerkLin, double maxJerkDeg); Close LIN, ARC movement FIR filtering +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Close LIN, ARC movement FIR filtering * @return Error code */ int LinArcFIRPlanningEnd(); FIR filtering code example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestFIR(Robot robot) { JointPos startjointPos=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos midjointPos=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); JointPos endjointPos=new JointPos(-29.777, -84.536, 109.275, -114.075, -86.655, 74.257); DescPose startdescPose=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose middescPose=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); DescPose enddescPose=new DescPose(-487.434, 154.362, 308.576, 176.600, 0.268, -14.061); ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0); DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0); int rtn = robot.PtpFIRPlanningStart(1000, 1000); robot.MoveJ(startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); robot.MoveJ(endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); robot.PtpFIRPlanningEnd(); robot.LinArcFIRPlanningStart(1000, 1000, 1000, 1000); robot.MoveL(startjointPos, startdescPose, 0, 0, 100, 100, 100, -1, 0,exaxisPos, 0, 0, offdese, 1, 1); robot.MoveC(midjointPos, middescPose, 0, 0, 100, 100, exaxisPos, 0, offdese, endjointPos, enddescPose, 0, 0, 100, 100, exaxisPos, 0, offdese, 100, -1); robot.LinArcFIRPlanningEnd(); return 0; } Acceleration smoothing enable +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.4-3.8.1 .. code-block:: Java :linenos: /** * @brief Acceleration smoothing enable * @param [in] saveFlag Whether to save after power off * @return Error code */ public int AccSmoothStart(boolean saveFlag) Acceleration smoothing disable +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: Java SDK-v1.0.4-3.8.1 .. code-block:: Java :linenos: /** * @brief Acceleration smoothing disable * @param [in] saveFlag Whether to save after power off * @return Error code */ public int AccSmoothEnd(boolean saveFlag) Acceleration smoothing code example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestAccSmooth(Robot robot) { JointPos startjointPos=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos endjointPos=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); DescPose startdescPose=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose enddescPose=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0); DescPose offdese=new DescPose(0,0,0,0,0,0); int rtn = robot.AccSmoothStart(false); robot.MoveJ(startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); robot.MoveJ(endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); rtn = robot.AccSmoothEnd(false); robot.CloseRPC(); return 0; } Specified pose speed enable +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Specified pose speed enable * @param [in] ratio Pose speed percentage [0-300] * @return Error code */ int AngularSpeedStart(int ratio) Specified pose speed disable +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Specified pose speed disable * @return Error code */ int AngularSpeedEnd(); Robot specified pose speed code example +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestAngularSpeed(Robot robot) { JointPos startjointPos=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos endjointPos=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); DescPose startdescPose=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose enddescPose=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0); DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0); int rtn = robot.AngularSpeedStart(50); robot.MoveJ(startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); robot.MoveJ(endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); rtn = robot.AngularSpeedEnd(); return 0; } Start singular pose protection +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Start singular pose protection * @param [in] protectMode Singular protection mode, 0: joint mode; 1-cartesian mode * @param [in] minShoulderPos Shoulder singular adjustment range(mm), default 100 * @param [in] minElbowPos Elbow singular adjustment range(mm), default 50 * @param [in] minWristPos Wrist singular adjustment range(°), default 10 * @return Error code */ int SingularAvoidStart(int protectMode, double minShoulderPos, double minElbowPos, double minWristPos); Stop singular pose protection +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Stop singular pose protection * @return Error code */ int SingularAvoidEnd(); Robot singular pose protection code example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestAngularSpeed(Robot robot) { JointPos startjointPos=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256); JointPos endjointPos=new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255); DescPose startdescPose=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833); DescPose enddescPose=new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869); ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0); DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0); int rtn = robot.AngularSpeedStart(50); robot.MoveJ(startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); robot.MoveJ(endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese); rtn = robot.AngularSpeedEnd(); return 0; } Clear Motion Command Queue ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Clears the motion command queue * @return Error code */ public int MotionQueueClear() Move to Intersecting Line Start Point +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Move to intersecting line start point * @param [in] mainPoint Cartesian poses of 6 taught points on the main pipe * @param [in] mainExaxisPos Extended axis positions for 6 taught points on the main pipe * @param [in] piecePoint Cartesian poses of 6 taught points on the branch pipe * @param [in] pieceExaxisPos Extended axis positions for 6 taught points on the branch pipe * @param [in] extAxisFlag Whether to enable extended axis; 0-Disable; 1-Enable * @param [in] exaxisPos Start point extended axis position * @param [in] tool Tool coordinate system number * @param [in] wobj Workpiece coordinate system number * @param [in] vel Velocity percentage * @param [in] acc Acceleration percentage * @param [in] ovl Velocity scaling factor * @param [in] oacc Acceleration scaling factor * @param [in] moveType Motion type; 0-PTP; 1-LIN * @param [in] moveDirection Motion direction; 0-Clockwise; 1-Counterclockwise * @param [in] offset Offset value * @return Error code */ public int MoveToIntersectLineStart(DescPose[] mainPoint, ExaxisPos[] mainExaxisPos, DescPose[] piecePoint, ExaxisPos[] pieceExaxisPos, int extAxisFlag, ExaxisPos exaxisPos, int tool, int wobj, double vel, double acc, double ovl, double oacc, int moveType, int moveDirection, DescPose offset); Intersecting Line Motion +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Intersecting line motion * @param [in] mainPoint Cartesian poses of 6 taught points on the main pipe * @param [in] mainExaxisPos Extended axis positions for 6 taught points on the main pipe * @param [in] piecePoint Cartesian poses of 6 taught points on the branch pipe * @param [in] pieceExaxisPos Extended axis positions for 6 taught points on the branch pipe * @param [in] extAxisFlag Whether to enable extended axis; 0-Disable; 1-Enable * @param [in] exaxisPos Start point extended axis positions * @param [in] tool Tool coordinate system number * @param [in] wobj Workpiece coordinate system number * @param [in] vel Velocity percentage * @param [in] acc Acceleration percentage * @param [in] ovl Velocity scaling factor * @param [in] oacc Acceleration scaling factor * @param [in] moveDirection Motion direction; 0-Clockwise; 1-Counterclockwise * @param [in] offset Offset value * @return Error code */ public int MoveIntersectLine(DescPose[] mainPoint, ExaxisPos[] mainExaxisPos, DescPose[] piecePoint, ExaxisPos[] pieceExaxisPos, int extAxisFlag, ExaxisPos[] exaxisPos, int tool, int wobj, double vel, double acc, double ovl, double oacc, int moveDirection, DescPose offset); Robot Intersecting Line Motion Code Example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static void TestIntersectLineMove(Robot robot) { DescPose[] mainPoint = new DescPose[6]; DescPose[] piecePoint = new DescPose[6]; ExaxisPos[] mainExaxisPos = new ExaxisPos[6]; ExaxisPos[] pieceExaxisPos = new ExaxisPos[6]; int extAxisFlag = 1; ExaxisPos[] exaxisPos = new ExaxisPos[4]; DescPose offset =new DescPose(0.0, 2.0 ,30.0, -2.0, 0.0, 0.0 ); mainPoint[0] = new DescPose(490.004, -383.194, 402.735, -9.332, -1.528, 69.594); mainPoint[1] = new DescPose(444.950, -407.117, 389.011, -5.546, -2.196, 65.279); mainPoint[2] = new DescPose(445.168, -463.605, 355.759, -1.544, -10.886, 57.104); mainPoint[3] = new DescPose(507.529, -485.385, 343.013, -0.786, -4.834, 61.799); mainPoint[4] = new DescPose(554.390, -442.647, 367.701, -4.761, -10.181, 64.925); mainPoint[5] = new DescPose(532.552, -394.003, 396.467, -13.732, -13.592, 67.411); mainExaxisPos[0] = new ExaxisPos(-29.996, 0.000, 0.000, 0.000 ); mainExaxisPos[1] = new ExaxisPos(-29.996, 0.000, 0.000, 0.000 ); mainExaxisPos[2] = new ExaxisPos(-29.996, 0.000, 0.000, 0.000 ); mainExaxisPos[3] = new ExaxisPos(-29.996, 0.000, 0.000, 0.000 ); mainExaxisPos[4] = new ExaxisPos(-29.996, 0.000, 0.000, 0.000 ); mainExaxisPos[5] = new ExaxisPos(-29.996, 0.000, 0.000, 0.000 ); piecePoint[0] = new DescPose( 505.571, -192.408, 316.759, 38.098, 37.051, 139.447); piecePoint[1] =new DescPose(533.837, -201.558, 332.340, 34.644, 42.339, 137.748); piecePoint[2] =new DescPose(530.386, -225.085, 373.808, 35.431, 45.111, 137.560); piecePoint[3] =new DescPose(485.646, -229.195, 383.778, 33.870, 45.173, 137.064); piecePoint[4] =new DescPose(460.551, -212.161, 354.256, 28.856, 45.602, 135.930); piecePoint[5] =new DescPose(474.217, -197.124, 324.611, 42.469, 41.133, 148.167); pieceExaxisPos[0] = new ExaxisPos( -29.996, -0.000, 0.000, 0.000); pieceExaxisPos[1] = new ExaxisPos( -29.996, -0.000, 0.000, 0.000); pieceExaxisPos[2] = new ExaxisPos( -29.996, -0.000, 0.000, 0.000); pieceExaxisPos[3] = new ExaxisPos( -29.996, -0.000, 0.000, 0.000); pieceExaxisPos[4] = new ExaxisPos( -29.996, -0.000, 0.000, 0.000); pieceExaxisPos[5] = new ExaxisPos( -29.996, -0.000, 0.000, 0.000); exaxisPos[0] = new ExaxisPos(-29.996, -0.000, 0.000, 0.000); exaxisPos[1] = new ExaxisPos(-44.994, 90.000, 0.000, 0.000); exaxisPos[2] = new ExaxisPos(-59.992, 0.002, 0.000, 0.000); exaxisPos[3] = new ExaxisPos(-44.994, -89.997, 0.000, 0.000); int tool = 2; int wobj = 0; double vel = 100.0; double acc = 100.0; double ovl = 12.0; double oacc = 12.0; int moveType = 1; int moveDirection = 1; int rtn = robot.MoveToIntersectLineStart(mainPoint, mainExaxisPos, piecePoint, pieceExaxisPos, extAxisFlag, exaxisPos[0], tool, wobj, vel, acc, ovl, oacc, moveType, moveDirection, offset); System.out.printf("MoveToIntersectLineStart rtn is %d\n", rtn); rtn = robot.MoveIntersectLine(mainPoint, mainExaxisPos, piecePoint, pieceExaxisPos, extAxisFlag, exaxisPos, tool, wobj, vel, acc, 5.0, 5.0, moveDirection, offset); System.out.printf("MoveIntersectLine rtn is %d\n", rtn); robot.CloseRPC(); return ; } Stationary Air Motion +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Stationary Air Motion * @return Error code */ public int MoveStationary() Stationary Air Motion Code Example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static void test_RecordandReplay(Robot robot) { int rtn = robot.LaserSensorRecordandReplay(0, 10, 1, 0, 0.1, 1, 1, 10, 100); System.out.printf("LaserSensorRecordandReplay rtn is %d\n", rtn); rtn = robot.MoveStationary(); System.out.printf("MoveStationary rtn is %d\n", rtn); rtn = robot.LaserSensorRecord1(0, 10); System.out.printf("LaserSensorRecordandReplay rtn is %d\n", rtn); robot.CloseRPC(); robot.Sleep(9999999); } Fixed-Point Swing Start +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief Start fixed-point swing * @param [in] weaveNum Swing number [0-7] * @param [in] mode 0-Tool coordinate system; 1-Reference point * @param [in] refPoint Reference point Cartesian coordinates [x,y,z,a,b,c] * @param [in] weaveTime Swing time [s] * @return Error code */ public int OriginPointWeaveStart(int weaveNum, int mode, DescPose refPoint, double weaveTime) Fixed-Point Swing End +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: /** * @brief End fixed-point swing * @return Error code */ public int OriginPointWeaveEnd(); Fixed-Point Swing SDK Code Example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestOriginPointWeave(Robot robot) { JointPos j = new JointPos(39.886, -98.580, -124.032, -47.393, 90.000, 40.842); ExaxisPos epos = new ExaxisPos(0, 0, 0, 0); DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0); DescPose refPoint = new DescPose(400.021, 300.022, 299.996, 179.997, -0.003, -90.956); robot.MoveJ(j, 1, 0, 100, 100, 100.0, epos, -1.0, 0, offset_pos); robot.OriginPointWeaveStart(0, 0, refPoint, 3); robot.MoveStationary(); robot.OriginPointWeaveEnd(); robot.Sleep(2000); robot.MoveJ(j, 1, 0, 100, 100, 100.0, epos, -1.0, 0, offset_pos); robot.OriginPointWeaveStart(0, 1, refPoint, 3); robot.MoveStationary(); robot.OriginPointWeaveEnd(); robot.Sleep(1000); return 0; } Fixed-Point Swing (Including Laser and Extension Axis) SDK Code Example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: Java :linenos: public static int TestOriginPointWeave(Robot robot) { JointPos j = new JointPos(39.886, -98.580, -124.032, -47.393, 90.000, 40.842); ExaxisPos epos1 = new ExaxisPos(0, 0, 0, 0); DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0); ExaxisPos epos2 = new ExaxisPos(5, 0, 0, 0); DescPose refPoint = new DescPose(400.021, 300.022, 299.996, 179.997, -0.003, -90.956); int rtn = 0; robot.LaserTrackingSensorConfig("192.168.58.20", 5020); robot.LaserTrackingSensorSamplePeriod(20); robot.LoadPosSensorDriver(101); // Load UDP driver robot.ExtDevLoadUDPDriver(); // Set extension axis command completion time rtn = robot.SetExAxisCmdDoneTime(5000.0); System.out.println("SetExAxisCmdDoneTime rtn is " + rtn); // Enable extension axes 1 and 2 rtn = robot.ExtAxisServoOn(1, 1); System.out.println("ExtAxisServoOn axis id 1 rtn is " + rtn); rtn = robot.ExtAxisServoOn(2, 1); System.out.println("ExtAxisServoOn axis id 2 rtn is " + rtn); robot.Sleep(2000); // Set extension axis homing robot.ExtAxisSetHoming(1, 0, 10, 2); robot.LaserTrackingLaserOnOff(1,0); // 1---Without extension axis robot.LaserTrackingTrackOnOff(1, 4); robot.Sleep(200); // Start fixed-point swing robot.OriginPointWeaveStart(0, 0, refPoint, 10); robot.MoveStationary(); // Execute stationary motion (assuming this method exists) robot.OriginPointWeaveEnd(); robot.LaserTrackingTrackOnOff(0, 4); robot.Sleep(2000); // Wait 2 seconds // 2----With extension axis robot.ExtAxisMove(epos1, 100, -1); robot.LaserTrackingTrackOnOff(1, 4); // Start fixed-point swing robot.OriginPointWeaveStart(0, 0, refPoint, 20); robot.ExtAxisMove(epos2, 100, -1); robot.OriginPointWeaveEnd(); robot.LaserTrackingTrackOnOff(0, 4); robot.Sleep(1000); return 0; }