top of page

Python 6.11. Calculation of the external tool coordinate system - Six-point method

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

  • errorcode Success-0 Failure- errcode

  • etcp=[x,y,z,rx,ry,rz]: external tool coordinate system

6.12. Setting the external tool coordinate system

Prototype

SetExToolCoord(id,etcp,etool)

Description

Setting the external tool coordinate system

Mandatory parameters

  • id: coordinate system number, range [0~14];

  • etcp: External tool coordinate system in [mm][°];

  • etool: end-tool coordinate system in [mm] [°];

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

  • id: coordinate system number, range [0~14];

  • etcp: External tool coordinate system in [mm][°];

  • etool: end-tool coordinate system in [mm] [°];

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.606779.517193.516178.0000.476-92.484]
p1Joint = [-108.145-50.13785.818-125.599-87.94674.329]
p2Desc = [-24.656850.384191.361177.079-2.058-95.355]
p2Joint = [-111.024-41.53869.222-114.913-87.74374.329]
p3Desc = [-99.813766.661241.878-176.8171.917-91.604]
p3Joint = [-107.266-56.11685.971-122.560-92.54874.331]
exaxisPos = [0000]
offdese = [000000]
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

  • method: calculation method 0: origin-x-axis-z-axis, 1: origin-x-axis-xy-plane

  • refFrame: reference coordinate system

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • wobj_pose=[x,y,z,rx,ry,rz]: workpiece coordinate system

6.17. Setting the workpiece coordinate system

prototype

SetWObjCoord(id, coord, refFrame)

Description

Setting the workpiece coordinate system

Mandatory parameters

  • id: coordinate system number, range [0~14];

  • COORD: Position of the workpiece in the coordinate system relative to the center of the end flange in [mm][°].

  • refFrame: reference coordinate system

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

  • id: coordinate system number, range [0~14];

  • COORD: Position of the workpiece in the coordinate system relative to the center of the end flange in [mm][°].

  • refFrame: reference coordinate system

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

  • method:Calculation method; 0: origin - X-axis - Z-axis 1: origin - X-axis -xy plane

  • pos:Three TCP location groups

  • refFrame: reference coordinate system

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • wobj_offset=[x,y,z,rx,ry,rz]:Workpiece coordinate system calculated from point information, unit [mm][°]

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

  • errorcode Success-0 Failure- errcode

  • wobj_offset=[x,y,z,rx,ry,rz]: Relative position of the current workpiece coordinate system in [mm][°]

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.606779.517193.516178.0000.476-92.484]
p2Desc = [-24.656850.384191.361177.079-2.058-95.355]
p3Desc = [-99.813766.661241.878-176.8171.917-91.604]
p1Joint = [-108.145-50.13785.818-125.599-87.94674.329]
p2Joint = [-111.024-41.53869.222-114.913-87.74374.329]
p3Joint = [-107.266-56.11685.971-122.560-92.54874.331]
exaxisPos = [0000]
offdese = [000000]
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(10)
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()

robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 Fairino US official site Proudly created By G2T

bottom of page