6. Robot common settings
6.1. Set tool reference point - six point method
1/**
2* @brief Set tool reference point - six point method
3* @param [in] point_num Point number, range [1~6]
4* @return Error code
5*/
6int SetToolPoint(int point_num);
6.2. Calculate tool coordinate system - six point method
1/**
2* @brief Calculate tool coordinate system
3* @param [out] tcp_pose Tool coordinate system
4* @return Error code
5*/
6int ComputeTool(DescPose tcp_pose);
6.3. Set tool reference point - four point method
1/**
2* @brief Set tool reference point - four point method
3* @param [in] point_num Point number, range [1~4]
4* @return Error code
5*/
6int SetTcp4RefPoint(int point_num);
6.4. Calculate tool coordinate system - four point method
1/**
2* @brief Calculate tool coordinate system
3* @param [out] tcp_pose Tool coordinate system
4* @return Error code
5*/
6int ComputeTcp4(DescPose tcp_pose);
6.5. Calculate tool coordinate system based on point information
1/**
2* @brief Calculate tool coordinate system based on point information
3* @param [in] method Calculation method; 0-four point method; 1-six point method
4* @param [in] pos Joint position group, array length is 4 for four point method, 6 for six point method
5* @param [out] tool_pose Output tool coordinate system
6* @return Error code
7*/
8int ComputeToolCoordWithPoints(int method, JointPos[] pos, DescPose tool_pose);
6.6. Set tool coordinate system
1/**
2* @brief Set tool coordinate system
3* @param [in] id Coordinate system number, range [0~14]
4* @param [in] coord Tool center point pose relative to end flange center
5* @param [in] type 0-tool coordinate system, 1-sensor coordinate system
6* @param [in] install Installation position, 0-robot end, 1-external to robot
7* @param [in] toolID Tool ID
8* @param [in] loadNum Load number
9* @return Error code
10*/
11int SetToolCoord(int id, DescPose coord, int type, int install, int toolID, int loadNum);
6.7. Set tool coordinate system list
1/**
2* @brief Set tool coordinate system list
3* @param [in] id Coordinate system number, range [0~14]
4* @param [in] coord Tool center point pose relative to end flange center
5* @param [in] type 0-tool coordinate system, 1-sensor coordinate system
6* @param [in] install Installation position, 0-robot end, 1-external to robot
7* @param [in] loadNum Load number
8* @return Error code
9*/
10int SetToolList(int id, DescPose coord, int type, int install, int loadNum);
6.8. Get current tool coordinate system
1/**
2* @brief Get current tool coordinate system
3* @param [in] flag 0-blocking, 1-non-blocking
4* @param [out] desc_pos Tool coordinate system pose
5* @return Error code
6*/
7int GetTCPOffset(int flag, DescPose desc_pos);
6.9. Robot tool coordinate system operation code example
1public static int TestTCPCompute(Robot robot)
2{
3 DescPose p1Desc=new DescPose(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
4 JointPos p1Joint=new JointPos(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);
5
6 DescPose p2Desc=new DescPose(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
7 JointPos p2Joint=new JointPos(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);
8
9 DescPose p3Desc=new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
10 JointPos p3Joint=new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
11
12 DescPose p4Desc=new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
13 JointPos p4Joint=new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
14
15 DescPose p5Desc=new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
16 JointPos p5Joint=new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
17
18 DescPose p6Desc=new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
19 JointPos p6Joint=new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
20
21 ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
22 DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
23
24 JointPos[] posJ = { p1Joint , p2Joint , p3Joint , p4Joint , p5Joint , p6Joint };
25 DescPose coordRtn =new DescPose() {};
26 int rtn = robot.ComputeToolCoordWithPoints(1, posJ, coordRtn);
27
28 robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
29 robot.SetToolPoint(1);
30 robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
31 robot.SetToolPoint(2);
32 robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
33 robot.SetToolPoint(3);
34 robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
35 robot.SetToolPoint(4);
36 robot.MoveJ(p5Joint, p5Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
37 robot.SetToolPoint(5);
38 robot.MoveJ(p6Joint, p6Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
39 robot.SetToolPoint(6);
40 rtn = robot.ComputeTool(coordRtn);
41 robot.SetToolList(3, coordRtn, 0, 0, 0);
42
43 robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
44 robot.SetTcp4RefPoint(1);
45 robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
46 robot.SetTcp4RefPoint(2);
47 robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
48 robot.SetTcp4RefPoint(3);
49 robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
50 robot.SetTcp4RefPoint(4);
51 rtn = robot.ComputeTcp4(coordRtn);
52
53 robot.SetToolCoord(4, coordRtn, 0, 0, 1, 0);
54
55 DescPose getCoord = new DescPose(){};
56 rtn = robot.GetTCPOffset(0, getCoord);
57 return 0;
58}
6.10. Set external tool reference point - six point method
1/**
2* @brief Set external tool reference point - three point method
3* @param [in] point_num Point number, range [1~3]
4* @return Error code
5*/
6int SetExTCPPoint(int point_num);
6.11. Calculate external tool coordinate system - six point method
1/**
2* @brief Calculate external tool coordinate system - three point method
3* @param [out] tcp_pose External tool coordinate system
4* @return Error code
5*/
6int ComputeExTCF(DescPose tcp_pose);
6.12. Set external tool coordinate system
1/**
2* @brief Set external tool coordinate system
3* @param [in] id Coordinate system number, range [0~14]
4* @param [in] etcp Tool center point pose relative to end flange center
5* @param [in] etool To be determined
6* @return Error code
7*/
8int SetExToolCoord(int id, DescPose etcp, DescPose etool);
6.13. Set external tool coordinate system list
1/**
2* @brief Set external tool coordinate system list
3* @param [in] id Coordinate system number, range [0~14]
4* @param [in] etcp Tool center point pose relative to end flange center
5* @param [in] etool To be determined
6* @return Error code
7*/
8int SetExToolList(int id, DescPose etcp, DescPose etool);
6.14. Robot external tool coordinate system operation code example
1public static int TestExtCoord(Robot robot)
2{
3 DescPose p1Desc=new DescPose(-89.606, 779.517, 193.516, 178.000, 0.476, -92.484);
4 JointPos p1Joint=new JointPos(-108.145, -50.137, 85.818, -125.599, -87.946, 74.329);
5
6 DescPose p2Desc=new DescPose(-24.656, 850.384, 191.361, 177.079, -2.058, -95.355);
7 JointPos p2Joint=new JointPos(-111.024, -41.538, 69.222, -114.913, -87.743, 74.329);
8
9 DescPose p3Desc=new DescPose(-99.813, 766.661, 241.878, -176.817, 1.917, -91.604);
10 JointPos p3Joint=new JointPos(-107.266, -56.116, 85.971, -122.560, -92.548, 74.331);
11
12 robot.GetForwardKin(p1Joint,p1Desc);
13 robot.GetForwardKin(p2Joint,p2Desc);
14 robot.GetForwardKin(p3Joint,p3Desc);
15
16 ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
17 DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
18
19 DescPose[] posTCP = { p1Desc , p2Desc , p3Desc };
20 DescPose coordRtn = new DescPose();
21
22 robot.MoveJ(p1Joint, p1Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
23 robot.SetExTCPPoint(1);
24 robot.MoveJ(p2Joint, p2Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
25 robot.SetExTCPPoint(2);
26 robot.MoveJ(p3Joint, p3Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
27 robot.SetExTCPPoint(3);
28 int rtn = robot.ComputeExTCF(coordRtn);
29
30 robot.SetExToolCoord(1, coordRtn, offdese);
31 robot.SetExToolList(1, coordRtn, offdese);
32 return 0;
33}
6.15. Set workpiece reference point - three point method
1/**
2* @brief Set workpiece reference point - three point method
3* @param [in] point_num Point number, range [1~3]
4* @return Error code
5*/
6int SetWObjCoordPoint(int point_num);
6.16. Calculate workpiece coordinate system
1/**
2* @brief Calculate workpiece coordinate system
3* @param [in] method Calculation method 0: origin-x axis-z axis 1: origin-x axis-xy plane
4* @param [in] refFrame Reference coordinate system
5* @param [out] wobj_pose Workpiece coordinate system
6* @return Error code
7*/
8int ComputeWObjCoord(int method, int refFrame, DescPose wobj_pose);
6.17. Set workpiece coordinate system
1/**
2* @brief Set workpiece coordinate system
3* @param [in] id Coordinate system number, range [1~15]
4* @param [in] coord Workpiece coordinate system pose relative to end flange center
5* @param [in] refFrame Reference coordinate system
6* @return Error code
7*/
8int SetWObjCoord(int id, DescPose coord, int refFrame);
6.18. Set workpiece coordinate system list
1/**
2* @brief Set workpiece coordinate system list
3* @param [in] id Coordinate system number, range [1~15]
4* @param [in] coord Workpiece coordinate system pose relative to end flange center
5* @param [in] refFrame Reference coordinate system
6* @return Error code
7*/
8int SetWObjList(int id, DescPose coord, int refFrame);
6.19. Calculate workpiece coordinate system based on point information
1/**
2* @brief Calculate workpiece coordinate system based on point information
3* @param [in] method Calculation method; 0: origin-x axis-z axis 1: origin-x axis-xy plane
4* @param [in] pos Three TCP position groups
5* @param [in] refFrame Reference coordinate system
6* @param [in] tcp_pose Output workpiece coordinate system
7* @return Error code
8*/
9int ComputeWObjCoordWithPoints(int method, DescPose[] pos, int refFrame,DescPose tcp_pose);
6.20. Get current workpiece coordinate system
1/**
2* @brief Get current workpiece coordinate system
3* @param [in] flag 0-blocking, 1-non-blocking
4* @param [out] desc_pos Workpiece coordinate system pose
5* @return Error code
6*/
7int GetWObjOffset(int flag, DescPose desc_pos);
6.21. Workpiece coordinate system operation code example
1public static int TestWobjCoord(Robot robot)
2{
3 DescPose p1Desc=new DescPose(-89.606, 779.517, 193.516, 178.000, 0.476, -92.484);
4 JointPos p1Joint=new JointPos(-108.145, -50.137, 85.818, -125.599, -87.946, 74.329);
5
6 DescPose p2Desc=new DescPose(-24.656, 850.384, 191.361, 177.079, -2.058, -95.355);
7 JointPos p2Joint=new JointPos(-111.024, -41.538, 69.222, -114.913, -87.743, 74.329);
8
9 DescPose p3Desc=new DescPose(-99.813, 766.661, 241.878, -176.817, 1.917, -91.604);
10 JointPos p3Joint=new JointPos(-107.266, -56.116, 85.971, -122.560, -92.548, 74.331);
11
12 robot.GetForwardKin(p1Joint,p1Desc);
13 robot.GetForwardKin(p2Joint,p2Desc);
14 robot.GetForwardKin(p3Joint,p3Desc);
15
16 ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
17 DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
18
19 DescPose[] posTCP =new DescPose[]{p1Desc , p2Desc , p3Desc };
20 DescPose coordRtn =new DescPose();
21 int rtn = robot.ComputeWObjCoordWithPoints(1, posTCP, 0, coordRtn);
22
23 robot.MoveJ(p1Joint, p1Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
24 robot.SetWObjCoordPoint(1);
25 robot.MoveJ(p2Joint, p2Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
26 robot.SetWObjCoordPoint(2);
27 robot.MoveJ(p3Joint, p3Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
28 robot.SetWObjCoordPoint(3);
29 rtn = robot.ComputeWObjCoord(1, 0, coordRtn);
30
31 robot.SetWObjCoord(1, coordRtn, 0);
32 robot.SetWObjList(1, coordRtn, 0);
33
34 DescPose getWobjDesc = new DescPose();
35 rtn = robot.GetWObjOffset(0, getWobjDesc);
36 return 0;
37}
6.22. Set global speed
1/**
2* @brief Set global speed
3* @param [in] vel Speed percentage, range [0~100]
4* @return Error code
5*/
6int SetSpeed(int vel);
6.23. Set robot acceleration
1/**
2* @brief Set robot acceleration
3* @param [in] acc Robot acceleration percentage
4* @return Error code
5*/
6int SetOaccScale(double acc);
6.24. Get robot default speed
1/**
2* @brief Get robot default speed
3* @return List[0]:int Error code; List[1]: double vel Speed, unit mm/s
4*/
5List<Number> GetDefaultTransVel();
6.25. Set end load weight
1/**
2* @brief Set end load weight
3* @param [in] loadNum Load number
4* @param [in] weight Load weight, unit kg
5* @return Error code
6*/
7int SetLoadWeight(int loadNum,double weight);
6.26. Set end load center of mass coordinates
1/**
2* @brief Set end load center of mass coordinates
3* @param [in] coord Center of mass coordinates, unit mm
4* @return Error code
5*/
6int SetLoadCoord(DescTran coord);
6.27. Set End Effector Load Center of Mass Coordinates
1/**
2 * @brief Set end effector load center of mass coordinates
3 * @param [in] loadNum Load number
4 * @param [in] coord Center of mass coordinates, unit: mm
5 * @return Error code
6 */
7public int SetLoadCoord(int loadNum, DescTran coord)
6.28. Get current load weight
1/**
2* @brief Get current load weight
3* @param [in] flag 0-blocking, 1-non-blocking
4* @return List[0]:int Error code; List[1]: double weight Load weight, unit kg
5*/
6List<Number> GetTargetPayload(int flag);
6.29. Get current load center of mass
1/**
2* @brief Get current load center of mass
3* @param [in] flag 0-blocking, 1-non-blocking
4* @param [out] cog Load center of mass, unit mm
5* @return Error code
6*/
7int GetTargetPayloadCog(int flag, DescTran cog);
6.30. Set robot installation method
1/**
2* @brief Set robot installation method
3* @param [in] install Installation method, 0-standard, 1-side, 2-inverted
4* @return Error code
5*/
6int SetRobotInstallPos(int install);
6.31. Set robot installation angle
1/**
2* @brief Set robot installation angle, free installation
3* @param [in] yangle Tilt angle
4* @param [in] zangle Rotation angle
5* @return Error code
6*/
7int SetRobotInstallAngle(double yangle, double zangle);
6.32. Get robot installation angle
1/**
2* @brief Get robot installation angle
3* @return List[0]:Error code; List[1]:double yangle Tilt angle; List[2]:double zangle Rotation angle
4*/
5public List<Number> GetRobotInstallAngle()
6.33. Set system variable value
1/**
2* @brief Set system variable value
3* @param [in] id Variable number, range [1~20]
4* @param [in] value Variable value
5* @return Error code
6*/
7int SetSysVarValue(int id, double value);
6.34. Get system variable value
1/**
2* @brief Get system variable value
3* @param [in] id System variable number, range [1~20]
4* @return List[0]:Error code; List[1]:double value System variable value
5*/
6List<Number> GetSysVarValue(int id);
6.35. Robot common settings code example
1public static int TestLoadInstall(Robot robot)
2{
3 for (int i = 1; i < 100; i++)
4 {
5 robot.SetSpeed(i);
6 robot.SetOaccScale(i);
7 robot.Sleep(30);
8 }
9
10 List<Number> defaultVel=new ArrayList<>();
11
12 defaultVel=robot.GetDefaultTransVel();
13 System.out.println("GetDefaultTransVel is:"+ defaultVel.get(1));
14
15 for (int i = 1; i < 21; i++)
16 {
17 robot.SetSysVarValue(i, i + 0.5);
18 robot.Sleep(100);
19 }
20
21 for (int i = 1; i < 21; i++)
22 {
23 float value = 0;
24 defaultVel=robot.GetSysVarValue(i);
25 System.out.println("sys value :"+i+", is :"+defaultVel.get(1));
26 robot.Sleep(100);
27 }
28
29 robot.SetLoadWeight(0, 2.5);
30
31 DescTran loadCoord = new DescTran();
32 loadCoord.x = 3.0;
33 loadCoord.y = 4.0;
34 loadCoord.z = 5.0;
35 robot.SetLoadCoord(loadCoord);
36
37 robot.Sleep(1000);
38
39 List<Number> getLoad = new ArrayList<>();
40
41 getLoad=robot.GetTargetPayload(0);
42
43 DescTran getLoadTran =new DescTran();
44 robot.GetTargetPayloadCog(0, getLoadTran);
45 System.out.println("get load is:"+getLoad.get(1)+", get load cog is: "+getLoadTran.x+","+getLoadTran.y+","+getLoadTran.z);
46
47 robot.SetRobotInstallPos(0);
48 robot.SetRobotInstallAngle(15.0, 25.0);
49
50 List<Number> angle=new ArrayList<>();
51 angle=robot.GetRobotInstallAngle();
52 System.out.println("GetRobotInstallAngle x:"+angle.get(1)+"; y:"+angle.get(2));
53
54 robot.CloseRPC();
55 return 0;
56}
6.36. Joint friction compensation switch
1/**
2* @brief Joint friction compensation switch
3* @param [in] state 0-off, 1-on
4* @return Error code
5*/
6int FrictionCompensationOnOff(int state);
6.37. Set joint friction compensation coefficient - standard installation
1/**
2* @brief Set joint friction compensation coefficient - standard installation
3* @param [in] coeff Six joint compensation coefficients, range [0~1]
4* @return Error code
5*/
6int SetFrictionValue_level(Object[] coeff);
6.38. Set joint friction compensation coefficient - side installation
1/**
2* @brief Set joint friction compensation coefficient - side installation
3* @param [in] coeff Six joint compensation coefficients, range [0~1]
4* @return Error code
5*/
6int SetFrictionValue_wall(Object[] coeff);
6.39. Set joint friction compensation coefficient - inverted installation
1/**
2* @brief Set joint friction compensation coefficient - inverted installation
3* @param [in] coeff Six joint compensation coefficients, range [0~1]
4* @return Error code
5*/
6int SetFrictionValue_ceiling(Object[] coeff);
6.40. Set joint friction compensation coefficient - free installation
1/**
2* @brief Set joint friction compensation coefficient - free installation
3* @param [in] coeff Six joint compensation coefficients, range [0~1]
4* @return Error code
5*/
6int SetFrictionValue_freedom(Object[] coeff);
6.41. Robot set joint friction compensation code example
1public static int TestFriction(Robot robot)
2{
3
4 Object[] lcoeff = { 0.9,0.9,0.9,0.9,0.9,0.9 };
5 Object[] wcoeff = { 0.4,0.4,0.4,0.4,0.4,0.4 };
6 Object[] ccoeff = { 0.6,0.6,0.6,0.6,0.6,0.6 };
7 Object[] fcoeff = { 0.5,0.5,0.5,0.5,0.5,0.5 };
8
9 int rtn = robot.FrictionCompensationOnOff(1);
10 System.out.println("FrictionCompensationOnOff rtn is:"+ rtn);
11
12 rtn = robot.SetFrictionValue_level(lcoeff);
13 System.out.println("SetFrictionValue_level rtn is:"+ rtn);
14
15 rtn = robot.SetFrictionValue_wall(wcoeff);
16 System.out.println("SetFrictionValue_wall rtn is:"+ rtn);
17
18 rtn = robot.SetFrictionValue_ceiling(ccoeff);
19 System.out.println("SetFrictionValue_ceiling rtn is:"+ rtn);
20
21 rtn = robot.SetFrictionValue_freedom(fcoeff);
22 System.out.println("SetFrictionValue_freedom rtn is:"+ rtn);
23
24 robot.CloseRPC();
25 return 0;
26}
6.42. Query robot error code
1/**
2 * @brief Query robot error code
3 * @param [out] maincode Main error code
4 * @param [out] subcode Sub error code
5 * @return Error code
6 */
7int GetRobotErrorCode(int[] maincode, int[] subcode);
6.43. Error state clear
1/**
2* @brief Error state clear
3* @return Error code
4*/
5int ResetAllError();
6.44. Robot fault state get and clear error code example
1public static int TestGetError(Robot robot)
2{
3 int[] maincode={0}, subcode={0};
4 robot.GetRobotErrorCode(maincode, subcode);
5
6 robot.ResetAllError();
7
8 robot.Sleep(1000);
9
10 robot.GetRobotErrorCode(maincode, subcode);
11 return 0;
12}
6.45. Set wide voltage control box temperature and fan speed monitoring parameters
New in version Java: SDK-v1.0.6-3.8.3
1/**
2* @brief Set wide voltage control box temperature and fan speed monitoring parameters
3* @param [in] enable 0-disable monitoring; 1-enable monitoring
4* @param [in] period Monitoring period(s), range 1-100
5* @return Error code
6*/
7int SetWideBoxTempFanMonitorParam(int enable, int period);
6.46. Get wide voltage control box temperature and fan speed monitoring parameters
New in version Java: SDK-v1.0.6-3.8.3
1/**
2* @brief Get wide voltage control box temperature and fan speed monitoring parameters
3* @return List[0]-Error code,List[1]-enable 0-disable monitoring; 1-enable monitoring,List[2]-period Monitoring period(s), range 1-100
4*/
5List<Number> GetWideBoxTempFanMonitorParam()
6.47. Wide voltage control box temperature and fan current state get code example
1public static void TestWideVoltageCtrlBoxtemp(Robot robot)
2{
3 robot.SetWideBoxTempFanMonitorParam(1, 2);
4 List<Number> list=robot.GetWideBoxTempFanMonitorParam();
5 System.out.println("GetWideBoxTempFanMonitorParam enable is:"+list.get(1)+", period is:"+list.get(2));
6 ROBOT_STATE_PKG pkg=new ROBOT_STATE_PKG();
7 for (int i = 0; i < 100; i++)
8 {
9 pkg=robot.GetRobotRealTimeState();
10 System.out.println("robot ctrl box temp is:"+pkg.wideVoltageCtrlBoxTemp+",fan current is:"+pkg.wideVoltageCtrlBoxFanCurrent);
11 robot.Sleep(100);
12 }
13
14 int rtn = robot.SetWideBoxTempFanMonitorParam(0, 2);
15
16 list=robot.GetWideBoxTempFanMonitorParam();
17 for (int i = 0; i < 100; i++)
18 {
19 pkg=robot.GetRobotRealTimeState();
20 System.out.println("robot ctrl box temp is:"+pkg.wideVoltageCtrlBoxTemp+" ,fan current is:"+pkg.wideVoltageCtrlBoxFanCurrent);
21 robot.Sleep(100);
22 }
23
24 robot.CloseRPC();
25 robot.Sleep(2000);
26 return 0;
27}
6.48. Set Focus Calibration Point
New in version Java: SDK-v1.0.7-3.8.4
1/**
2* @brief Set focus calibration point
3* @param [in] pointNum Focus calibration point number (1-8)
4* @param [in] point Calibration point coordinates
5* @return Error code
6*/
7int SetFocusCalibPoint(int pointNum, DescPose point)
6.49. Compute Focus Calibration Result
New in version Java: SDK-v1.0.7-3.8.4
1/**
2* @brief Compute focus calibration result
3* @param [in] pointNum Number of calibration points
4* @param [in] resultPos Calibration result XYZ
5* @param [out] accuracy Calibration accuracy error
6* @return Error code
7*/
8int ComputeFocusCalib(int pointNum, DescTran resultPos, double[] accuracy)
6.50. Start focus following
New in version Java: SDK-v1.0.7-3.8.4
1/**
2* @brief Start focus following
3* @param [in] kp Proportional parameter (default: 50.0)
4* @param [in] kpredict Feedforward parameter (default: 19.0)
5* @param [in] aMax Maximum angular acceleration limit (default: 1440°/s²)
6* @param [in] vMax Maximum angular velocity limit (default: 180°/s)
7* @param [in] type Lock X-axis direction (0-Reference input vector; 1-Horizontal; 2-Vertical)
8* @return Error code
9*/
10int FocusStart(double kp, double kpredict, double aMax, double vMax, int type)
6.51. Stop Focus Following
New in version Java: SDK-v1.0.7-3.8.4
1/**
2* @brief Stop focus following
3* @return Error code
4*/
5int FocusEnd()
6.52. Set Focus Position
New in version Java: SDK-v1.0.7-3.8.4
1/**
2* @brief Set focus position
3* @param pos Focus position XYZ
4* @return Error code
5*/
6public int SetFocusPosition(DescTran pos)
6.53. Focus Following Code Example
1public static void TestFocus(Robot robot){
2 DescPose p1Desc=new DescPose(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
3 JointPos p1Joint = new JointPos(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);
4
5 DescPose p2Desc = new DescPose(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
6 JointPos p2Joint = new JointPos(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);
7
8 DescPose p3Desc = new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
9 JointPos p3Joint = new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
10
11 DescPose p4Desc = new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
12 JointPos p4Joint = new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
13
14 DescPose p5Desc = new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
15 JointPos p5Joint = new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
16
17 DescPose p6Desc = new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
18 JointPos p6Joint = new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
19
20 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
21 DescPose offdese = new DescPose(0, 0, 100, 0, 0, 0);
22
23 robot.GetForwardKin(p1Joint, p1Desc);
24 robot.GetForwardKin(p2Joint, p2Desc);
25 robot.GetForwardKin(p3Joint, p3Desc);
26 robot.GetForwardKin(p4Joint, p4Desc);
27 robot.GetForwardKin(p5Joint, p5Desc);
28 robot.GetForwardKin(p6Joint, p6Desc);
29
30 robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
31 robot.SetTcp4RefPoint(1);
32 robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
33 robot.SetTcp4RefPoint(2);
34 robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
35 robot.SetTcp4RefPoint(3);
36 robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
37 robot.SetTcp4RefPoint(4);
38
39 DescPose coordRtn = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
40 int rtn = robot.ComputeTcp4( coordRtn);
41
42 robot.SetToolCoord(1, coordRtn, 0, 0, 1, 0);
43
44 robot.GetForwardKin(p1Joint, p1Desc);
45 robot.GetForwardKin(p2Joint, p2Desc);
46 robot.GetForwardKin(p3Joint, p3Desc);
47
48 robot.SetFocusCalibPoint(1, p1Desc);
49 robot.SetFocusCalibPoint(2, p2Desc);
50 robot.SetFocusCalibPoint(3, p3Desc);
51
52 DescTran resultPos = new DescTran(0.0, 0.0, 0.0);
53 double[] accuracy = {0.0};
54 rtn = robot.ComputeFocusCalib(3, resultPos, accuracy);
55 rtn = robot.SetFocusPosition(resultPos);
56
57 robot.GetForwardKin(p5Joint, p5Desc);
58 robot.GetForwardKin(p6Joint, p6Desc);
59
60 robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
61 robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
62
63 robot.FocusStart(50, 19, 710, 90, 0);
64 robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
65 robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
66 robot.FocusEnd();
67}
6.54. Joint Torque Sensor Sensitivity Calibration Function Enabled
1/**
2* @brief Joint torque sensor sensitivity calibration function enabled
3* @param status 0-Disabled; 1-Enabled
4* @return Error code
5*/
6public int JointSensitivityEnable(int status)
6.55. Joint Torque Sensor Sensitivity Data Acquisition
1/**
2* @brief Joint Torque Sensor Sensitivity Data Collection
3* @return Error code
4*/
5public int JointSensitivityCollect()
6.56. Get Joint Torque Sensor Sensitivity Calibration Results
1/**
2* @brief Get joint torque sensor sensitivity calibration results
3* @param calibResult j1~j6 joint sensitivity [0-1]
4* @param linearity j1~j6 joint linearity [0-1]
5* @return Error code
6*/
7public int JointSensitivityCalibration(double[] calibResult, double[] linearity)
6.57. Get Joint Torque Sensor Hysteresis Error
1/**
2* @brief Get joint torque sensor hysteresis error
3* @param hysteresisError j1~j6 joint hysteresis error
4* @return Error code
5*/
6public int JointHysteresisError(double[] hysteresisError);
6.58. Get Joint Torque Sensor Repeatability
1/**
2* @brief Get joint torque sensor repeatability
3* @param repeatability j1~j6 joint torque sensor repeatability
4* @return Error code
5*/
6public int JointRepeatability(double[] repeatability);
6.59. Set Joint Force Sensor Parameters
1/**
2* @brief Set joint force sensor parameters
3* @param required M J1-J6 mass coefficient []
4* @param required B J1-J6 damping coefficient []
5* @param required K J1-J6 stiffness coefficient []
6* @param default threshold Force control threshold, Nm
7* @param default sensitivity Sensitivity, Nm/V, []
8* @param default setZeroFlag Function enable flag; 0-Off; 1-On; 2-Record zero point at position 1; 3-Record zero point at position 2
9* @return Error code
10*/
11public int SetAdmittanceParams(double[] M, double[] B, double[] K, double[] threshold, double[] sensitivity, int setZeroFlag);
6.60. Joint Torque Sensor Sensitivity Auto-Calibration Code Example
1public static void TestSensitivityCalib(Robot robot)
2{
3 int rtn = robot.JointSensitivityEnable(0);
4 rtn = robot.JointSensitivityEnable(1);
5 System.out.printf("JointSensitivityEnable rtn is %d\n", rtn);
6 JointPos curJPos = new JointPos();
7 robot.GetActualJointPosDegree(curJPos);
8 ExaxisPos epos = new ExaxisPos(0,0,0,0);
9 DescPose offset_pos =new DescPose(0,0,0,0,0,0 );
10 JointPos jointPos1 = new JointPos(curJPos.J1, 0, 0, -90, 0.02, curJPos.J6);
11 DescPose descPos1 = new DescPose();
12 robot.GetForwardKin(jointPos1, descPos1);
13 robot.MoveJ(jointPos1, descPos1, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
14 robot.Sleep(200);
15 rtn = robot.JointSensitivityCollect();
16 System.out.printf("JointSensitivityCollect 1 rtn is %d\n", rtn);
17 robot.Sleep(100);
18 JointPos jointPos2 =new JointPos( curJPos.J1, -30, 0, -90, 0.02, curJPos.J6 );
19 DescPose descPos2 =new DescPose();
20 robot.GetForwardKin(jointPos2, descPos2);
21 robot.MoveJ(jointPos2, descPos2, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
22 robot.Sleep(100);
23 rtn = robot.JointSensitivityCollect();
24 System.out.printf("JointSensitivityCollect 2 rtn is %d\n", rtn);
25 robot.Sleep(100);
26 JointPos jointPos3 = new JointPos( curJPos.J1, -60, 0, -90, 0.02, curJPos.J6 );
27 DescPose descPos3 =new DescPose();
28 robot.GetForwardKin(jointPos3, descPos3);
29 robot.MoveJ(jointPos3, descPos3, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
30 robot.Sleep(100);
31 rtn = robot.JointSensitivityCollect();
32 System.out.printf("JointSensitivityCollect 3 rtn is %d\n", rtn);
33 robot.Sleep(100);
34 JointPos jointPos4 = new JointPos(curJPos.J1, -90, 0, -90, 0.02, curJPos.J6);
35 DescPose descPos4 = new DescPose();
36 robot.GetForwardKin(jointPos4, descPos4);
37 robot.MoveJ(jointPos4, descPos4, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
38 robot.Sleep(100);
39 rtn = robot.JointSensitivityCollect();
40 System.out.printf("JointSensitivityCollect 4 rtn is %d\n", rtn);
41 robot.Sleep(100);
42 JointPos jointPos5 = new JointPos(curJPos.J1, -120, 0, -90, 0.02, curJPos.J6);
43 DescPose descPos5 = new DescPose();
44 robot.GetForwardKin(jointPos5, descPos5);
45 robot.MoveJ(jointPos5, descPos5, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
46 robot.Sleep(100);
47 rtn = robot.JointSensitivityCollect();
48 System.out.printf("JointSensitivityCollect 5 rtn is %d\n", rtn);
49 robot.Sleep(100);
50 JointPos jointPos6 = new JointPos(curJPos.J1, -150, 0, -90, 0.02, curJPos.J6);
51 DescPose descPos6 = new DescPose();
52 robot.GetForwardKin(jointPos6, descPos6);
53 robot.MoveJ(jointPos6, descPos6, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
54 robot.Sleep(100);
55 rtn = robot.JointSensitivityCollect();
56 System.out.printf("JointSensitivityCollect 6 rtn is %d\n", rtn);
57 robot.Sleep(100);
58 JointPos jointPos7 = new JointPos(curJPos.J1, -180, 0, -90, 0.02, curJPos.J6);
59 DescPose descPos7 = new DescPose();
60 robot.GetForwardKin(jointPos7, descPos7);
61 robot.MoveJ(jointPos7, descPos7, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
62 robot.Sleep(100);
63 rtn = robot.JointSensitivityCollect();
64 System.out.printf("JointSensitivityCollect 7 rtn is %d\n", rtn);
65 robot.Sleep(100);
66 // Reverse stroke
67 robot.MoveJ(jointPos6, descPos6, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
68 robot.Sleep(100);
69 rtn = robot.JointSensitivityCollect();
70 System.out.printf("JointSensitivityCollect 8 rtn is %d\n", rtn);
71 robot.Sleep(100);
72 robot.MoveJ(jointPos5, descPos5, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
73 robot.Sleep(100);
74 rtn = robot.JointSensitivityCollect();
75 System.out.printf("JointSensitivityCollect 9 rtn is %d\n", rtn);
76 robot.Sleep(100);
77 robot.MoveJ(jointPos4, descPos4, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
78 robot.Sleep(100);
79 rtn = robot.JointSensitivityCollect();
80 System.out.printf("JointSensitivityCollect 10 rtn is %d\n", rtn);
81 robot.Sleep(100);
82 robot.MoveJ(jointPos3, descPos3, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
83 robot.Sleep(100);
84 rtn = robot.JointSensitivityCollect();
85 System.out.printf("JointSensitivityCollect 11 rtn is %d\n", rtn);
86 robot.Sleep(100);
87 robot.MoveJ(jointPos2, descPos2, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
88 robot.Sleep(100);
89 rtn = robot.JointSensitivityCollect();
90 System.out.printf("JointSensitivityCollect 12 rtn is %d\n", rtn);
91 robot.Sleep(100);
92 robot.MoveJ(jointPos1, descPos1, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
93 robot.Sleep(200);
94 rtn = robot.JointSensitivityCollect();
95 System.out.printf("JointSensitivityCollect 13 rtn is %d\n", rtn);
96 robot.Sleep(100);
97 double[] calibResult =new double[6];
98 double[] linearity = new double[6];
99 rtn = robot.JointSensitivityCalibration(calibResult, linearity);
100 System.out.printf("JointSensitivityCalibration rtn is %d\n", rtn);
101 rtn = robot.JointSensitivityEnable(0);
102 System.out.printf("JointSensitivityEnable rtn is %d\n", rtn);
103 System.out.printf("jointSensor Calib result is %f %f %f %f %f %f\njointSensor linearity is %f %f %f %f %f %f\n",
104 calibResult[0], calibResult[1], calibResult[2],
105 calibResult[3], calibResult[4], calibResult[5],
106 linearity[0], linearity[1], linearity[2],
107 linearity[3], linearity[4], linearity[5]);
108 double[] hysteresisError = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
109 rtn = robot.JointHysteresisError(hysteresisError);
110 System.out.printf("JointHysteresisError result is %f %f %f %f %f %f\n",
111 hysteresisError[0], hysteresisError[1], hysteresisError[2],
112 hysteresisError[3], hysteresisError[4], hysteresisError[5]);
113 double[] repeatability = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
114 rtn = robot.JointRepeatability(repeatability);
115 System.out.printf("JointRepeatability result is %f %f %f %f %f %f\n",
116 repeatability[0], repeatability[1], repeatability[2],
117 repeatability[3], repeatability[4], repeatability[5]);
118 double[] M = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
119 double[] B = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
120 double[] K = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
121 double[] threshold = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
122 int setZeroFlag = 1;
123 rtn = robot.SetAdmittanceParams(M, B, K, threshold, calibResult, setZeroFlag);
124 System.out.printf("SetAdmittanceParams rtn is %d\n", rtn);
125}
6.61. Retrieve the number of error frames for the robot’s 8 slave ports
1/**
2* @brief Retrieve error frame counts for the robot's 8 slave ports
3* @param inRecvErr Input received error frame count
4* @param inCRCErr Input CRC error frame count
5* @param inTransmitErr Input transmitted error frame count
6* @param inLinkErr Input link error frame count
7* @param outRecvErr Output received error frame count
8* @param outCRCErr Output CRC error frame count
9* @param outTransmitErr Output transmitted error frame count
10* @param outLinkErr Output link error frame count
11* @return Error code
12*/
13public int GetSlavePortErrCounter(int[] inRecvErr, int[] inCRCErr, int[] inTransmitErr, int[] inLinkErr, int[] outRecvErr, int[] outCRCErr, int[] outTransmitErr, int[] outLinkErr)
6.62. Reset slave port error frames
1/** 2* @brief Clears error frames for slave port 3* @param slaveID Slave ID (0~7) 4* @return Error code 5*/ 6public int SlavePortErrCounterClear(int slaveID)
6.63. Example for retrieving slave port error frame codes
1public static void TestSlavePortErr(Robot robot) 2{ 3 ROBOT_STATE_PKG pkg =new ROBOT_STATE_PKG(); 4 int[] inRecvErr =new int[8]; 5 int[] inCRCErr =new int[8]; 6 int[] inTransmitErr =new int[8]; 7 int[] inLinkErr =new int[8]; 8 int[] outRecvErr =new int[8]; 9 int[] outCRCErr =new int[8]; 10 int[] outTransmitErr =new int[8]; 11 int[] outLinkErr =new int[8]; 12 robot.GetSlavePortErrCounter(inRecvErr, inCRCErr, inTransmitErr, inLinkErr,outRecvErr, outCRCErr, outTransmitErr, outLinkErr); 13 for (int i = 0; i < 8; i++) 14 { 15 if (inRecvErr[i] != 0) 16 { 17 System.out.printf("inRecvErr %d is %d\n", i, inRecvErr[i]); 18 } 19 if (inCRCErr[i] != 0) 20 { 21 System.out.printf("inRecvErr %d is %d\n", i, inCRCErr[i]); 22 } 23 if (inTransmitErr[i] != 0) 24 { 25 System.out.printf("inRecvErr %d is %d\n", i, inTransmitErr[i]); 26 } 27 if (inLinkErr[i] != 0) 28 { 29 System.out.printf("inRecvErr %d is %d\n", i, inLinkErr[i]); 30 } 31 if (outRecvErr[i] != 0) 32 { 33 System.out.printf("outRecvErr %d is %d\n", i, outRecvErr[i]); 34 } 35 if (outCRCErr[i] != 0) 36 { 37 System.out.printf("outCRCErr %d is %d\n", i, outCRCErr[i]); 38 } 39 if (outTransmitErr[i] != 0) 40 { 41 System.out.printf("outTransmitErr %d is %d\n", i, outTransmitErr[i]); 42 } 43 if (outLinkErr[i] != 0) 44 { 45 System.out.printf("outLinkErr %d is %d\n", i, outLinkErr[i]); 46 } 47 } 48 System.out.printf("others has no err!\n"); 49 for (int i = 0; i < 8; i++) 50 { 51 robot.SlavePortErrCounterClear(i); 52 } 53 robot.CloseRPC(); 54}
6.64. Set speed feedforward coefficients for each axis
1/**
2* @brief Sets the feedforward ratio for each axis
3* @param radio The feedforward ratio for each axis
4* @return Error code
5*/
6public int SetVelFeedForwardRatio(double[] radio)
6.65. Retrieve speed feedforward ratios for each axis
1/** 2* @brief Retrieve speed feedforward ratios for each axis 3* @param radio Speed feedforward coefficients for each axis 4* @return Error code 5*/ 6public int GetVelFeedForwardRatio(double[] radio)
6.66. Robot Speed Feedforward Coefficient Code Example
1public static void TestVelFeedForwardRatio(Robot robot) 2{ 3 double[] setRadio =new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; 4 robot.SetVelFeedForwardRatio(setRadio); 5 double[] getRadio = new double[]{ 0.0 }; 6 robot.GetVelFeedForwardRatio(getRadio); 7 System.out.printf(" %f %f %f %f %f %f\n", getRadio[0], getRadio[1], getRadio[2], getRadio[3], getRadio[4], getRadio[5]); 8 robot.CloseRPC(); 9}
6.67. Photoelectric Sensor TCP Calibration - Compute Tool RPY
1/**
2* @brief Photoelectric sensor TCP calibration - compute tool RPY
3* @param Btool Robot Cartesian position
4* @param Etool Current tool coordinate coefficient value
5* @param sensor Current sensor coordinate coefficient value (not yet available)
6* @param radius Circular motion radius mm (not yet available)
7* @param dz Movement distance along the negative direction of the base coordinate system Z-axis; when dz = 10000, the function directly returns tool RPY
8* @param TCPRPY Tool RPY value
9* @return Error code
10*/
11public int TCPComputeRPY(DescPose Btool, DescPose Etool, DescPose sensor, double radius, double dz, Rpy TCPRPY)
6.68. Photoelectric Sensor TCP Calibration - Compute Tool XYZ
1/**
2* @brief Photoelectric sensor TCP calibration - compute tool XYZ
3* @param select 0-Compute tool TCP; 1-Compute sensor origin; 2-Compute sensor orientation; 3-Directly return tool TCP; 4-Record current workpiece coordinate system and tool coordinate system
4* @param originDirection 0-X direction; 1-Y direction; 2-Z direction
5* @param pos1 Robot Cartesian position 1
6* @param pos2 Robot Cartesian position 2
7* @param pos3 Robot Cartesian position 3
8* @param pos4 Robot Cartesian position 4
9* @param TCP Tool XYZ value
10* @return Error code
11*/
12public int TCPComputeXYZ(int select, double originDirection, DescTran pos1, DescTran pos2, DescTran pos3, DescTran pos4, DescTran TCP)
6.69. Photoelectric Sensor TCP Calibration - Start Recording Flange Center Position
1/**
2* @brief Photoelectric sensor TCP calibration - start recording flange center position
3* @return Error code
4*/
5public int TCPRecordFlangePosStart()
6.70. Photoelectric Sensor TCP Calibration - Stop Recording Flange Center Position
1/**
2* @brief Photoelectric sensor TCP calibration - stop recording flange center position
3* @return Error code
4*/
5public int TCPRecordFlangePosEnd()
6.71. Photoelectric Sensor TCP Calibration - Get Tool Center Point Position
1/**
2* @brief Photoelectric sensor TCP calibration - get tool center point position
3* @param TCP Tool center point position (x,y,z)
4* @return Error code
5*/
6public int TCPGetRecordFlangePos(DescTran TCP)
6.72. Photoelectric Sensor TCP Calibration
1/**
2* @brief Photoelectric sensor TCP calibration
3* @param luaPath Automatic calibration Lua program path: QX version robot - "/fruser/FR_CalibrateTheToolTcp.lua"; LA version robot - "/usr/local/etc/controller/lua/FR_CalibrateTheToolTcp.lua"
4* @param offset Teach point offset (x,y,z) mm
5* @param TCP Calibrated tool coordinate system (x,y,z,rx,ry,rz)
6* @return Error code
7*/
8public int PhotoelectricSensorTCPCalibration(String luaPath, DescTran offset, DescPose TCP)
6.73. Photoelectric Sensor TCP Calibration Code Example
1public static void TestPhotoelectricSensorTCPCalib(Robot robot)
2{
3 DescTran offset = new DescTran(10.0, 10.0, 3.0 );
4 DescPose TCP = new DescPose();
5 int rtn = robot.PhotoelectricSensorTCPCalibration("/fruser/FR_CalibrateTheToolTcp.lua", offset, TCP);
6 System.out.printf("PhotoelectricSensorTCPCalibration rtn is %d %f %f %f %f %f %f \n", rtn, TCP.tran.x, TCP.tran.y, TCP.tran.z, TCP.rpy.rx, TCP.rpy.ry, TCP.rpy.rz);
7 robot.CloseRPC();
8 robot.Sleep(9999999);
9}