6. Common Robot Settings

6.1. Setting Tool Reference Points - Six-Point Method

Prototype

SetToolPoint(point_num)

Description

Setting Tool Reference Points - Six Point Method

Mandatory parameters

  • point_num: point number, range [1~6]

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.2. Calculation tool coordinate system - six-point method

Prototype

ComputeTool()

Description

Calculate the tool coordinate system - six-point method (after setting the six tool reference points)

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

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

6.3. Setting Tool Reference Points - Four Point Method

Prototype

SetTcp4RefPoint(point_num)

Description

Setting Tool Reference Points - Four Point Method

Mandatory parameter

point_num: point number, range [1~4]

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

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

6.4. Calculation Tool Coordinate System - Four Point Method

prototype

ComputeTcp4()

Description

Calculate tool coordinate system - four-point method (after setting the four tool reference points)

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

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

6.5. Calculate the tool coordinate system based on the point information

New in version python: SDK-v2.0.8

Prototype

ComputeToolCoordWithPoints(method, pos)

Description

Calculate the tool coordinate system based on the point information

Mandatory parameters

  • method:Calculation method; 0-four point method; One - six point method

  • pos:The array length of the joint position group is 4 in the four-point method and 6 in the six-point method

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

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

6.6. Setting the tool coordinate system

Prototype

SetToolCoord(id,t_coord,type,install,toolID,loadNum)

Description

Setting the tool coordinate system

Mandatory parameters

  • id: coordinate system number, range [1~15];

  • t_coord: Position of the tool center point relative to the center of the end flange in [mm][°];

  • type: 0 - tool coordinate system, 1 - sensor coordinate system;

  • install: installation position, 0 - robot end, 1 - robot exterior

  • toolID: tool ID

  • loadNum: load number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.7. Setting the tool coordinate system list

Prototype

SetToolList(id,t_coord ,type, install, loadNum)

Description

Set up a list of tool coordinate systems

Mandatory parameters

  • id: coordinate system number, range [1~15];

  • t_coord: [x,y,z,rx,ry,rz] Tool center point relative to end flange center position in [mm][°];

  • type: 0 - tool coordinate system, 1 - sensor coordinate system;

  • install: installation position, 0 - robot end, 1 - robot exterior

  • loadNum: load number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.8. Get the current tool coordinate system

Prototype

GetTCPOffset(flag=1)

Description

Get current tool coordinate system

Mandatory parameters

NULL

Default parameters

flag: 0-blocking, 1-non-blocking Default 1

Return Value

  • errorcode Success-0 Failure- errcode

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

6.9. Robot tool coordinate system manipulation code example

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5p1Desc = [186.331, 487.913, 209.850, 149.030, 0.688, -114.347]
 6p2Desc = [69.721, 535.073, 202.882, -144.406, -14.775, -89.012]
 7p3Desc = [146.861, 578.426, 205.598, 175.997, -36.178, -93.437]
 8p4Desc = [136.284, 509.876, 225.613, 178.987, 1.372, -100.696]
 9p5Desc = [138.395, 505.972, 298.016, 179.134, 2.147, -101.110]
10p6Desc = [105.553, 454.325, 232.017, -179.426, 0.444, -99.952]
11p1Joint = [-127.876, -75.341, 115.417, -122.741, -59.820, 74.300]
12p2Joint = [-101.780, -69.828, 110.917, -125.740, -127.841, 74.300]
13p3Joint = [-112.851, -60.191, 86.566, -80.676, -97.463, 74.300]
14p4Joint = [-116.397, -76.281, 113.845, -128.611, -88.654, 74.299]
15p5Joint = [-116.814, -82.333, 109.162, -118.662, -88.585, 74.302]
16p6Joint = [-115.649, -84.367, 122.447, -128.663, -90.432, 74.303]
17exaxisPos = [0, 0, 0, 0]
18offdese = [0, 0, 0, 0, 0, 0]
19posJ = [p1Joint, p2Joint, p3Joint, p4Joint, p5Joint, p6Joint]
20rtn,coordRtn = robot.ComputeToolCoordWithPoints(1, posJ)
21print(f"ComputeToolCoordWithPoints    {rtn}  coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
22robot.MoveJ(joint_pos=p1Joint,tool=0, user=0, vel=100)
23robot.SetToolPoint(1)
24robot.MoveJ(joint_pos=p2Joint,tool=0, user=0, vel=100)
25robot.SetToolPoint(2)
26robot.MoveJ(joint_pos=p3Joint,tool=0, user=0, vel=100)
27robot.SetToolPoint(3)
28robot.MoveJ(joint_pos=p4Joint,tool=0, user=0, vel=100)
29robot.SetToolPoint(4)
30robot.MoveJ(joint_pos=p5Joint,tool=0, user=0, vel=100)
31robot.SetToolPoint(5)
32robot.MoveJ(joint_pos=p6Joint,tool=0, user=0, vel=100)
33robot.SetToolPoint(6)
34rtn,coordRtn = robot.ComputeTool()
35print(f"6 Point ComputeTool        {rtn}  coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
36robot.SetToolList(1, coordRtn, 0, 0, 0)
37robot.MoveJ(joint_pos=p1Joint,tool=0, user=0, vel=100)
38robot.SetTcp4RefPoint(1)
39robot.MoveJ(joint_pos=p2Joint,tool=0, user=0, vel=100)
40robot.SetTcp4RefPoint(2)
41robot.MoveJ(joint_pos=p3Joint,tool=0, user=0, vel=100)
42robot.SetTcp4RefPoint(3)
43robot.MoveJ(joint_pos=p4Joint,tool=0, user=0, vel=100)
44robot.SetTcp4RefPoint(4)
45rtn,coordRtn = robot.ComputeTcp4()
46print(f"4 Point ComputeTool        {rtn}  coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
47robot.SetToolCoord(2, coordRtn, 0, 0, 1, 0)
48rtn,getCoord = robot.GetTCPOffset(0)
49print(f"GetTCPOffset    {rtn}  coord is {getCoord[0]} {getCoord[1]} {getCoord[2]} {getCoord[3]} {getCoord[4]} {getCoord[5]}")
50robot.CloseRPC()

6.10. Setting External Tool Reference Points-Six-Point Method

Prototype

SetExTCPPoint(point_num)

Description

Setting the external tool reference point - three-point method

Mandatory parameters

  • point_num: point number, range [1~3]

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

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

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5p1Desc = [-89.606, 779.517, 193.516, 178.000, 0.476, -92.484]
 6p1Joint = [-108.145, -50.137, 85.818, -125.599, -87.946, 74.329]
 7p2Desc = [-24.656, 850.384, 191.361, 177.079, -2.058, -95.355]
 8p2Joint = [-111.024, -41.538, 69.222, -114.913, -87.743, 74.329]
 9p3Desc = [-99.813, 766.661, 241.878, -176.817, 1.917, -91.604]
10p3Joint = [-107.266, -56.116, 85.971, -122.560, -92.548, 74.331]
11exaxisPos = [0, 0, 0, 0]
12offdese = [0, 0, 0, 0, 0, 0]
13posTCP = [p1Desc, p2Desc, p3Desc]
14robot.MoveJ(joint_pos=p1Joint,tool=1, user=0, vel=50)
15robot.SetExTCPPoint(1)
16robot.MoveJ(joint_pos=p2Joint,tool=1, user=0, vel=50)
17robot.SetExTCPPoint(2)
18robot.MoveJ(joint_pos=p3Joint,tool=1, user=0, vel=50)
19robot.SetExTCPPoint(3)
20rtn,coordRtn = robot.ComputeExTCF()
21print(f"ComputeExTCF {rtn}  coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
22robot.SetExToolCoord(1, coordRtn, offdese)
23robot.SetExToolList(1, coordRtn, offdese)
24robot.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

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4p1Desc = [-89.606, 779.517, 193.516, 178.000, 0.476, -92.484]
 5p2Desc = [-24.656, 850.384, 191.361, 177.079, -2.058, -95.355]
 6p3Desc = [-99.813, 766.661, 241.878, -176.817, 1.917, -91.604]
 7p1Joint = [-108.145, -50.137, 85.818, -125.599, -87.946, 74.329]
 8p2Joint = [-111.024, -41.538, 69.222, -114.913, -87.743, 74.329]
 9p3Joint = [-107.266, -56.116, 85.971, -122.560, -92.548, 74.331]
10exaxisPos = [0, 0, 0, 0]
11offdese = [0, 0, 0, 0, 0, 0]
12posTCP = [p1Desc, p2Desc, p3Desc]
13rtn,coordRtn = robot.ComputeWObjCoordWithPoints(1, posTCP, 0)
14print(f"ComputeWObjCoordWithPoints    {rtn}  coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
15robot.MoveJ(joint_pos=p1Joint,tool=1, user=0, vel=100)
16robot.SetWObjCoordPoint(1)
17robot.MoveJ(joint_pos=p2Joint,tool=1, user=0, vel=100)
18robot.SetWObjCoordPoint(2)
19robot.MoveJ(joint_pos=p3Joint,tool=1, user=0, vel=100)
20robot.SetWObjCoordPoint(3)
21rtn,coordRtn = robot.ComputeWObjCoord(1, 0)
22print(f"ComputeWObjCoord   {rtn}  coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} {coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
23robot.SetWObjCoord(1, coordRtn, 0)
24robot.SetWObjList(1, coordRtn, 0)
25rtn,getWobjDesc = robot.GetWObjOffset(0)
26print(f"GetWObjOffset    {rtn}  coord is {getWobjDesc[0]} {getWobjDesc[1]} {getWobjDesc[2]} {getWobjDesc[3]} {getWobjDesc[4]} {getWobjDesc[5]}")
27robot.CloseRPC()

6.22. Setting the global speed

Prototype

SetSpeed(vel)

Description

Set global speed

Mandatory parameter

  • vel: percentage of speed, range [0~100]

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.23. Setting robot acceleration

New in version python: SDK-v2.0.4

Prototype

SetOaccScale(acc)

Description

Setting the robot acceleration

Mandatory parameter

  • acc: percentage of robot acceleration

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.24. Getting the default speed

Prototype

GetDefaultTransVel()

Description

Get Default Speed

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • vel: default speed in [mm/s]

6.25. Setting the end load weight

Prototype

SetLoadWeight(loadNum, weight)

Description

Set the end load weight, incorrect load weight setting may cause the robot to go out of control in drag mode

Mandatory parameters

  • loadNum:load number

  • weight: unit [kg]

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.26. Setting the end load center of mass coordinates

Prototype

SetLoadCoord(x,y,z,loadNum = 0)

Description

Set end-load center of mass coordinates, incorrect load center of mass setting may cause robot to go out of control in drag mode

Mandatory parameter

  • x: center of mass coordinates in [mm].

  • y: coordinates of the center of mass in [mm].

  • z: coordinates of the center of mass in [mm]

Default parameters

  • loadNum: Payload number, 0 by default

Return Value

Error Code Success-0 Failure- errcode

6.27. Get the weight of the current load

Prototype

GetTargetPayload(flag=1)

Description

Get the quality of the current load

Mandatory parameters

NULL

Default parameters

flag: 0-blocking, 1-non-blocking Default 1

Return Value

  • errorcode Success-0 Failure- errcode

  • weight: current load weight in [kg]

6.28. Get the center of mass of the current load

Prototype

GetTargetPayloadCog(flag=1)

Description

Get the center of mass of the current load

Mandatory parameters

NULL

Default parameters

flag: 0-blocking, 1-non-blocking Default 1

Return Value

  • errorcode Success-0 Failure- errcode

  • cog=[x,y,z]: coordinates of the current center of mass in [mm]

6.29. Setting the robot mounting method - fixed mounting

Prototype

SetRobotInstallPos(method)

description

set robot mounting method - fixed mounting, wrong mounting method setting can cause robot to lose control in drag mode

Mandatory parameters

  • method: 0-flat loading, 1-side loading, 2-hanging loading

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.30. Setting the robot mounting angle - free mounting

Prototype

SetRobotInstallAngle(yangle,zangle)

Description

Setting the robot mounting angle - free mounting, wrong mounting angle setting can cause the robot to go out of control in drag mode

Mandatory parameters

  • yangle: angle of inclination;

  • zangle: angle of rotation

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.31. Getting the robot mounting angle

Prototype

GetRobotInstallAngle()

Description

Get robot mounting angle

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • [yangle,zangle]: yangle - angle of inclination, zangle - angle of rotation.

6.32. Setting system variable values

Prototype

SetSysVarValue(id,value)

Description

Setting System Variables

Mandatory parameters

  • id: variable number, in the range [1~20].

  • value: variable value

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.33. Getting system variable values

Prototype

GetSysVarValue(id)

Description

Get system variable values

Mandatory parameters

  • id: system variable number, range [1~20]

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • var_value: system variable value

6.34. Robot common setup code examples

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4for i in range(1, 100):
 5    robot.SetSpeed(i)
 6    robot.SetOaccScale(i)
 7    time.sleep(0.03)
 8error,defaultVel = robot.GetDefaultTransVel()
 9print(f"GetDefaultTransVel is {defaultVel}")
10for i in range(1, 21):
11    robot.SetSysVarValue(i, i + 0.5)
12    time.sleep(0.1)
13for i in range(1, 21):
14    value = robot.GetSysVarValue(i)
15    print(f"sys value {i} is: {value}")
16    time.sleep(0.1)
17robot.SetLoadWeight(0, 2.5)
18robot.SetLoadCoord(3.0,4.0,5.0)
19time.sleep(1)
20error,getLoad = robot.GetTargetPayload(0)
21error,getLoadTran = robot.GetTargetPayloadCog(0)
22print(f"get load is {getLoad}; get load cog is {getLoadTran[0]} {getLoadTran[1]} {getLoadTran[2]}")
23robot.SetRobotInstallPos(0)
24robot.SetRobotInstallAngle(15.0, 25.0)
25error,[anglex, angley] = robot.GetRobotInstallAngle()
26print(f"GetRobotInstallAngle x: {anglex}; y: {angley}")
27robot.CloseRPC()

6.35. Joint Friction Compensation Switch

Prototype

FrictionCompensationOnOff(state)

Description

Joint Friction Compensation Switch

Mandatory parameters

  • state: 0-off, 1-on

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.36. Setting the joint friction compensation coefficients - positive loading

Prototype

SetFrictionValue_level(coeff)

Description

Setting the joint friction compensation coefficient - Fixed mounting - Positive mounting

Mandatory parameters

  • coeff=[j1,j2,j3,j4,j5,j6]: six joint compensation coefficients

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.37. Setting the joint friction compensation coefficient - side mounting

Prototype

SetFrictionValue_wall(coeff)

Description

Setting the joint friction compensation coefficient - fixed mounting - side mounting

Mandatory parameters

  • coeff=[j1,j2,j3,j4,j5,j6]: six joint compensation coefficients

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.38. Setting the Joint Friction Compensation Factor - Inverted

Prototype

SetFrictionValue_ceiling(coeff)

Description

Setting the joint friction compensation coefficient - fixed mounting - inverted mounting

Mandatory parameters

  • coeff=[j1,j2,j3,j4,j5,j6]: six joint compensation coefficients

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.39. Setting the joint friction compensation factor - free mounting

Prototype

SetFrictionValue_freedom(coeff)

Description

Setting the joint friction compensation factor - free mounting

Mandatory parameters

  • coeff=[j1,j2,j3,j4,j5,j6]: six joint compensation coefficients

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.40. Robot setup joint friction compensation code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4lcoeff = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9]
 5wcoeff = [0.4, 0.4, 0.4, 0.4, 0.4, 0.4]
 6ccoeff = [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
 7fcoeff = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
 8rtn = robot.FrictionCompensationOnOff(1)
 9print(f"FrictionCompensationOnOff rtn is {rtn}")
10rtn = robot.SetFrictionValue_level(lcoeff)
11print(f"SetFrictionValue_level rtn is {rtn}")
12rtn = robot.SetFrictionValue_wall(wcoeff)
13print(f"SetFrictionValue_wall rtn is {rtn}")
14rtn = robot.SetFrictionValue_ceiling(ccoeff)
15print(f"SetFrictionValue_ceiling rtn is {rtn}")
16rtn = robot.SetFrictionValue_freedom(fcoeff)
17print(f"SetFrictionValue_freedom rtn is {rtn}")
18robot.CloseRPC()

6.41. Query Robot Error Code

Prototype

GetRobotErrorCode()

Description

Query Robot Error Code

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • [maincode subcode]: robot error code, maincode - main error code, subcode - suberror code

6.42. Error state clearing

Prototype

ResetAllError()

Description

Error state clearing, only resettable errors can be cleared

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.43. Robot fault state acquisition and clearing error code examples

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5p1Joint = [-108.145, -50.137, 85.818, -125.599, -87.946, 74.329]
 6robot.MoveJ(joint_pos=p1Joint, tool=5, user=2, vel=50)
 7time.sleep(1)
 8error,[maincode, subcode] = robot.GetRobotErrorCode()
 9print(f"robot maincode is {maincode}; subcode is {subcode}")
10time.sleep(1)
11robot.ResetAllError()
12time.sleep(1)
13error,[maincode, subcode] = robot.GetRobotErrorCode()
14print(f"robot maincode is {maincode}; subcode is {subcode}")
15robot.CloseRPC()

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

New in version python: SDK-v2.1.3

Prototype

SetWideBoxTempFanMonitorParam(enable, period)

Description

Set the monitoring parameters for the temperature and fan speed of the wide-voltage control box

Mandatory parameters

  • enable: 0- Monitoring is not enabled; 1- Enable monitoring

  • period: Monitoring period (s), ranging from 1 to 100

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

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

New in version python: SDK-v2.1.3

Prototype

GetWideBoxTempFanMonitorParam()

Description

Obtain the monitoring parameters of the temperature and fan speed of the wide-voltage control box

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • enable: 0- Monitoring is not enabled; 1- Enable monitoring

  • period: Monitoring period (s), ranging from 1 to 100

6.46. Sample code for obtaining wide voltage control box temperature and fan current status

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5robot.SetWideBoxTempFanMonitorParam(1, 2)
 6error, enable, period = robot.GetWideBoxTempFanMonitorParam()
 7print(f"GetWideBoxTempFanMonitorParam enable is:{enable},period is:{period}")
 8for i in range(100):
 9    error, pkg = robot.GetRobotRealTimeState()
10    print(f"robot ctrl box temp is:{pkg.wideVoltageCtrlBoxTemp},fan current is:{pkg.wideVoltageCtrlBoxFanCurrent}")
11    time.sleep(0.1)
12rtn = robot.SetWideBoxTempFanMonitorParam(0, 2)
13print(f"SetWideBoxTempFanMonitorParam rtn is:{rtn}")
14error, enable, period = robot.GetWideBoxTempFanMonitorParam()
15print(f"GetWideBoxTempFanMonitorParam enable is:{enable},period is:{period}")
16for i in range(100):
17    error, pkg = robot.GetRobotRealTimeState()
18    print(f"robot ctrl box temp is:{pkg.wideVoltageCtrlBoxTemp},fan current is:{pkg.wideVoltageCtrlBoxFanCurrent}")
19    time.sleep(0.1)
20robot.CloseRPC()

6.47. Sets the focus point

New in version python: SDK-v2.1.4

Prototype

SetFocusCalibPoint(pointNum, point)

Description

Sets the focus point

Mandatory parameters

  • pointNum:The number of the focus calibration point 1-8

  • point:Coordinate the points

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.48. Calculate the focus calibration result

New in version python: SDK-v2.1.4

Prototype

ComputeFocusCalib(pointNum)

Description

Calculate the focus calibration result

Mandatory parameters

  • pointNum:Number of calibration points

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • resultPos:Calibration result XYZ

  • accuracy:Calibration accuracy error

6.49. Enable focus following

New in version python: SDK-v2.1.4

Prototype

FocusStart(kp=50.0, kpredic=19.0, aMax=1440, vMax=180, type=0)

Description

Enable focus following

Mandatory parameters

NULL

Default parameters

  • kp:Scale parameter. Default is 50.0

  • kpredic:Feedforward parameter, default 19.0

  • aMax:Maximum angular acceleration limit, default 1440°/s^2

  • vMax:Maximum angular speed limit, default 180°/s

  • type:Lock X-axis pointing (0-reference input vector; 1-level; 2- vertical), 0 by default

Return Value

Error Code Success-0 Failure- errcode

6.50. Stop focusing following

New in version python: SDK-v2.1.4

Prototype

FocusEnd()

Description

Stop focusing following

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.51. Set the focus coordinates

New in version python: SDK-v2.1.4

Prototype

SetFocusPosition(pos)

Description

Set the focus coordinates

Mandatory parameters

  • pos:Focus coordinate XYZ

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.52. Robot focus following code example

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5p1Desc = [186.331, 487.913, 209.850, 149.030, 0.688, -114.347]
 6p1Joint = [-127.876, -75.341, 115.417, -122.741, -59.820, 74.300]
 7p2Desc = [69.721, 535.073, 202.882, -144.406, -14.775, -89.012]
 8p2Joint = [-101.780, -69.828, 110.917, -125.740, -127.841, 74.300]
 9p3Desc = [146.861, 578.426, 205.598, 175.997, -36.178, -93.437]
10p3Joint = [-112.851, -60.191, 86.566, -80.676, -97.463, 74.300]
11p4Desc = [136.284, 509.876, 225.613, 178.987, 1.372, -100.696]
12p4Joint = [-116.397, -76.281, 113.845, -128.611, -88.654, 74.299]
13p5Desc = [138.395, 505.972, 298.016, 179.134, 2.147, -101.110]
14p5Joint = [-116.814, -82.333, 109.162, -118.662, -88.585, 74.302]
15p6Desc = [105.553, 454.325, 232.017, -179.426, 0.444, -99.952]
16p6Joint = [-115.649, -84.367, 122.447, -128.663, -90.432, 74.303]
17exaxisPos = [0, 0, 0, 0]
18offdese = [0, 0, 100, 0, 0, 0]
19robot.MoveJ(joint_pos=p1Joint,tool=0,user=0,vel=100,acc=100,ovl=100,exaxis_pos=exaxisPos,blendT=-1,offset_flag=0,offset_pos=offdese)
20robot.SetTcp4RefPoint(1)
21robot.MoveJ(joint_pos=p2Joint,tool=0,user=0,vel=100,acc=100,ovl=100,exaxis_pos=exaxisPos,blendT=-1,offset_flag=0,offset_pos=offdese)
22robot.SetTcp4RefPoint(2)
23robot.MoveJ(joint_pos=p3Joint,tool=0,user=0,vel=100,acc=100,ovl=100,exaxis_pos=exaxisPos,blendT=-1,offset_flag=0,offset_pos=offdese)
24robot.SetTcp4RefPoint(3)
25robot.MoveJ(joint_pos=p4Joint,tool=0,user=0,vel=100,acc=100,ovl=100,exaxis_pos=exaxisPos,blendT=-1,offset_flag=0,offset_pos=offdese)
26robot.SetTcp4RefPoint(4)
27rtn,coordRtn = robot.ComputeTcp4()
28print(f"4 Point ComputeTool {rtn} coord is {coordRtn[0]} {coordRtn[1]} {coordRtn[2]} "
29      f"{coordRtn[3]} {coordRtn[4]} {coordRtn[5]}")
30robot.SetToolCoord(1, coordRtn, 0, 0, 1, 0)
31error, p1Desc = robot.GetForwardKin(p1Joint)
32error, p2Desc = robot.GetForwardKin(p2Joint)
33error, p3Desc = robot.GetForwardKin(p3Joint)
34robot.SetFocusCalibPoint(1, p1Desc)
35robot.SetFocusCalibPoint(2, p2Desc)
36robot.SetFocusCalibPoint(3, p3Desc)
37rtn, resultPos, accuracy = robot.ComputeFocusCalib(pointNum=3)
38print(f"ComputeFocusCalib coord is {rtn} {resultPos[0]} {resultPos[1]} {resultPos[2]} accuracy is {accuracy}")
39rtn = robot.SetFocusPosition(resultPos)
40error, p5Desc = robot.GetForwardKin(p5Joint)
41error, p6Desc = robot.GetForwardKin(p6Joint)
42robot.MoveL(desc_pos=p5Desc,tool=1,user=0,vel=10,acc=100,ovl=100,blendR=-1,blendMode=0,exaxis_pos=exaxisPos,search=0,offset_flag=1,offset_pos=offdese)
43robot.MoveL(desc_pos=p6Desc,tool=1,user=0,vel=10,acc=100,ovl=100,blendR=-1,blendMode=0,exaxis_pos=exaxisPos,search=0,offset_flag=1,offset_pos=offdese)
44robot.FocusStart(50, 19, 710, 90, 0)
45robot.MoveL(desc_pos=p5Desc,tool=1,user=0,vel=10,acc=100,ovl=100,blendR=-1,blendMode=0,exaxis_pos=exaxisPos,search=0,offset_flag=1,offset_pos=offdese)
46robot.MoveL(desc_pos=p6Desc,tool=1,user=0,vel=10,acc=100,ovl=100,blendR=-1,blendMode=0,exaxis_pos=exaxisPos,search=0,offset_flag=1,offset_pos=offdese)
47robot.FocusEnd()
48robot.CloseRPC()

6.53. Joint torque sensor sensitivity calibration function is enabled

New in version python: SDK-v2.1.7

Prototype

JointSensitivityEnable(status)

Description

Joint torque sensor sensitivity calibration function is enabled

Mandatory parameters

  • status:0- closed; 1- On

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.54. Joint torque sensor sensitivity data acquisition

New in version python: SDK-v2.1.7

Prototype

JointSensitivityCollect()

Description

Joint torque sensor sensitivity data acquisition

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.55. The sensitivity calibration results of the joint torque sensor were obtained

New in version python: SDK-v2.1.7

Prototype

JointSensitivityCalibration()

Description

The sensitivity calibration results of the joint torque sensor were obtained

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • calibResult:j1~j6 Joint sensitivity [0-1]

  • linearityn:j1~j6 joint linearity[0-1]

6.56. Get Joint Torque Sensor Hysteresis Error

Prototype

JointHysteresisError()

Description

Get joint torque sensor hysteresis error

Required Parameters

None

Default Parameters

None

Return Value

  • Error code Success-0 Failure- errcode

  • hysteresisError:j1~j6 joint hysteresis error

6.57. Get Joint Torque Sensor Repeatability

Prototype

JointRepeatability()

Description

Get joint torque sensor repeatability

Required Parameters

None

Default Parameters

None

Return Value

  • Error code Success-0 Failure- errcode

  • repeatability:j1~j6 joint repeatability

6.58. Set Joint Force Sensor Parameters

Prototype

SetAdmittanceParams(M, B, K, threshold, sensitivity, setZeroFlag)

Description

Set joint force sensor parameters

Required Parameters

  • M:J1-J6 mass coefficient [0.001 ~ 10]

  • B:J1-J6 damping coefficient [0.001 ~ 10]

  • K:J1-J6 stiffness coefficient [0.001 ~ 10]

  • threshold:Force control threshold, Nm

  • sensitivity:Sensitivity, Nm/V, [0 ~ 10]

  • setZeroFlag:Function enable flag; 0-Off; 1-On; 2-Record zero point at position 1; 3-Record zero point at position 2

Default Parameters

None

Return Value

  • Error code Success-0 Failure- errcode

6.59. Sample code for automatic calibration of joint torque sensor sensitivity

  1from fairino import Robot
  2import time
  3robot = Robot.RPC('192.168.58.2')
  4rtn = robot.JointSensitivityEnable(0)
  5rtn = robot.JointSensitivityEnable(1)
  6print(f"JointSensitivityEnable rtn is {rtn}")
  7curJPos = [0.0] * 6
  8rtn, curJPos = robot.GetActualJointPosDegree(0)
  9epos = [0.0] * 4
 10offset_pos = [0.0] * 6
 11jointPos1 = [curJPos[0], 0.0, 0.0, -90.0, 0.02, curJPos[5]]
 12descPos1 = [0.0] * 6
 13rtn, descPos1 = robot.GetForwardKin(jointPos1)
 14robot.MoveJ(joint_pos=jointPos1, desc_pos=descPos1, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 15time.sleep(0.2)
 16rtn = robot.JointSensitivityCollect()
 17print(f"JointSensitivityCollect 1 rtn is {rtn}")
 18time.sleep(0.1)
 19jointPos2 = [curJPos[0], -30.0, 0.0, -90.0, 0.02, curJPos[5]]
 20descPos2 = [0.0] * 6
 21rtn, descPos2 = robot.GetForwardKin(jointPos2)
 22robot.MoveJ(joint_pos=jointPos2, desc_pos=descPos2, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 23time.sleep(0.1)
 24rtn = robot.JointSensitivityCollect()
 25print(f"JointSensitivityCollect 2 rtn is {rtn}")
 26time.sleep(0.1)
 27jointPos3 = [curJPos[0], -60.0, 0.0, -90.0, 0.02, curJPos[5]]
 28descPos3 = [0.0] * 6
 29rtn, descPos3 = robot.GetForwardKin(jointPos3)
 30robot.MoveJ(joint_pos=jointPos3, desc_pos=descPos3, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 31time.sleep(0.1)
 32rtn = robot.JointSensitivityCollect()
 33print(f"JointSensitivityCollect 3 rtn is {rtn}")
 34time.sleep(0.1)
 35jointPos4 = [curJPos[0], -90.0, 0.0, -90.0, 0.02, curJPos[5]]
 36descPos4 = [0.0] * 6
 37rtn, descPos4 = robot.GetForwardKin(jointPos4)
 38robot.MoveJ(joint_pos=jointPos4, desc_pos=descPos4, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 39time.sleep(0.1)
 40rtn = robot.JointSensitivityCollect()
 41print(f"JointSensitivityCollect 4 rtn is {rtn}")
 42time.sleep(0.1)
 43jointPos5 = [curJPos[0], -120.0, 0.0, -90.0, 0.02, curJPos[5]]
 44descPos5 = [0.0] * 6
 45rtn, descPos5 = robot.GetForwardKin(jointPos5)
 46robot.MoveJ(joint_pos=jointPos5, desc_pos=descPos5, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 47time.sleep(0.1)
 48rtn = robot.JointSensitivityCollect()
 49print(f"JointSensitivityCollect 5 rtn is {rtn}")
 50time.sleep(0.1)
 51jointPos6 = [curJPos[0], -150.0, 0.0, -90.0, 0.02, curJPos[5]]
 52descPos6 = [0.0] * 6
 53rtn, descPos6 = robot.GetForwardKin(jointPos6)
 54robot.MoveJ(joint_pos=jointPos6, desc_pos=descPos6, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 55time.sleep(0.1)
 56rtn = robot.JointSensitivityCollect()
 57print(f"JointSensitivityCollect 6 rtn is {rtn}")
 58time.sleep(0.1)
 59jointPos7 = [curJPos[0], -180.0, 0.0, -90.0, 0.02, curJPos[5]]
 60descPos7 = [0.0] * 6
 61rtn, descPos7 = robot.GetForwardKin(jointPos7)
 62robot.MoveJ(joint_pos=jointPos7, desc_pos=descPos7, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 63time.sleep(0.1)
 64rtn = robot.JointSensitivityCollect()
 65print(f"JointSensitivityCollect 7 rtn is {rtn}")
 66time.sleep(0.1)
 67robot.MoveJ(joint_pos=jointPos6, desc_pos=descPos6, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 68time.sleep(0.1)
 69rtn = robot.JointSensitivityCollect()
 70print(f"JointSensitivityCollect 8 rtn is {rtn}")
 71time.sleep(0.1)
 72robot.MoveJ(joint_pos=jointPos5, desc_pos=descPos5, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 73time.sleep(0.1)
 74rtn = robot.JointSensitivityCollect()
 75print(f"JointSensitivityCollect 9 rtn is {rtn}")
 76time.sleep(0.1)
 77robot.MoveJ(joint_pos=jointPos4, desc_pos=descPos4, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 78time.sleep(0.1)
 79rtn = robot.JointSensitivityCollect()
 80print(f"JointSensitivityCollect 10 rtn is {rtn}")
 81time.sleep(0.1)
 82robot.MoveJ(joint_pos=jointPos3, desc_pos=descPos3, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 83time.sleep(0.1)
 84rtn = robot.JointSensitivityCollect()
 85print(f"JointSensitivityCollect 11 rtn is {rtn}")
 86time.sleep(0.1)
 87robot.MoveJ(joint_pos=jointPos2, desc_pos=descPos2, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 88time.sleep(0.1)
 89rtn = robot.JointSensitivityCollect()
 90print(f"JointSensitivityCollect 12 rtn is {rtn}")
 91time.sleep(0.1)
 92robot.MoveJ(joint_pos=jointPos1, desc_pos=descPos1, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=epos, blendT=-1, offset_flag=0, offset_pos=offset_pos)
 93time.sleep(0.2)
 94rtn = robot.JointSensitivityCollect()
 95print(f"JointSensitivityCollect 13 rtn is {rtn}")
 96time.sleep(0.1)
 97calibResult = [0.0] * 6
 98linearity = [0.0] * 6
 99rtn,calibResult, linearity = robot.JointSensitivityCalibration()
100print(f"JointSensitivityCalibration rtn is {rtn}")
101rtn = robot.JointSensitivityEnable(0)
102print(f"JointSensitivityEnable rtn is {rtn}")
103print(f"jointSensor Calib result is {calibResult[0]},{calibResult[1]},{calibResult[2]},{calibResult[3]},{calibResult[4]},{calibResult[5]}")
104print( f"jointSensor linearity is {linearity[0]},{linearity[1]},{linearity[2]},{linearity[3]},{linearity[4]},{linearity[5]}")
105hysteresisError = [0.0] * 6
106rtn,hysteresisError = robot.JointHysteresisError()
107print(f"JointHysteresisError result is {hysteresisError[0]},{hysteresisError[1]},{hysteresisError[2]},{hysteresisError[3]},{hysteresisError[4]},{hysteresisError[5]}")
108repeatability = [0.0] * 6
109rtn,repeatability = robot.JointRepeatability()
110print(f"JointRepeatability result is {repeatability[0]},{repeatability[1]},{repeatability[2]},{repeatability[3]},{repeatability[4]},{repeatability[5]}")
111M = [1.0] * 6
112B = [1.0] * 6
113K = [0.0] * 6
114threshold = [1.0] * 6
115setZeroFlag = 1
116rtn = robot.SetAdmittanceParams(M, B, K, threshold, calibResult, setZeroFlag)
117print(f"SetAdmittanceParams rtn is {rtn}")
118robot.CloseRPC()

6.60. The number of error frames at eight slave ports of the robot is obtained

New in version python: SDK-v2.1.7

Prototype

GetSlavePortErrCounter()

Description

The number of error frames at eight slave ports of the robot is obtained

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • inRecvErr:Input the number of error frames received

  • inCRCErr:Input the number of CRC error frames

  • inTransmitErr:Input the number of forwarding error frames

  • inLinkErr:Enter the number of link error frames

  • outRecvErr:Outputs the number of frames received incorrectly

  • outCRCErr:The number of CRC error frames is output

  • outTransmitErr:Outputs the number of forwarding error frames

  • outLinkErr:Output link error frames

6.61. Slave port error frame reset

New in version python: SDK-v2.1.7

Prototype

JointSensitivityEnable(slaveID)

Description

Slave port error frame reset

Mandatory parameters

  • slaveID:Slave station numbers 0 to 7

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.62. Get sample slave port error frame code

 1from fairino import Robot
 2import time
 3import threading
 4# Establish a connection with the robot controller and return a robot object if the connection is successful
 5robot = Robot.RPC('192.168.58.2')
 6inRecvErr = [0] * 8
 7inCRCErr = [0] * 8
 8inTransmitErr = [0] * 8
 9inLinkErr = [0] * 8
10outRecvErr = [0] * 8
11outCRCErr = [0] * 8
12outTransmitErr = [0] * 8
13outLinkErr = [0] * 8
14rtn,inRecvErr, inCRCErr, inTransmitErr, inLinkErr, outRecvErr, outCRCErr, outTransmitErr, outLinkErr = robot.GetSlavePortErrCounter()
15for i in range(8):
16    if inRecvErr[i] != 0:
17        print(f"inRecvErr {i} is {inRecvErr[i]}")
18    if inCRCErr[i] != 0:
19        print(f"inCRCErr {i} is {inCRCErr[i]}")
20    if inTransmitErr[i] != 0:
21        print(f"inTransmitErr {i} is {inTransmitErr[i]}")
22    if inLinkErr[i] != 0:
23        print(f"inLinkErr {i} is {inLinkErr[i]}")
24    if outRecvErr[i] != 0:
25        print(f"outRecvErr {i} is {outRecvErr[i]}")
26    if outCRCErr[i] != 0:
27        print(f"outCRCErr {i} is {outCRCErr[i]}")
28    if outTransmitErr[i] != 0:
29        print(f"outTransmitErr {i} is {outTransmitErr[i]}")
30    if outLinkErr[i] != 0:
31        print(f"outLinkErr {i} is {outLinkErr[i]}")
32print("others has no err!")
33for i in range(8):
34    robot.SlavePortErrCounterClear(i)
35robot.CloseRPC()

6.63. Set the feed-forward coefficient of each axis speed

New in version python: SDK-v2.1.7

Prototype

SetVelFeedForwardRatio(radio)

Description

Set the feed-forward coefficient of each axis speed

Mandatory parameters

  • radio:Each axis velocity feedforward coefficient

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

6.64. The velocity feedforward coefficients of each axis are obtained

New in version python: SDK-v2.1.7

Prototype

GetVelFeedForwardRatio()

Description

The velocity feedforward coefficients of each axis are obtained

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • radio:Each axis velocity feedforward coefficient

6.65. Robot velocity feedforward coefficient code example

 1from fairino import Robot
 2import time
 3import threading
 4# Establish a connection with the robot controller and return a robot object if the connection is successful
 5robot = Robot.RPC('192.168.58.2')
 6setRadio = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
 7robot.SetVelFeedForwardRatio(setRadio)
 8getRadio = [0.0] * 6
 9rtn,getRadio = robot.GetVelFeedForwardRatio()
10print(f"{getRadio[0]},{getRadio[1]},{getRadio[2]},{getRadio[3]},{getRadio[4]},{getRadio[5]}")
11robot.CloseRPC()

6.66. Photoelectric Sensor TCP Calibration - Compute Tool RPY

Prototype

TCPComputeRPY(Btool, Etool, sensor, radius, dz)

Description

Photoelectric Sensor TCP Calibration - Compute Tool RPY

Required Parameters

  • Btool: Robot Cartesian position

  • Etool: Current tool coordinate values

  • sensor: Current sensor coordinate values (not yet available)

  • radius: Circular motion radius in mm (not yet available)

  • dz: Movement distance along the negative Z-axis of the base coordinate system; when dz = 10000, the function directly returns tool RPY

Default Parameters

None

Return Value

  • Error code. Success - 0, Failure - errcode

6.67. Photoelectric Sensor TCP Calibration - Compute Tool XYZ

Prototype

TCPComputeXYZ(select, originDirection, pos1, pos2, pos3, pos4)

Description

Photoelectric Sensor TCP Calibration - Compute Tool XYZ

Required Parameters

  • 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

  • originDirection: 0-X direction; 1-Y direction; 2-Z direction

  • pos1: Robot Cartesian position 1

  • pos2: Robot Cartesian position 2

  • pos3: Robot Cartesian position 3

  • pos4: Robot Cartesian position 4

Default Parameters

None

Return Value

  • Error code. Success - 0, Failure - errcode

  • Return value (returned on successful call) TCP Tool XYZ values

6.68. Photoelectric Sensor TCP Calibration - Start Recording Flange Center Position

Prototype

TCPRecordFlangePosStart()

Description

Photoelectric Sensor TCP Calibration - Start Recording Flange Center Position

Required Parameters

None

Default Parameters

None

Return Value

  • Error code. Success - 0, Failure - errcode

6.69. Photoelectric Sensor TCP Calibration - Stop Recording Flange Center Position

Prototype

TCPRecordFlangePosEnd()

Description

Photoelectric Sensor TCP Calibration - Stop Recording Flange Center Position

Required Parameters

None

Default Parameters

None

Return Value

  • Error code. Success - 0, Failure - errcode

6.70. Photoelectric Sensor TCP Calibration - Get Tool Center Point Position

Prototype

TCPGetRecordFlangePos()

Description

Photoelectric Sensor TCP Calibration - Get Tool Center Point Position

Required Parameters

None

Default Parameters

None

Return Value

  • Error code. Success - 0, Failure - errcode

  • Return value (returned on successful call) TCP Tool center point position (x, y, z)

6.71. Photoelectric Sensor TCP Calibration

Prototype

PhotoelectricSensorTCPCalibration(luaPath, offsetX)

Description

Photoelectric Sensor TCP Calibration

Required Parameters

  • 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’

  • offsetX: Teaching point offset (x, y, z) in mm

Default Parameters

None

Return Value

  • Error code. Success - 0, Failure - errcode

  • Return value (returned on successful call) TCP Tool XYZ values

6.72. Photoelectric Sensor TCP Calibration Code Example

1from fairino import Robot
2import time
3robot = Robot.RPC('192.168.58.2')
4offset = [10.0, 10.0, 3.0]
5TCP = [0.0] * 6
6rtn, TCP = robot.PhotoelectricSensorTCPCalibration("/fruser/FR_CalibrateTheToolTcp.lua", offset)
7print(f"PhotoelectricSensorTCPCalibration rtn is {rtn},{TCP[0]},{TCP[1]},{TCP[2]},{TCP[3]},{TCP[4]},{TCP[5]}")
8robot.CloseRPC()
9return 0