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