top of page
6.1. Set tool reference point - six point method
/**
* @brief Set tool reference point - six point method
* @param [in] point_num Point number, range [1~6]
* @return Error code
*/
int SetToolPoint(int point_num);
6.2. Calculate tool coordinate system - six point method
/**
* @brief Calculate tool coordinate system
* @param [out] tcp_pose Tool coordinate system
* @return Error code
*/
int ComputeTool(DescPose tcp_pose);
6.3. Set tool reference point - four point method
/**
* @brief Set tool reference point - four point method
* @param [in] point_num Point number, range [1~4]
* @return Error code
*/
int SetTcp4RefPoint(int point_num);
6.4. Calculate tool coordinate system - four point method
/**
* @brief Calculate tool coordinate system
* @param [out] tcp_pose Tool coordinate system
* @return Error code
*/
int ComputeTcp4(DescPose tcp_pose);
6.5. Calculate tool coordinate system based on point information
/**
* @brief Calculate tool coordinate system based on point information
* @param [in] method Calculation method; 0-four point method; 1-six point method
* @param [in] pos Joint position group, array length is 4 for four point method, 6 for six point method
* @param [out] tool_pose Output tool coordinate system
* @return Error code
*/
int ComputeToolCoordWithPoints(int method, JointPos[] pos, DescPose tool_pose);
6.6. Set tool coordinate system
/**
* @brief Set tool coordinate system
* @param [in] id Coordinate system number, range [0~14]
* @param [in] coord Tool center point pose relative to end flange center
* @param [in] type 0-tool coordinate system, 1-sensor coordinate system
* @param [in] install Installation position, 0-robot end, 1-external to robot
* @param [in] toolID Tool ID
* @param [in] loadNum Load number
* @return Error code
*/
int SetToolCoord(int id, DescPose coord, int type, int install, int toolID, int loadNum);
6.7. Set tool coordinate system list
/**
* @brief Set tool coordinate system list
* @param [in] id Coordinate system number, range [0~14]
* @param [in] coord Tool center point pose relative to end flange center
* @param [in] type 0-tool coordinate system, 1-sensor coordinate system
* @param [in] install Installation position, 0-robot end, 1-external to robot
* @param [in] loadNum Load number
* @return Error code
*/
int SetToolList(int id, DescPose coord, int type, int install, int loadNum);
6.8. Get current tool coordinate system
/**
* @brief Get current tool coordinate system
* @param [in] flag 0-blocking, 1-non-blocking
* @param [out] desc_pos Tool coordinate system pose
* @return Error code
*/
int GetTCPOffset(int flag, DescPose desc_pos);
6.9. Robot tool coordinate system operation code example
public static int TestTCPCompute(Robot robot)
{
DescPose p1Desc=new DescPose(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
JointPos p1Joint=new JointPos(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);
DescPose p2Desc=new DescPose(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
JointPos p2Joint=new JointPos(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);
DescPose p3Desc=new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
JointPos p3Joint=new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
DescPose p4Desc=new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
JointPos p4Joint=new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
DescPose p5Desc=new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
JointPos p5Joint=new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
DescPose p6Desc=new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
JointPos p6Joint=new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
JointPos[] posJ = { p1Joint , p2Joint , p3Joint , p4Joint , p5Joint , p6Joint };
DescPose coordRtn =new DescPose() {};
int rtn = robot.ComputeToolCoordWithPoints(1, posJ, coordRtn);
robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetToolPoint(1);
robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetToolPoint(2);
robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetToolPoint(3);
robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetToolPoint(4);
robot.MoveJ(p5Joint, p5Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetToolPoint(5);
robot.MoveJ(p6Joint, p6Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetToolPoint(6);
rtn = robot.ComputeTool(coordRtn);
robot.SetToolList(3, coordRtn, 0, 0, 0);
robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetTcp4RefPoint(1);
robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetTcp4RefPoint(2);
robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetTcp4RefPoint(3);
robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetTcp4RefPoint(4);
rtn = robot.ComputeTcp4(coordRtn);
robot.SetToolCoord(4, coordRtn, 0, 0, 1, 0);
DescPose getCoord = new DescPose(){};
rtn = robot.GetTCPOffset(0, getCoord);
return 0;
}
6.10. Set external tool reference point - six point method
/**
* @brief Set external tool reference point - three point method
* @param [in] point_num Point number, range [1~3]
* @return Error code
*/
int SetExTCPPoint(int point_num);
6.11. Calculate external tool coordinate system - six point method
/**
* @brief Calculate external tool coordinate system - three point method
* @param [out] tcp_pose External tool coordinate system
* @return Error code
*/
int ComputeExTCF(DescPose tcp_pose);
6.12. Set external tool coordinate system
/**
* @brief Set external tool coordinate system
* @param [in] id Coordinate system number, range [0~14]
* @param [in] etcp Tool center point pose relative to end flange center
* @param [in] etool To be determined
* @return Error code
*/
int SetExToolCoord(int id, DescPose etcp, DescPose etool);
6.13. Set external tool coordinate system list
/**
* @brief Set external tool coordinate system list
* @param [in] id Coordinate system number, range [0~14]
* @param [in] etcp Tool center point pose relative to end flange center
* @param [in] etool To be determined
* @return Error code
*/
int SetExToolList(int id, DescPose etcp, DescPose etool);
6.14. Robot external tool coordinate system operation code example
public static int TestExtCoord(Robot robot)
{
DescPose p1Desc=new DescPose(-89.606, 779.517, 193.516, 178.000, 0.476, -92.484);
JointPos p1Joint=new JointPos(-108.145, -50.137, 85.818, -125.599, -87.946, 74.329);
DescPose p2Desc=new DescPose(-24.656, 850.384, 191.361, 177.079, -2.058, -95.355);
JointPos p2Joint=new JointPos(-111.024, -41.538, 69.222, -114.913, -87.743, 74.329);
DescPose p3Desc=new DescPose(-99.813, 766.661, 241.878, -176.817, 1.917, -91.604);
JointPos p3Joint=new JointPos(-107.266, -56.116, 85.971, -122.560, -92.548, 74.331);
robot.GetForwardKin(p1Joint,p1Desc);
robot.GetForwardKin(p2Joint,p2Desc);
robot.GetForwardKin(p3Joint,p3Desc);
ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
DescPose[] posTCP = { p1Desc , p2Desc , p3Desc };
DescPose coordRtn = new DescPose();
robot.MoveJ(p1Joint, p1Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetExTCPPoint(1);
robot.MoveJ(p2Joint, p2Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetExTCPPoint(2);
robot.MoveJ(p3Joint, p3Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.SetExTCPPoint(3);
int rtn = robot.ComputeExTCF(coordRtn);
robot.SetExToolCoord(1, coordRtn, offdese);
robot.SetExToolList(1, coordRtn, offdese);
return 0;
}
6.15. Set workpiece reference point - three point method
/**
* @brief Set workpiece reference point - three point method
* @param [in] point_num Point number, range [1~3]
* @return Error code
*/
int SetWObjCoordPoint(int point_num);
6.16. Calculate workpiece coordinate system
/**
* @brief Calculate workpiece coordinate system
* @param [in] method Calculation method 0: origin-x axis-z axis 1: origin-x axis-xy plane
* @param [in] refFrame Reference coordinate system
* @param [out] wobj_pose Workpiece coordinate system
* @return Error code
*/
int ComputeWObjCoord(int method, int refFrame, DescPose wobj_pose);
6.17. Set workpiece coordinate system
/**
* @brief Set workpiece coordinate system
* @param [in] id Coordinate system number, range [1~15]
* @param [in] coord Workpiece coordinate system pose relative to end flange center
* @param [in] refFrame Reference coordinate system
* @return Error code
*/
int SetWObjCoord(int id, DescPose coord, int refFrame);
6.18. Set workpiece coordinate system list
/**
* @brief Set workpiece coordinate system list
* @param [in] id Coordinate system number, range [1~15]
* @param [in] coord Workpiece coordinate system pose relative to end flange center
* @param [in] refFrame Reference coordinate system
* @return Error code
*/
int SetWObjList(int id, DescPose coord, int refFrame);
6.19. Calculate workpiece coordinate system based on point information
/**
* @brief Calculate workpiece coordinate system based on point information
* @param [in] method Calculation method; 0: origin-x axis-z axis 1: origin-x axis-xy plane
* @param [in] pos Three TCP position groups
* @param [in] refFrame Reference coordinate system
* @param [in] tcp_pose Output workpiece coordinate system
* @return Error code
*/
int ComputeWObjCoordWithPoints(int method, DescPose[] pos, int refFrame,DescPose tcp_pose);
6.20. Get current workpiece coordinate system
/**
* @brief Get current workpiece coordinate system
* @param [in] flag 0-blocking, 1-non-blocking
* @param [out] desc_pos Workpiece coordinate system pose
* @return Error code
*/
int GetWObjOffset(int flag, DescPose desc_pos);
bottom of page