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')
j1 = [-11.904, -99.669, 117.473, -108.616, -91.726, 74.256]
j2 = [-45.615, -106.172, 124.296, -107.151, -91.282, 74.255]
desc_pos1 = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
desc_pos2 = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
offset_pos = [0, 0, 0, 0, 0, 0]
offset_pos1 = [0, 0, 50, 0, 0, 0]
epos = [0, 0, 0, 0]
tool = 0
user = 0
vel = 20.0
acc = 20.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
robot.MoveAOStart(0, 100, 100, 20)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
robot.MoveAOStop()
time.sleep(1)
robot.MoveToolAOStart(0, 100, 100, 20)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
robot.MoveToolAOStop()
robot.CloseRPC()
4.44. Start Ptp motion FIR filtering
New in version python: SDK-v2.1.2
Prototype | PtpFIRPlanningStart(maxAcc, maxJek) |
Description | Start Ptp motion FIR filtering |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.45. Disable Ptp motion FIR filtering
New in version python: SDK-v2.0.7
Prototype | PtpFIRPlanningEnd() |
Description | Disable Ptp motion FIR filtering |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.46. LIN, ARC motion FIR filtering is started
New in version python: SDK-v2.0.7
Prototype | LinArcFIRPlanningStart(maxAccLin,maxAccDeg,maxJerkLin,maxJerkDeg) |
Description | LIN, ARC motion FIR filtering is started |
Mandatory parameter |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.47. Turn off LIN and ARC motion FIR filtering
New in version python: SDK-v2.0.7
Prototype | LinArcFIRPlanningEnd() |
Description | Turn off LIN and ARC motion FIR filtering |
Mandatory parameter | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.48. FIR filtering code example
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')
startjointPos = [-11.904, -99.669, 117.473, -108.616, -91.726, 74.256]
startjointPos = [-11.904, -99.669, 117.473, -108.616, -91.726, 74.256]
midjointPos = [-45.615, -106.172, 124.296, -107.151, -91.282, 74.255]
endjointPos = [-29.777, -84.536, 109.275, -114.075, -86.655, 74.257]
startdescPose = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
middescPose = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
enddescPose = [-487.434, 154.362, 308.576, 176.600, 0.268, -14.061]
exaxisPos = [0.0, 0.0, 0.0, 0.0]
offdese = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
rtn = robot.PtpFIRPlanningStart(1000.0, 1000.0)
print(f"PtpFIRPlanningStart rtn is {rtn}")
error = robot.MoveJ(joint_pos=startjointPos,tool= 0,user= 0,desc_pos=startdescPose,vel= 100,acc=100,ovl=100, blendT=-1.0, offset_flag=0)
print(f"MoveJ rtn is {rtn}")
error = robot.MoveJ(joint_pos=endjointPos,tool= 0,user= 0,desc_pos=enddescPose,vel= 100,acc=100,ovl=100, blendT=-1.0, offset_flag=0)
print(f"MoveJ rtn is {rtn}")
robot.PtpFIRPlanningEnd()
print(f"PtpFIRPlanningEnd rtn is {rtn}")
rtn = robot.LinArcFIRPlanningStart(1000, 1000, 1000, 1000)
print(f"LinArcFIRPlanningStart rtn is {rtn}")
error = robot.MoveL(desc_pos=startdescPose,tool= 0,user= 0, joint_pos=startjointPos,vel= 100,overSpeedStrategy=1,speedPercent=1)
print(f"MoveL rtn is {rtn}")
error = robot.MoveC(desc_pos_p=middescPose,tool_p= 0,user_p= 0, joint_pos_p=midjointPos,vel_p= 100,desc_pos_t=enddescPose,tool_t= 0,user_t= 0,joint_pos_t=endjointPos,vel_t= 100)
print(f"MoveC rtn is {rtn}")
robot.LinArcFIRPlanningEnd()
print(f"LinArcFIRPlanningEnd rtn is {rtn}")
robot.CloseRPC()
4.49. Acceleration smooth on
New in version python: SDK-v2.1.1
Prototype | AccSmoothStart(saveFlag_flag) |
Description | Acceleration smooth on |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.50. Acceleration smooth closing
New in version python: SDK-v2.1.1
Prototype | AccSmoothEnd(saveFlag_flag) |
Description | Acceleration smooth closing |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.51. Acceleration smoothing code example
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')
startjointPos = [-11.904, -99.669, 117.473, -108.616, -91.726, 74.256]
endjointPos = [-45.615, -106.172, 124.296, -107.151, -91.282, 74.255]
startdescPose = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
enddescPose = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
exaxisPos = [0.0, 0.0, 0.0, 0.0]
offdese = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
rtn = robot.AccSmoothStart(0)
print(f"AccSmoothStart rtn is {rtn}")
robot.MoveJ(joint_pos=startjointPos,tool= 0,user= 0,vel= 100)
robot.MoveJ(joint_pos=endjointPos,tool= 0,user= 0,vel= 100)
rtn = robot.AccSmoothEnd(0)
print(f"AccSmoothEnd rtn is {rtn}")
4.52. Setting the machine’s specified attitude speed on
New in version python: SDK-v2.0.5
Prototype | AngularSpeedStart(ratio) |
Description | Specifies that attitude speed is on. |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.53. Specify Attitude Velocity Off
New in version python: SDK-v2.0.5
Prototype | AngularSpeedEnd() |
Description | Specify Attitude Velocity Off |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.54. Robot specified pose velocity code example
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')
startjointPos = [-11.904, -99.669, 117.473, -108.616, -91.726, 74.256]
endjointPos = [-45.615, -106.172, 124.296, -107.151, -91.282, 74.255]
startdescPose = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
enddescPose = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
exaxisPos = [0.0, 0.0, 0.0, 0.0]
offdese = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
rtn = robot.AngularSpeedStart(50)
print(f"AngularSpeedStart rtn is {rtn}")
robot.MoveJ(joint_pos=startjointPos, tool=0,user= 0,vel= 100)
robot.MoveJ(joint_pos=endjointPos, tool=0,user= 0,vel= 100)
rtn = robot.AngularSpeedEnd()
print(f"AngularSpeedEnd rtn is {rtn}")
robot.CloseRPC()
4.55. Odd-position protection on.
New in version python: SDK-v2.0.5
Prototype | SingularAvoidStart(protectMode, minShoulderPos=100, minElbowPos=50, minWristPos=10) |
Description | Turn on odd-bit posture protection. |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
|
4.56. Odd position protection off
New in version python: SDK-v2.0.5
Prototype | SingularAvoidEnd() |
Description | Turn off odd-position protection |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
4.57. Example of robot singular pose protection code
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')
startjointPos = [-11.904, -99.669, 117.473, -108.616, -91.726, 74.256]
endjointPos = [-45.615, -106.172, 124.296, -107.151, -91.282, 74.255]
startdescPose = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
enddescPose = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
exaxisPos = [0.0, 0.0, 0.0, 0.0]
offdese = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
rtn = robot.SingularAvoidStart(2, 10, 5, 5)
print(f"SingularAvoidStart rtn is {rtn}")
robot.MoveJ(joint_pos=startjointPos, tool=0,user= 0,vel= 100)
robot.MoveJ(joint_pos=endjointPos, tool=0,user= 0,vel= 100)
rtn = robot.SingularAvoidEnd()
print(f"SingularAvoidEnd rtn is {rtn}")
robot.CloseRPC()
4.58. Clear the motor command queue
New in version python: SDK-v2.1.7
Prototype | MotionQueueClear() |
Description | Clear the motor command queue |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
4.59. Clear Motion Command Queue
Prototype | MoveToIntersectLineStart(mainPoint, piecePoint, tool, wobj, vel, acc, ovl, oacc, moveType,mainExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],pieceExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],extAxisFlag=0,exaxisPos=[0.0,0.0,0.0,0.0],moveDirection=0,offset=[0.0,0.0,0.0,0.0,0.0,0.0]) |
Description | Clear motion command queue |
Required Parameters |
|
Default Parameters | None |
Return Value |
|
4.60. Intersecting Line Motion
Prototype | MoveIntersectLine(mainPoint, piecePoint, tool, wobj, vel, acc, ovl, oacc, moveDirection,mainExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],pieceExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],extAxisFlag=0,exaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],offset=[0.0,0.0,0.0,0.0,0.0,0.0]) |
Description | Intersecting line motion |
Required Parameters |
|
Default Parameters | None |
Return Value |
|
4.61. Robot Intersecting Line Motion Code Example
from fairino import Robot
import time
robot = Robot.RPC('192.168.58.2')
mainPoint = [[0.0] * 6 for _ in range(6)]
piecePoint = [[0.0] * 6 for _ in range(6)]
mainExaxisPos = [[0.0] * 4 for _ in range(6)]
pieceExaxisPos = [[0.0] * 4 for _ in range(6)]
extAxisFlag = 1
exaxisPos = [[0.0] * 4 for _ in range(4)]
offset = [0.0, 2.0, 30.0, -2.0, 0.0, 0.0]
mainPoint[0] = [490.004, -383.194, 402.735, -9.332, -1.528, 69.594]
mainPoint[1] = [444.950, -407.117, 389.011, -5.546, -2.196, 65.279]
mainPoint[2] = [445.168, -463.605, 355.759, -1.544, -10.886, 57.104]
mainPoint[3] = [507.529, -485.385, 343.013, -0.786, -4.834, 61.799]
mainPoint[4] = [554.390, -442.647, 367.701, -4.761, -10.181, 64.925]
mainPoint[5] = [532.552, -394.003, 396.467, -13.732, -13.592, 67.411]
mainExaxisPos[0] = [-29.996, 0.000, 0.000, 0.000]
mainExaxisPos[1] = [-29.996, 0.000, 0.000, 0.000]
mainExaxisPos[2] = [-29.996, 0.000, 0.000, 0.000]
mainExaxisPos[3] = [-29.996, 0.000, 0.000, 0.000]
mainExaxisPos[4] = [-29.996, 0.000, 0.000, 0.000]
mainExaxisPos[5] = [-29.996, 0.000, 0.000, 0.000]
piecePoint[0] = [505.571, -192.408, 316.759, 38.098, 37.051, 139.447]
piecePoint[1] = [533.837, -201.558, 332.340, 34.644, 42.339, 137.748]
piecePoint[2] = [530.386, -225.085, 373.808, 35.431, 45.111, 137.560]
piecePoint[3] = [485.646, -229.195, 383.778, 33.870, 45.173, 137.064]
piecePoint[4] = [460.551, -212.161, 354.256, 28.856, 45.602, 135.930]
piecePoint[5] = [474.217, -197.124, 324.611, 42.469, 41.133, 148.167]
pieceExaxisPos[0] = [-29.996, -0.000, 0.000, 0.000]
pieceExaxisPos[1] = [-29.996, -0.000, 0.000, 0.000]
pieceExaxisPos[2] = [-29.996, -0.000, 0.000, 0.000]
pieceExaxisPos[3] = [-29.996, -0.000, 0.000, 0.000]
pieceExaxisPos[4] = [-29.996, -0.000, 0.000, 0.000]
pieceExaxisPos[5] = [-29.996, -0.000, 0.000, 0.000]
exaxisPos[0] = [-29.996, -0.000, 0.000, 0.000]
exaxisPos[1] = [-44.994, 90.000, 0.000, 0.000]
exaxisPos[2] = [-59.992, 0.002, 0.000, 0.000]
exaxisPos[3] = [-44.994, -89.997, 0.000, 0.000]
tool = 2
wobj = 0
vel = 100.0
acc = 100.0
ovl = 12.0
oacc = 12.0
moveType = 1
moveDirection = 1
rtn = robot.MoveToIntersectLineStart(mainPoint=mainPoint, mainExaxisPos=mainExaxisPos, piecePoint=piecePoint, pieceExaxisPos=pieceExaxisPos, extAxisFlag=extAxisFlag,exaxisPos=exaxisPos[0], tool=tool, wobj=wobj, vel=vel, acc=acc, ovl=ovl, oacc=oacc, moveType=moveType, moveDirection=moveDirection, offset=offset)
print(f"MoveToIntersectLineStart rtn is {rtn}")
rtn = robot.MoveIntersectLine(mainPoint=mainPoint, mainExaxisPos=mainExaxisPos, piecePoint=piecePoint, pieceExaxisPos=pieceExaxisPos, extAxisFlag=extAxisFlag, exaxisPos=exaxisPos, tool=tool,wobj=wobj, vel=vel, acc=acc, ovl=5.0, oacc=5.0, moveDirection=moveDirection, offset=offset)
print(f"MoveIntersectLine rtn is {rtn}")
robot.CloseRPC()
4.62. Stationary Air Motion
Prototype | MoveStationary() |
Description | Stationary Air Motion |
Required Parameters | None |
Default Parameters | None |
Return Value |
|
4.63. Stationary Air Motion Code Example
from fairino import Robot
import time
robot = Robot.RPC('192.168.58.2')
rtn = robot.LaserSensorRecordandReplay(0, 10, 1, 0, 0.1, 1, 0, 10, 100)
print(f"LaserSensorRecordandReplay rtn is {rtn}")
rtn = robot.MoveStationary()
print(f"MoveStationary rtn is {rtn}")
rtn = robot.LaserSensorRecord1(0, 10)
print(f"LaserSensorRecordandReplay rtn is {rtn}")
robot.CloseRPC()
return 0