Prototype | ComputeExTCF(point_num) |
Description | Calculate external tool coordinate system - three-point method (after setting three reference points) |
Mandatory parameter | point_num: point number, range [1~3] |
Default parameters | NULL |
Return Value |
|
6.12. Setting the external tool coordinate system
Prototype | SetExToolCoord(id,etcp,etool) |
Description | Setting the external tool coordinate system |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.13. Setting up a list of external tool coordinate systems
Prototype | SetExToolList(id,etcp ,etool) |
Description | Set the list of external tool coordinate systems |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.14. Example code for robot external tool coordinate system operation
from fairino import Robot
import time
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
p1Desc = [-89.606, 779.517, 193.516, 178.000, 0.476, -92.484]
p1Joint = [-108.145, -50.137, 85.818, -125.599, -87.946, 74.329]
p2Desc = [-24.656, 850.384, 191.361, 177.079, -2.058, -95.355]
p2Joint = [-111.024, -41.538, 69.222, -114.913, -87.743, 74.329]
p3Desc = [-99.813, 766.661, 241.878, -176.817, 1.917, -91.604]
p3Joint = [-107.266, -56.116, 85.971, -122.560, -92.548, 74.331]
exaxisPos = [0, 0, 0, 0]
offdese = [0, 0, 0, 0, 0, 0]
posTCP = [p1Desc, p2Desc, p3Desc]
robot.MoveJ(joint_pos=p1Joint,tool=1, user=0, vel=50)
robot.SetExTCPPoint(1)
robot.MoveJ(joint_pos=p2Joint,tool=1, user=0, vel=50)
robot.SetExTCPPoint(2)
robot.MoveJ(joint_pos=p3Joint,tool=1, user=0, vel=50)
robot.SetExTCPPoint(3)
rtn,coordRtn = robot.ComputeExTCF()
print(f"ComputeExTCF {rtn} coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
robot.SetExToolCoord(1, coordRtn, offdese)
robot.SetExToolList(1, coordRtn, offdese)
robot.CloseRPC()
6.15. Setting the workpiece reference point - three-point method
Prototype | SetWObjCoordPoint(point_num) |
Description | Setting the workpiece reference point - 3-point method |
Mandatory parameter | point_num: point number, range [1~3] |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.16. Calculation of the workpiece coordinate system - three-point method
Prototype | ComputeWObjCoord(method, refFrame) |
Description | Calculate the workpiece coordinate system - three-point method (three reference points are set and then calculated); |
Mandatory parameters |
|
Default parameters | NULL |
Return Value |
|
6.17. Setting the workpiece coordinate system
prototype | SetWObjCoord(id, coord, refFrame) |
Description | Setting the workpiece coordinate system |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.18. Setting the list of workpiece coordinate systems
prototype | SetWObjList(id, coord, refFrame) |
Description | Set the list of workpiece coordinate systems |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.19. Calculate the workpiece coordinate system based on the point information
New in version python: SDK-v2.0.8
Prototype | ComputeWObjCoordWithPoints(method, pos, refFrame) |
Description | Calculate the workpiece coordinate system based on the point information |
Mandatory parameters |
|
Default parameters | NULL |
Return Value |
|
6.20. Get the current workpiece coordinate system
prototype | GetWObjOffset(flag=1) |
Description | Get current workpiece coordinate system |
Mandatory parameters | NULL |
Default parameters | flag: 0-blocking, 1-non-blocking, default 1 |
Return Value |
|
6.21. Example of robot workpiece coordinate system manipulation code
from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
p1Desc = [-89.606, 779.517, 193.516, 178.000, 0.476, -92.484]
p2Desc = [-24.656, 850.384, 191.361, 177.079, -2.058, -95.355]
p3Desc = [-99.813, 766.661, 241.878, -176.817, 1.917, -91.604]
p1Joint = [-108.145, -50.137, 85.818, -125.599, -87.946, 74.329]
p2Joint = [-111.024, -41.538, 69.222, -114.913, -87.743, 74.329]
p3Joint = [-107.266, -56.116, 85.971, -122.560, -92.548, 74.331]
exaxisPos = [0, 0, 0, 0]
offdese = [0, 0, 0, 0, 0, 0]
posTCP = [p1Desc, p2Desc, p3Desc]
rtn,coordRtn = robot.ComputeWObjCoordWithPoints(1, posTCP, 0)
print(f"ComputeWObjCoordWithPoints {rtn} coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
robot.MoveJ(joint_pos=p1Joint,tool=1, user=0, vel=100)
robot.SetWObjCoordPoint(1)
robot.MoveJ(joint_pos=p2Joint,tool=1, user=0, vel=100)
robot.SetWObjCoordPoint(2)
robot.MoveJ(joint_pos=p3Joint,tool=1, user=0, vel=100)
robot.SetWObjCoordPoint(3)
rtn,coordRtn = robot.ComputeWObjCoord(1, 0)
print(f"ComputeWObjCoord {rtn} coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
robot.SetWObjCoord(1, coordRtn, 0)
robot.SetWObjList(1, coordRtn, 0)
rtn,getWobjDesc = robot.GetWObjOffset(0)
print(f"GetWObjOffset {rtn} coord is {getWobjDesc[0]} {getWobjDesc[1]} {getWobjDesc[2]} {getWobjDesc[3]} {getWobjDesc[4]} {getWobjDesc[5]}")
robot.CloseRPC()