6. Common Robot Settings

6.1. Setting the tool reference point - six-point method

1 /**
2 * @brief Setting the tool reference point - the six-point method.
3 * @param [in] point_num point_num, range [1~6].
4 * @return Error code
5 */
6 int SetToolPoint(int point_num).

6.2. Calculating the Tool Coordinate System - Six Point Method

1 /**
2 * @brief Calculate the tool coordinate system
3 * @param [out] tcp_pose tool coordinate system
4 * @return Error code.
5 */
6 int ComputeTool(ref DescPose tcp_pose).

6.3. Setting the tool reference point - four-point method

1 /**
2 * @brief Setting the tool reference point - four-point method.
3 * @param [in] point_num point_num, range [1~4].
4 * @return Error code
5 */
6 int SetTcp4RefPoint(int point_num).

6.4. Calculate the tool coordinate system - four-point method

1  /**
2 * @brief Calculate the tool coordinate system
3 * @param [out] tcp_pose tool coordinate system
4 * @return Error code.
5 */
6 int ComputeTcp4(ref DescPose tcp_pose).

6.5. Set the tool coordinate system

 1 /**
 2 * @brief Set the tool coordinate system.
 3 * @param [in] id Coordinate system number, range [0~14].
 4 * @param [in] coord tool center with respect to end-flange center.
 5 * @param [in] type 0-tool coordinate system, 1-sensor coordinate system
 6 * @param [in] install mounting position, 0-robot end, 1-robot exterior
 7 * param [in] toolID toolID
 8 * @param [in] loadNum loadNumber
 9 * @return ErrorCode
10 */
11 int SetToolCoord(int id, DescPose coord, int type, int install,int toolID, int loadNum);

6.6. Calculate the tool coordinate system from the point information

1 /**
2 * @brief Calculate tool coordinate system from 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 4-point method, 6 for 6-point method.
5 * @return Error code
6 */
7 int ComputeToolCoordWithPoints(int method, JointPos[] pos, ref DescPose coordRtn)

6.7. Set the list of tool coordinate systems

 1 /**
 2 * @brief Setting up a list of tool coordinate systems.
 3 * @param [in] id Coordinate system number, range [0~14].
 4 * @param [in] coord Tool center point relative to end flange center position.
 5 * @param [in] type 0-tool coordinate system, 1-sensor coordinate system
 6 * @param [in] install mounting position, 0-robot end, 1-robot exterior
 7 * @param [in] loadNum loadNumber
 8 * @return Error code
 9 */
10 int SetToolList(int id, DescPose coord, int type, int install, int loadNum);

6.8. Get the current tool coordinate system

1 /**
2 * @brief Get the current tool coordinate system.
3 * @param [in] flag 0-blocking, 1-non-blocking
4 * @param [out] desc_pos Tool coordinate system position.
5 * @return Error code.
6 */
7 int GetTCPOffset(byte flag, ref DescPose desc_pos);

6.9. Robot tool coordinate system operation code example

 1 private void button18_Click(object sender, EventArgs e)
 2{
 3    DescPose p1Desc = new DescPose(186.331f, 487.913f, 209.850f, 149.030f, 0.688f, -114.347f);
 4    JointPos p1Joint = new JointPos(-127.876f, -75.341f, 115.417f, -122.741f, -59.820f, 74.300f);
 5
 6    DescPose p2Desc = new DescPose(69.721f, 535.073f, 202.882f, -144.406f, -14.775f, -89.012f);
 7    JointPos p2Joint = new JointPos(-101.780f, -69.828f, 110.917f, -125.740f, -127.841f, 74.300f);
 8
 9    DescPose p3Desc = new DescPose(146.861f, 578.426f, 205.598f, 175.997f, -36.178f, -93.437f);
10    JointPos p3Joint = new JointPos(-112.851f, -60.191f, 86.566f, -80.676f, -97.463f, 74.300f);
11
12    DescPose p4Desc = new DescPose(136.284f, 509.876f, 225.613f, 178.987f, 1.372f, -100.696f);
13    JointPos p4Joint = new JointPos(-116.397f, -76.281f, 113.845f, -128.611f, -88.654f, 74.299f);
14
15    DescPose p5Desc = new DescPose(138.395f, 505.972f, 298.016f, 179.134f, 2.147f, -101.110f);
16    JointPos p5Joint = new JointPos(-116.814f, -82.333f, 109.162f, -118.662f, -88.585f, 74.302f);
17
18    DescPose p6Desc = new DescPose(105.553f, 454.325f, 232.017f, -179.426f, 0.444f, -99.952f);
19    JointPos p6Joint = new JointPos(-115.649f, -84.367f, 122.447f, -128.663f, -90.432f, 74.303f);
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 = new JointPos[] { p1Joint, p2Joint, p3Joint, p4Joint, p5Joint, p6Joint };
25    DescPose coordRtn = new DescPose();
26    int rtn = robot.ComputeToolCoordWithPoints(1, posJ, ref coordRtn);
27    Console.WriteLine($"ComputeToolCoordWithPoints    {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
28
29    robot.MoveJ( p1Joint,  p1Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
30    robot.SetToolPoint(1);
31    robot.MoveJ( p2Joint,  p2Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
32    robot.SetToolPoint(2);
33    robot.MoveJ( p3Joint,  p3Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
34    robot.SetToolPoint(3);
35    robot.MoveJ( p4Joint,  p4Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
36    robot.SetToolPoint(4);
37    robot.MoveJ( p5Joint,  p5Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
38    robot.SetToolPoint(5);
39    robot.MoveJ( p6Joint,  p6Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
40    robot.SetToolPoint(6);
41    rtn = robot.ComputeTool(ref coordRtn);
42    Console.WriteLine($"6 Point ComputeTool        {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
43    robot.SetToolList(1,  coordRtn, 0, 0, 0);
44
45    robot.MoveJ( p1Joint,  p1Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
46    robot.SetTcp4RefPoint(1);
47    robot.MoveJ( p2Joint,  p2Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
48    robot.SetTcp4RefPoint(2);
49    robot.MoveJ( p3Joint,  p3Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
50    robot.SetTcp4RefPoint(3);
51    robot.MoveJ( p4Joint,  p4Desc, 0, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
52    robot.SetTcp4RefPoint(4);
53    rtn = robot.ComputeTcp4(ref coordRtn);
54    Console.WriteLine($"4 Point ComputeTool        {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
55
56    robot.SetToolCoord(2, coordRtn, 0, 0, 1, 0);
57
58    DescPose getCoord = new DescPose();
59    rtn = robot.GetTCPOffset(0, ref getCoord);
60    Console.WriteLine($"GetTCPOffset    {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
61}

6.10. Setting the external tool coordinate reference point - three-point method

1 /**
2 * @brief Setting the external tool reference point - the three-point method.
3 * @param [in] point_num point_num, range [1~3].
4 * @return Error code
5 */
6 int SetExTCPPoint(int point_num).

6.11. Calculating an external tool coordinate system - three-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 */
6 int ComputeExTCF(ref DescPose tcp_pose).

6.12. Set the external tool coordinate system

1 /**
2 * @brief Set the external tool coordinate system.
3 * @param [in] id Coordinate system number, range [0~14].
4 * @param [in] etcp Tool center point relative to end-flange center position.
5 * @param [in] etool To be determined.
6 * @return Error code
7 */
8 int SetExToolCoord(int id, DescPose etcp, DescPose etool);

6.13. Setting up a list of external tool coordinate systems

1 /**
2 * @brief Set the list of external tool coordinate systems.
3 * @param [in] id Coordinate system number, range [0~14].
4 * @param [in] etcp tool center point relative to end-flange center position
5 * @param [in] etool pending
6 * @return Error code
7 */
8 int SetExToolList(int id, DescPose etcp, DescPose etool);

6.14. Calculate the workpiece coordinate system from the point information

1 /**
2 * @brief Calculate the workpiece coordinate system from 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 * @return Error code
7 */
8 int ComputeWObjCoordWithPoints(int method, DescPose[] pos, int refFrame, ref DescPose coordRtn)

6.15. Sample code for manipulating the robot’s external tool coordinate system

 1 private void button20_Click(object sender, EventArgs e)
 2{
 3    DescPose p1Desc = new DescPose(-89.606f, 779.517f, 193.516f, 178.000f, 0.476f, -92.484f);
 4    JointPos p1Joint = new JointPos(-108.145f, -50.137f, 85.818f, -125.599f, -87.946f, 74.329f);
 5
 6    DescPose p2Desc = new DescPose(-24.656f, 850.384f, 191.361f, 177.079f, -2.058f, -95.355f);
 7    JointPos p2Joint = new JointPos(-111.024f, -41.538f, 69.222f, -114.913f, -87.743f, 74.329f);
 8
 9    DescPose p3Desc = new DescPose(-99.813f, 766.661f, 241.878f, -176.817f, 1.917f, -91.604f);
10    JointPos p3Joint = new JointPos(-107.266f, -56.116f, 85.971f, -122.560f, -92.548f, 74.331f);
11
12    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
13    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
14
15    DescPose[] posTCP = new DescPose[] { p1Desc, p2Desc, p3Desc };
16    DescPose coordRtn = new DescPose();
17
18    robot.MoveJ( p1Joint,  p1Desc, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
19    robot.SetExTCPPoint(1);
20    robot.MoveJ( p2Joint,  p2Desc, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
21    robot.SetExTCPPoint(2);
22    robot.MoveJ( p3Joint,  p3Desc, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
23    robot.SetExTCPPoint(3);
24    int rtn = robot.ComputeExTCF(ref coordRtn);
25    Console.WriteLine($"ComputeExTCF                   {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
26
27    robot.SetExToolCoord(1,  coordRtn,  offdese);
28    robot.SetExToolList(1,  coordRtn,  offdese);
29}

6.16. Setting the reference point of the workpiece coordinate system - three-point method

1 /**
2 * @brief Setting the reference point of a workpiece - the three-point method.
3 * @param [in] point_num point_num, range [1~3].
4 * @return Error code
5 */
6 int SetWObjCoordPoint(int point_num).

6.17. Calculate the work coordinate system

1 /**
2 * @brief Calculate the 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 */
8 int ComputeWObjCoord(int method, int refFrame, ref DescPose wobj_pose);

6.18. Set the workpiece coordinate system

1 /**
2 * @brief Set the workpiece coordinate system.
3 * @param [in] id Coordinate system number, range [1~15].
4 * @param [in] coord Workpiece coordinate system relative to end flange center.
5 * @param [in] refFrame The reference coordinate system.
6 * @return Error code
7 */
8 int SetWObjCoord(int id, DescPose coord, int refFrame);

6.19. Set the list of workpiece coordinate systems

1 /**
2 * @brief Set the list of workpiece coordinate systems.
3 * @param [in] id coordinate system number, range [0~14]
4 * @param [in] coord Workpiece coordinate system relative to the center of the end flange.
5 * @param [in] refFrame The reference coordinate system.
6 * @return Error code
7 */
8 int SetWObjList(int id, DescPose coord, int refFrame);

6.20. Get the current workpiece coordinate system

1 /**
2 * @brief Get the current workpiece coordinate system.
3 * @param [in] flag 0-blocking, 1-non-blocking
4 * @param [out] desc_pos Workpiece coordinate system position.
5 * @return Error code.
6 */
7 int GetWObjOffset(byte flag, ref DescPose desc_pos);

6.21. Robot workpiece coordinate system operation code example

 1private void button19_Click(object sender, EventArgs e)
 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,ref p1Desc);
13    robot.GetForwardKin(p2Joint,ref p2Desc);
14    robot.GetForwardKin(p3Joint, ref 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, ref coordRtn);
22    Console.WriteLine($"ComputeWObjCoordWithPoints    {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
23
24    robot.MoveJ( p1Joint,  p1Desc, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
25    robot.SetWObjCoordPoint(1);
26    robot.MoveJ( p2Joint,  p2Desc, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
27    robot.SetWObjCoordPoint(2);
28    robot.MoveJ( p3Joint,  p3Desc, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
29    robot.SetWObjCoordPoint(3);
30    rtn = robot.ComputeWObjCoord(1, 0, ref coordRtn);
31    Console.WriteLine($"ComputeWObjCoord                   {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
32
33    robot.SetWObjCoord(1,  coordRtn, 0);
34    robot.SetWObjList(1,  coordRtn, 0);
35
36    DescPose getWobjDesc = new DescPose();
37    rtn = robot.GetWObjOffset(0, ref getWobjDesc);
38    Console.WriteLine($"GetWObjOffset                   {rtn}  coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
39}

6.22. Setting the global speed

1 /**
2 * @brief Set the global speed.
3 * @param [in] vel Speed percentage, range [0~100].
4 * @return Error code.
5 */
6 int SetSpeed(int vel).

6.23. Set the robot acceleration

1 /**
2 * @brief Set robot acceleration
3 * @param [in] acc robot acceleration percentage
4 * @return Error code.
5 */
6 int SetOaccScale(double acc)

6.24. Get the default robot speed

1 /**
2 * @brief Get the default speed of the robot.
3 * @param [out] vel velocity in mm/s
4 * @return Error code.
5 */
6 int GetDefaultTransVel(ref double vel).

6.25. Set the end load weight

1 /**
2 * @brief Set the end load weight.
3 * @param [in] loadNum loadNumber
4 * @param [in] weight load weight in kg
5 * @return Error code.
6 */
7 int SetLoadWeight(int loadNum, float weight)

6.26. Set the center of mass of the end load

1 /**
2 * @brief Set end-load center-of-mass coordinates.
3 * @param [in] coord center of mass in mm.
4 * @return Error code.
5 */
6 int SetLoadCoord(DescTran coord).

6.27. Get the weight of the current load

1 /**
2 * @brief Get the weight of the current load
3 * @param [in] flag 0-blocking, 1-non-blocking
4 * @param [out] weight weight of the load in kg
5 * @return Error code.
6 */
7 int GetTargetPayload(byte flag, ref double weight);

6.28. Get the center of mass of the current load

1 /**
2 * @brief Get the center of mass of the current load.
3 * @param [in] flag 0-blocking, 1-non-blocking
4 * @param [out] cog load center of mass in mm
5 * @return Error code.
6 */
7 int GetTargetPayloadCog(byte flag, ref DescTran cog);

6.29. Set the robot mounting method

1 /**
2 * @brief Set the robot installation method.
3 * @param [in] install Installation method, 0-front, 1-side, 2-backwards.
4 * @return Error code.
5 */
6 int SetRobotInstallPos(byte install).

6.30. Set the robot installation angle

1 /**
2 * @brief Setting the robot mounting angle for free mounting.
3 * @param [in] yangle tilt angle
4 * @param [in] zangle angle of rotation.
5 * @return Error code.
6 */
7 int SetRobotInstallAngle(double yangle, double zangle);

6.31. Get the robot installation angle

1 /**
2 * @brief Get the robot mounting angle.
3 * @param [out] yangle tilt angle
4 * @param [out] zangle angle of rotation.
5 * @return Error code.
6 */
7 int GetRobotInstallAngle(ref double yangle, ref double zangle);

6.32. Sets the value of the system variable

1 /**
2 * @brief Setting system variable values
3 * @param [in] id Variable number, range [1~20].
4 * @param [in] value Variable number, range [1~20].
5 * @return Error code.
6 */
7 int SetSysVarValue(int id, double value);

6.33. Get the value of a system variable

1 /**
2 * @brief Get the value of a system variable.
3 * @param [in] id System variable number, in the range [1~20].
4 * @param [out] value System variable value.
5 * @return Error code.
6 */
7 int GetSysVarValue(int id, ref double value);

6.34. Sample code for common robot settings

 1private void button21_Click(object sender, EventArgs e)
 2{
 3    for (int i = 1; i < 100; i++)
 4    {
 5        robot.SetSpeed(i);
 6        robot.SetOaccScale(i);
 7        Thread.Sleep(30);
 8    }
 9
10    double defaultVel = 0.0f;
11    robot.GetDefaultTransVel(ref defaultVel);
12    Console.WriteLine($"GetDefaultTransVel is {defaultVel}");
13
14    for (int i = 1; i < 21; i++)
15    {
16        robot.SetSysVarValue(i, i + 0.5f);
17        Thread.Sleep(100);
18    }
19
20    for (int i = 1; i < 21; i++)
21    {
22        double value = 0;
23        robot.GetSysVarValue(i, ref value);
24        Console.WriteLine($"sys value  {i} is :{value}");
25        Thread.Sleep(100);
26    }
27
28    robot.SetLoadWeight(0, 2.5f);
29
30    DescTran loadCoord = new DescTran();
31    loadCoord.x = 3.0f;
32    loadCoord.y = 4.0f;
33    loadCoord.z = 5.0f;
34    robot.SetLoadCoord( loadCoord);
35
36    Thread.Sleep(1000);
37
38    double getLoad = 0.0f;
39    robot.GetTargetPayload(0, ref getLoad);
40
41    DescTran getLoadTran = new DescTran();
42    robot.GetTargetPayloadCog(0, ref getLoadTran);
43    Console.WriteLine($"get load is {getLoad}; get load cog is {getLoadTran.x} {getLoadTran.y} {getLoadTran.z}");
44
45    robot.SetRobotInstallPos(0);
46    robot.SetRobotInstallAngle(15.0f, 25.0f);
47
48    double anglex = 0.0f;
49    double angley = 0.0f;
50    robot.GetRobotInstallAngle(ref anglex, ref angley);
51    Console.WriteLine($"GetRobotInstallAngle x:  {anglex};  y:  {angley}");
52}

6.35. Joint friction compensation switch

1 /**
2 * @brief Joint friction compensation switch.
3 * @param [in] state 0-off, 1-on
4 * @return Error code.
5 */
6 int FrictionCompensationOnOff(byte state).

6.36. Sets the joint friction compensation factor - proper

1 /**
2 * @brief Set the joint friction compensation coefficients-front-loading
3 * @param [in] coeff Six joint compensation coefficients, range [0~1].
4 * @return error code
5 */
6 int SetFrictionValue_level(double[] coeff).

6.37. Set joint friction compensation coefficients - side mount

1 /**
2 * @brief Set joint friction compensation coefficients-side-loading
3 * @param [in] coeff Six joint compensation coefficients, range [0~1].
4 * @return error code
5 */
6 int SetFrictionValue_wall(double[] coeff).

6.38. Set joint friction compensation coefficients - inverted

1 /**
2 * @brief Set joint friction compensation coefficients-flip-flop
3 * @param [in] coeff Six joint compensation coefficients, range [0~1].
4 * @return Error code
5 */
6 int SetFrictionValue_ceiling(double[] coeff).

6.39. Set joint friction compensation coefficients - free mounting

1 /**
2 * @brief Set joint friction compensation coefficients - free-mounting
3 * @param [in] coeff Six joint compensation coefficients, range [0 to 1].
4 * @return Error code.
5 */
6 int SetFrictionValue_freedom(double[] coeff);

6.40. Robot set joint friction compensation code example

 1 private void btnRobotSafetySet_Click(object sender, EventArgs e)
 2 {
 3     double[] lcoeff = { 0.9f, 0.9f, 0.9f, 0.9f, 0.9f, 0.9f };
 4     double[] wcoeff = { 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f };
 5     double[] ccoeff = { 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f };
 6     double[] fcoeff = { 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f };
 7
 8     int rtn = robot.FrictionCompensationOnOff(1);
 9     Console.WriteLine($"FrictionCompensationOnOff rtn is{rtn}");
10
11     Console.WriteLine($"FrictionCompensationOnOff rtn is{rtn}");
12     Console.WriteLine($"SetFrictionValue_level rtn is {rtn}");
13
14     Console.WriteLine($"SetFrictionValue_level rtn is {rtn}");
15     Console.WriteLine($"SetFrictionValue_wall rtn is {rtn}");
16
17     rtn = robot.SetFrictionValue_ceiling(ccoeff);
18     Console.WriteLine($"SetFrictionValue_ceiling rtn is {rtn}");
19
20     rtn = robot.SetFrictionValue_freedom(fcoeff);
21     Console.WriteLine($"SetFrictionValue_freedom rtn is {rtn}");
22 }

6.41. Querying the robot error code

1 /**
2 * @brief Query robot error code
3 * @param [out] maincode mainerrorcode
4 * @param [out] subcode suberrorcode
5 * @return errorcode
6 */
7 int GetRobotErrorCode(ref int maincode, ref int subcode);

6.42. Error status clearing

1 /**
2 * @brief Error state clearing
3 * @return Error code
4 */
5 int ResetAllError();

6.43. Example of getting robot fault status and clearing error code

 1 private void btnRobotSafetySet_Click(object sender, EventArgs e)
 2 {
 3     int maincode=0, subcode=0;
 4     robot.GetRobotErrorCode(ref maincode, ref subcode);
 5     Console.WriteLine($"robot maincode is{maincode}; subcode is {subcode}" );
 6
 7     robot.ResetAllError();
 8
 9     Thread.Sleep(1000);
10
11     robot.GetRobotErrorCode(ref maincode, ref subcode);
12     Console.WriteLine($"robot maincode is{maincode}; subcode is{subcode}");
13 }

6.44. Setting the parameters for monitoring the temperature and fan speed of the wide voltage control box

New in version C#SDK-V1.1.4: Web-3.8.3

1 /**
2 * @brief Setting the parameters for monitoring the temperature and fan speed of the wide voltage control box.
3 * @param [in] enable 0-does not enable monitoring; 1-enables monitoring
4 * @param [in] period Monitoring period (s), range 1-100.
5 * @return Error code
6 */
7 int SetWideBoxTempFanMonitorParam(int enable, int period);

6.45. Get the parameters for monitoring the temperature and fan speed of the wide-voltage control box.

New in version C#SDK-V1.1.4: Web-3.8.3

1 /**
2 * @brief Get the parameters for monitoring the temperature and fan speed of the wide voltage control box.
3 * @param [out] enable 0-not enable monitoring; 1-enable monitoring
4 * @param [out] period Monitoring period (s), range 1-100.
5 * @return Error code
6 */
7 int GetWideBoxTempFanMonitorParam(ref int enable, ref int period);

6.46. Code example

New in version C#SDK-V1.1.4: Web-3.8.3

 1private void button46_Click(object sender, EventArgs e)
 2{
 3    var pkg = new ROBOT_STATE_PKG();
 4    robot.SetWideBoxTempFanMonitorParam(1, 2);
 5    int enable = 0;
 6    int period = 0;
 7    robot.GetWideBoxTempFanMonitorParam(ref enable, ref period);
 8    Console.WriteLine($"GetWideBoxTempFanMonitorParam enable is {enable}   period is {period}");
 9    for (int i = 0; i < 100; i++)
10    {
11        robot.GetRobotRealTimeState(ref pkg);
12        Console.WriteLine($"robot ctrl box temp is {pkg.wideVoltageCtrlBoxTemp}, fan current is {pkg.wideVoltageCtrlBoxFanVel}");
13        Thread.Sleep(100);
14    }
15    int rtn = robot.SetWideBoxTempFanMonitorParam(0, 2);
16    Console.WriteLine($"SetWideBoxTempFanMonitorParam rtn is {rtn}");
17    enable = 0;
18    period = 0;
19    robot.GetWideBoxTempFanMonitorParam(ref enable, ref period);
20    Console.WriteLine($"GetWideBoxTempFanMonitorParam enable is {enable}   period is {period}");
21    for (int i = 0; i < 100; i++)
22    {
23        robot.GetRobotRealTimeState(ref pkg);
24        Console.WriteLine($" robot ctrl box temp is {pkg.wideVoltageCtrlBoxTemp}, fan current is {pkg.wideVoltageCtrlBoxFanVel}");
25        Thread.Sleep(100);
26    }
27}

6.47. Set the focus calibration point

New in version C#SDK-V1.1.5: Web-3.8.4

1/**
2* @brief Set the focus calibration point
3* @param [in] pointNum Calibration point number of the focus 1-8
4* @param [in] point Coordinates of the calibration point
5* @return Error code
6*/
7int SetFocusCalibPoint(int pointNum, DescPose point);

6.48. Set the focus coordinates

New in version C#SDK-V1.1.5: Web-3.8.4

1/**
2* @brief Set the focus coordinates
3* @param [in] pos Focus coordinates XYZ
4* @return Error code
5*/
6int SetFocusPosition(DescTran pos);

6.49. Enable focus following

New in version C#SDK-V1.1.5: Web-3.8.4

 1/**
 2* @brief Enable 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^2
 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.50. Stop focus following

New in version C#SDK-V1.1.5: Web-3.8.4

1/**
2* @brief Stop focus following
3* @return Error code
4*/
5int FocusEnd();

6.51. Focus Follow Code Example

New in version C#SDK-V1.1.5: Web-3.8.4

 1private void button81_Click(object sender, EventArgs e)
 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    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    DescPose p3Desc = new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
 8    JointPos p3Joint = new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
 9    DescPose p4Desc = new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
10    JointPos p4Joint = new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
11    DescPose p5Desc = new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
12    JointPos p5Joint = new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
13    DescPose p6Desc = new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
14    JointPos p6Joint = new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
15    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
16    DescPose offdese = new DescPose(0, 0, 100, 0, 0, 0);
17    robot.GetForwardKin(p1Joint,ref p1Desc);
18    robot.GetForwardKin(p2Joint, ref p2Desc);
19    robot.GetForwardKin(p3Joint, ref p3Desc);
20    robot.GetForwardKin(p4Joint, ref p4Desc);
21    robot.GetForwardKin(p5Joint, ref p5Desc);
22    robot.GetForwardKin(p6Joint, ref p6Desc);
23    robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
24    robot.SetTcp4RefPoint(1);
25    robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
26    robot.SetTcp4RefPoint(2);
27    robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
28    robot.SetTcp4RefPoint(3);
29    robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
30    robot.SetTcp4RefPoint(4);
31    DescPose coordRtn = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
32    int rtn = robot.ComputeTcp4(ref coordRtn);
33    Console.WriteLine($"4 Point ComputeTool      {rtn} coord is {coordRtn.tran.x} ,{coordRtn.tran.y} ,{coordRtn.tran.z} ,{coordRtn.rpy.rx} ,{coordRtn.rpy.ry} ,{coordRtn.rpy.rz} ");
34    robot.SetToolCoord(1, coordRtn, 0, 0, 1, 0);
35    robot.GetForwardKin(p1Joint, ref p1Desc);
36    robot.GetForwardKin(p2Joint, ref p2Desc);
37    robot.GetForwardKin(p3Joint, ref p3Desc);
38    robot.SetFocusCalibPoint(1, p1Desc);
39    robot.SetFocusCalibPoint(2, p2Desc);
40    robot.SetFocusCalibPoint(3, p3Desc);
41    DescTran resultPos = new DescTran(0.0, 0.0, 0.0);
42    double accuracy = 0.0;
43    rtn = robot.ComputeFocusCalib(3, ref resultPos, ref accuracy);
44    Console.WriteLine($"ComputeFocusCalib coord is  {rtn},{ resultPos.x} ,{ resultPos.y}, { resultPos.z}, accuracy is {accuracy} ");
45    rtn = robot.SetFocusPosition(resultPos);
46    robot.GetForwardKin(p5Joint, ref p5Desc);
47    robot.GetForwardKin(p6Joint, ref p6Desc);
48    robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
49    robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
50    robot.FocusStart(50, 19, 710, 90, 0);
51    robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
52    robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
53    robot.FocusEnd();
54}

6.52. Enable joint torque sensor sensitivity calibration function

New in version C#SDK-V1.1.9: Web-3.8.7

1/**
2* @brief Enable joint torque sensor sensitivity calibration function
3* @param [in] status 0-Disable;1-Enable
4* @return Error code
5*/
6public int JointSensitivityEnable(int status);

6.53. Sensitivity data acquisition of joint torque sensors

New in version C#SDK-V1.1.9: Web-3.8.7

1/**
2* @brief Sensitivity data acquisition of joint torque sensors
3* @return Error code
4*/
5public int JointSensitivityCollect();

6.54. Get the sensitivity calibration results of the joint torque sensor

New in version C#SDK-V1.1.9: Web-3.8.7

1/**
2* @brief Get joint torque sensor sensitivity calibration results
3* @param [out] calibResult j1~j6 joint sensitivity [0-1]
4* @param [out] linearity j1~j6 joint linearity [0-1]
5* @return Error code
6*/
7public int JointSensitivityCalibration(double calibResult[6], double linearity[6]);

6.55. Get Joint Torque Sensor Hysteresis Error

1/**
2* @brief Get joint torque sensor hysteresis error
3* @param [out] hysteresisError j1~j6 joint hysteresis error
4* @return Error code
5*/
6public int JointHysteresisError(ref double[] hysteresisError);

6.56. Get Joint Torque Sensor Repeatability

1/**
2* @brief Get joint torque sensor repeatability
3* @param [out] repeatability j1~j6 joint torque sensor repeatability
4* @return Error code
5*/
6public int JointRepeatability(ref double[] repeatability);

6.57. Set Joint Force Sensor Parameters

 1/**
 2* @brief Set joint force sensor parameters
 3* @param [in] M J1-J6 mass coefficient [0.001 ~ 10]
 4* @param [in] B J1-J6 damping coefficient [0.001 ~ 10]
 5* @param [in] K J1-J6 stiffness coefficient [0.001 ~ 10]
 6* @param [in] threshold Force control threshold, Nm
 7* @param [in] sensitivity Sensitivity, Nm/V, [0 ~ 10]
 8* @param [in] 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.58. Joint torque sensor sensitivity automatic calibration Code Example

New in version C#SDK-V1.1.9: Web-3.8.7

 1public int TestSensitivityCalib()
 2{
 3    int rtn;
 4    rtn = robot.JointSensitivityEnable(0);
 5    rtn = robot.JointSensitivityEnable(1);
 6    Console.WriteLine($"JointSensitivityEnable rtn is {rtn}");
 7
 8    JointPos curJPos = new JointPos(0, 0, 0, 0, 0, 0);
 9    robot.GetActualJointPosDegree(0, ref curJPos);
10    ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
11    DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
12    JointPos[] jointPoses = new JointPos[]
13    {
14        new JointPos(curJPos.jPos[0], 0, 0, -90, 0.02, curJPos.jPos[5]),
15        new JointPos(curJPos.jPos[0], -30, 0, -90, 0.02, curJPos.jPos[5]),
16        new JointPos(curJPos.jPos[0], -60, 0, -90, 0.02, curJPos.jPos[5]),
17        new JointPos(curJPos.jPos[0], -90, 0, -90, 0.02, curJPos.jPos[5]),
18        new JointPos(curJPos.jPos[0], -120, 0, -90, 0.02, curJPos.jPos[5]),
19        new JointPos(curJPos.jPos[0], -150, 0, -90, 0.02, curJPos.jPos[5]),
20        new JointPos(curJPos.jPos[0], -180, 0, -90, 0.02, curJPos.jPos[5])
21    };
22    for (int i = 0; i < jointPoses.Length; i++)
23    {
24        DescPose descPos = new DescPose(0, 0, 0, 0, 0, 0);
25        robot.GetForwardKin(jointPoses[i], ref descPos);
26        robot.MoveJ(jointPoses[i], descPos, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
27
28        Thread.Sleep(i == 0 ? 200 : 100);
29        rtn = robot.JointSensitivityCollect();
30        Console.WriteLine($"JointSensitivityCollect {i + 1} rtn is {rtn}");
31        Thread.Sleep(100);
32    }
33
34    for (int i = jointPoses.Length - 2; i >= 0; i--)
35    {
36        DescPose descPos = new DescPose();
37        robot.GetForwardKin(jointPoses[i], ref descPos);
38        robot.MoveJ(jointPoses[i], descPos, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
39        Thread.Sleep(100);
40        rtn = robot.JointSensitivityCollect();
41        Console.WriteLine($"JointSensitivityCollect {jointPoses.Length + (jointPoses.Length - 1 - i)} rtn is {rtn}");
42        Thread.Sleep(100);
43    }
44    double[] calibResult = new double[6];
45    double[] linearity = new double[6];
46    rtn = robot.JointSensitivityCalibration(ref calibResult, ref linearity);
47    Console.WriteLine($"JointSensitivityCalibration rtn is {rtn}");
48    rtn = robot.JointSensitivityEnable(0);
49    Console.WriteLine($"JointSensitivityEnable rtn is {rtn}");
50    Console.WriteLine($"jointSensor Calib result is {calibResult[0]:F6} {calibResult[1]:F6} {calibResult[2]:F6} {calibResult[3]:F6} {calibResult[4]:F6} {calibResult[5]:F6}");
51    Console.WriteLine($"jointSensor linearity is {linearity[0]:F6} {linearity[1]:F6} {linearity[2]:F6} {linearity[3]:F6} {linearity[4]:F6} {linearity[5]:F6}");
52    double[] hysteresisError = new double[6];
53    rtn = robot.JointHysteresisError(ref hysteresisError);
54    Console.WriteLine($"JointHysteresisError result is {hysteresisError[0]:F6} {hysteresisError[1]:F6} {hysteresisError[2]:F6} {hysteresisError[3]:F6} {hysteresisError[4]:F6} {hysteresisError[5]:F6}");
55    double[] repeatability = new double[6];
56    rtn = robot.JointRepeatability(ref repeatability);
57    Console.WriteLine($"JointRepeatability result is {repeatability[0]:F6} {repeatability[1]:F6} {repeatability[2]:F6} {repeatability[3]:F6} {repeatability[4]:F6} {repeatability[5]:F6}");
58    double[] M = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
59    double[] B = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
60    double[] K = new double[6] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
61    double[] threshold = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
62    int setZeroFlag = 1;
63    rtn = robot.SetAdmittanceParams(M, B, K, threshold, calibResult, setZeroFlag);
64    Console.WriteLine($"SetAdmittanceParams rtn is {rtn}");
65    robot.CloseRPC();
66    return 0;
67}

6.59. Get the number of 8 slave port error frames of the robot

New in version C#SDK-V1.1.9: Web-3.8.7

 1/**
 2* @brief Get the number of 8 slave port error frames of the robot
 3* @param [out] inRecvErr Input receiving error frames
 4* @param [out] inCRCErr Input CRC error frames
 5* @param [out] inTransmitErr Input transmit error frames
 6* @param [out] inLinkErr Input link error frames
 7* @param [out] outRecvErr Output receiving error frames
 8* @param [out] outCRCErr Output CRC error frames
 9* @param [out] outTransmitErr Output transmit error frames
10* @param [out] outLinkErr Output link error frames
11* @return Error code
12*/
13public int GetSlavePortErrCounter(ref int[] inRecvErr,ref int[] inCRCErr,ref int[] inTransmitErr,ref int[] inLinkErr,ref int[] outRecvErr,ref int[] outCRCErr,ref int[] outTransmitErr,ref int[] outLinkErr);

6.60. Clear the slave port error num

New in version C#SDK-V1.1.9: Web-3.8.7

1/**
2* @brief Clear the slave port error num
3* @param [in] slaveID slave id 0~7
4* @return Error code
5*/
6public int SlavePortErrCounterClear(int slaveID);

6.61. Gets the slave port error frame code example

New in version C#SDK-V1.1.9: Web-3.8.7

 1public void TestSlavePortErr()
 2{
 3    int[] inRecvErr = new int[8];
 4    int[] inCRCErr = new int[8];
 5    int[] inTransmitErr = new int[8];
 6    int[] inLinkErr = new int[8];
 7    int[] outRecvErr = new int[8];
 8    int[] outCRCErr = new int[8];
 9    int[] outTransmitErr = new int[8];
10    int[] outLinkErr = new int[8];
11
12    robot.GetSlavePortErrCounter(ref inRecvErr, ref inCRCErr, ref inTransmitErr, ref inLinkErr,
13        ref outRecvErr, ref outCRCErr, ref outTransmitErr, ref outLinkErr);
14
15    for (int i = 0; i < 8; i++)
16    {
17        if (inRecvErr[i] != 0)
18        {
19            Console.WriteLine($"inRecvErr {i} is {inRecvErr[i]}");
20        }
21
22        if (inCRCErr[i] != 0)
23        {
24            Console.WriteLine($"inCRCErr {i} is {inCRCErr[i]}");
25        }
26
27        if (inTransmitErr[i] != 0)
28        {
29            Console.WriteLine($"inTransmitErr {i} is {inTransmitErr[i]}");
30        }
31
32        if (inLinkErr[i] != 0)
33        {
34            Console.WriteLine($"inLinkErr {i} is {inLinkErr[i]}");
35        }
36
37        if (outRecvErr[i] != 0)
38        {
39            Console.WriteLine($"outRecvErr {i} is {outRecvErr[i]}");
40        }
41
42        if (outCRCErr[i] != 0)
43        {
44            Console.WriteLine($"outCRCErr {i} is {outCRCErr[i]}");
45        }
46
47        if (outTransmitErr[i] != 0)
48        {
49            Console.WriteLine($"outTransmitErr {i} is {outTransmitErr[i]}");
50        }
51
52        if (outLinkErr[i] != 0)
53        {
54            Console.WriteLine($"outLinkErr {i} is {outLinkErr[i]}");
55        }
56    }
57    Console.WriteLine("others has no err!");
58
59    for (int i = 0; i < 8; i++)
60    {
61        robot.SlavePortErrCounterClear(i);
62    }
63
64    robot.CloseRPC();
65}

6.62. Set the feedforward coefficients of the velocities of each axis

New in version C#SDK-V1.1.9: Web-3.8.7

1/**
2* @brief Set the feedforward coefficients of the velocities of each axis
3* @param [in] radio feedforward coefficients of the velocities of each axis
4* @return Error code
5*/
6public int SetVelFeedForwardRatio(double radio[6]);

6.63. Get the feedforward coefficients of the velocities of each axis

New in version C#SDK-V1.1.9: Web-3.8.7

1/**
2* @brief Get the feedforward coefficients of the velocities of each axis
3* @param [out] radio feedforward coefficients of the velocities of each axis
4* @return Error code
5*/
6public int GetVelFeedForwardRatio(ref double radio[6]);

6.64. Robot velocity feedforward coefficient code example

New in version C#SDK-V1.1.9: Web-3.8.7

1public void TestVelFeedForwardRatio()
2{
3
4    double[] setRadio = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
5    robot.SetVelFeedForwardRatio(setRadio);
6    double[] getRadio = new double[6] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
7    robot.GetVelFeedForwardRatio(ref getRadio);
8    Console.WriteLine($" {getRadio[0]:F6} {getRadio[1]:F6} {getRadio[2]:F6} {getRadio[3]:F6} {getRadio[4]:F6} {getRadio[5]:F6}");
9}

6.65. Photoelectric Sensor TCP Calibration - Compute Tool RPY

 1/**
 2* @brief Photoelectric Sensor TCP Calibration - Compute Tool RPY
 3* @param [in] Btool Robot Cartesian position
 4* @param [in] Etool Current tool coordinate values
 5* @param [in] sensor Current sensor coordinate values (not yet available)
 6* @param [in] radius Circular motion radius in mm (not yet available)
 7* @param [in] dz Movement distance along the negative Z-axis of the base coordinate system; when dz = 10000, the function directly returns tool RPY
 8* @param [out] TCPRPY Tool RPY values
 9* @return Error code
10*/
11public int TCPComputeRPY(DescPose Btool, DescPose Etool, DescPose sensor, double radius, double dz, out Rpy TCPRPY);

6.66. Photoelectric Sensor TCP Calibration - Compute Tool XYZ

 1/**
 2* @brief Photoelectric Sensor TCP Calibration - Compute Tool XYZ
 3* @param [in] 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 [in] originDirection 0-X direction; 1-Y direction; 2-Z direction
 5* @param [in] pos1 Robot Cartesian position 1
 6* @param [in] pos2 Robot Cartesian position 2
 7* @param [in] pos3 Robot Cartesian position 3
 8* @param [in] pos4 Robot Cartesian position 4
 9* @param [out] TCP Tool XYZ values
10* @return Error code
11*/
12public int TCPComputeXYZ(int select, double originDirection, DescTran pos1, DescTran pos2,DescTran pos3, DescTran pos4, out DescTran TCP);

6.67. 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.68. 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.69. Photoelectric Sensor TCP Calibration - Get Tool Center Point Position

1/**
2* @brief Photoelectric Sensor TCP Calibration - Get Tool Center Point Position
3* @param [out] TCP Tool center point position (x, y, z)
4* @return Error code
5*/
6public int TCPGetRecordFlangePos(out DescTran TCP);

6.70. Photoelectric Sensor TCP Calibration

1/**
2* @brief Photoelectric Sensor TCP Calibration
3* @param [in] luaPath Automatic calibration Lua program path: For QX version robots - "/fruser/FR_CalibrateTheToolTcp.lua"; For LA version robots - "/usr/local/etc/controller/lua/FR_CalibrateTheToolTcp.lua"
4* @param [in] offsetX Teaching point offset (x, y, z) in mm
5* @param [out] TCP Calibrated tool coordinate system (x, y, z, rx, ry, rz)
6* @return Error code
7*/
8public int PhotoelectricSensorTCPCalibration(string luaPath, DescTran offset, out DescPose TCP);

6.71. Photoelectric Sensor TCP Calibration Code Example

 1public void TestPhotoelectricSensorTCPCalib()
 2{
 3    ROBOT_STATE_PKG pkg =new ROBOT_STATE_PKG();
 4    DescTran offset = new DescTran( 10.0, 10.0, 3.0 );
 5    DescPose TCP = new DescPose();
 6    int rtn = robot.PhotoelectricSensorTCPCalibration("/fruser/FR_CalibrateTheToolTcp.lua", offset, out TCP);
 7    Console.WriteLine($"PhotoelectricSensorTCPCalibration : {rtn}");
 8    Console.WriteLine($"Tool TCP Coordinate: X={TCP.tran.x:F3}, Y={TCP.tran.y:F3}, Z={TCP.tran.z:F3}");
 9    Console.WriteLine($"Tool RPY Orientation: RX={TCP.rpy.rx:F3}, RY={TCP.rpy.ry:F3}, RZ={TCP.rpy.rz:F3}");
10}