Prototype | ServoCart(mode, desc_pos, exaxis, pos_gain=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0], acc=0.0, vel=0.0, cmdT=0.008,filterT=0.0, gain=0.0) |
Description | Cartesian space servo mode motion |
Required Parameters |
|
Default Parameters |
|
Return Value | Error code Success-0 Failure- errcode |
4.23. Cartesian Space Servo Mode Motion Code Example
from fairino import Robot
import time
robot = Robot.RPC('192.168.58.2')
desc_pos_dt = [83.00800, 50.525000, 29.246, 179.629, -7.138, -166.975]
exaxis = [100.0, 0.0, 0.0, 0.0]
pos_gain = [0.0] * 6
mode = 0
vel = 0.0
acc = 0.0
cmdT = 0.001
filterT = 0.0
gain = 0.0
flag = 0
count = 5000
robot.SetSpeed(20)
while count:
rtn = robot.ServoCart(mode, desc_pos_dt, exaxis, pos_gain, acc, vel, cmdT, filterT, gain)
print(f"ServoCart rtn is {rtn}")
count -= 1
desc_pos_dt[0] += 0.01
exaxis[0] += 0.01
robot.CloseRPC()
return 0
4.24. Start of spline motion
Prototype | SplineStart() |
Description | Sample movement begins |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.25. Sample motion PTP
Prototype | SplinePTP(joint_pos, tool, user, desc_pos = [0.0,0.0,0.0,0.0,0.0,0.0,0.0], vel = 20.0, acc = 100.0, ovl = 100.0) |
Description | Sample Motion PTP |
Mandatory parameters |
|
Default parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
4.26. End of spline motion
Prototype | SplineEnd() |
Description | End of spline motion |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.27. Spline motion 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')
joint_points = [
[-11.904, -99.669, 117.473, -108.616, -91.726, 74.256], # j1
[-45.615, -106.172, 124.296, -107.151, -91.282, 74.255], # j2
[-61.954, -84.409, 108.153, -116.316, -91.283, 74.260], # j3
[-89.575, -80.276, 102.713, -116.302, -91.284, 74.267] # j4
]
cart_points = [
[-419.524, -13.000, 351.569, -178.118, 0.314, 3.833], # desc_pos1
[-321.222, 185.189, 335.520, -179.030, -1.284, -29.869], # desc_pos2
[-327.622, 402.230, 320.402, -178.067, 2.127, -46.207], # desc_pos3
[-104.066, 544.321, 327.023, -177.715, 3.371, -73.818] # desc_pos4
]
offset_pos = [0] * 6
epos = [0] * 4
tool = user = 0
vel = acc = ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
err1 = robot.MoveJ(joint_pos=joint_points[0],tool=tool, user=user,vel=vel)
print(f"MoveJ 错误码: {err1}")
robot.SplineStart()
robot.SplinePTP(joint_pos=joint_points[0],tool=tool, user=user)
robot.SplinePTP(joint_pos=joint_points[1],tool=tool, user=user)
robot.SplinePTP(joint_pos=joint_points[2],tool=tool, user=user)
robot.SplinePTP(joint_pos=joint_points[3],tool=tool, user=user)
robot.SplineEnd()
robot.CloseRPC()
4.28. New spline movement begins
Changed in version python: SDK-v2.0.3
prototype | NewSplineStart(type,averageTime=2000) |
Description | New Sample Movement Begins |
Mandatory parameters |
|
Default Parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
4.29. New spline command point
Prototype | NewSplinePoint(desc_pos,tool,user,lastFlag,joint_pos=[0.0,0.0,0.0,0.0,0.0,0.0], vel = 0.0, acc = 0.0, ovl = 100.0 ,blendR = 0.0 ) |
description | new spline command point |
Mandatory parameters |
|
Default parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
4.30. End of new spline movement
Prototype | NewSplineEnd() |
Description | End of New Sample Campaign |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.31. Example of new spline motion 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')
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]
j3 = [-61.954, -84.409, 108.153, -116.316, -91.283, 74.260]
j4 = [-89.575, -80.276, 102.713, -116.302, -91.284, 74.267]
j5 = [-95.228, -54.621, 73.691, -112.245, -91.280, 74.268]
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]
desc_pos3 = [-327.622, 402.230, 320.402, -178.067, 2.127, -46.207]
desc_pos4 = [-104.066, 544.321, 327.023, -177.715, 3.371, -73.818]
desc_pos5 = [-33.421, 732.572, 275.103, -177.907, 2.709, -79.482]
offset_pos = [0, 0, 0, 0, 0, 0]
epos = [0, 0, 0, 0]
tool = 0
user = 0
vel = 100.0
acc = 100.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
err1 = robot.MoveJ(joint_pos=j1, tool=tool, user=user, vel=vel)
print(f"movej errcode:{err1}")
robot.NewSplineStart(1, 2000)
robot.NewSplinePoint(desc_pos=desc_pos1, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos2, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos3, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos4, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos5, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplineEnd()
robot.CloseRPC()
4.32. Robot termination motion
Prototype | StopMotion() |
Description | Terminate motion, use of terminate motion requires motion instruction to be non-blocking |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.33. Robot pause
Prototype | PauseMotion() |
Description | Pause motion. Using pause motion requires the motion instruction to be in a non-blocking state |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.34. Robot resume motion
Prototype | ResumeMotion() |
Description | Resume motion, using resume motion requires the motion instruction to be in a non-blocking state |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.35. Motion pause, resume, and stop code examples
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]
j5 =[-95.228, -54.621, 73.691, -112.245, -91.280, 74.268]
desc_pos1 = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
desc_pos5 = [-33.421, 732.572, 275.103, -177.907, 2.709, -79.482]
offset_pos = [0, 0, 0, 0, 0, 0]
epos = [0, 0, 0, 0]
tool = 0
user = 0
vel = 100.0
acc = 100.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
rtn = robot.MoveJ(joint_pos=j1, tool=tool, user=user, vel=vel)
rtn = robot.MoveJ(joint_pos=j5, tool=tool, user=user, vel=vel, blendT=1)
time.sleep(1)
robot.PauseMotion()
time.sleep(1)
robot.ResumeMotion()
time.sleep(1)
robot.StopMotion()
time.sleep(1)
robot.CloseRPC()
4.36. Overall shift in points begins
Prototype | PointsOffsetEnable(flag,offset_pos) |
Description | Point Overall Offset Begins |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.37. Overall offset of points ends
Prototype | PointsOffsetDisable() |
Description | End of overall point offset |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.38. Point offset 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')
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 = 100.0
acc = 100.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
time.sleep(1)
robot.PointsOffsetEnable(flag=0, offset_pos=offset_pos1)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
robot.PointsOffsetDisable()
robot.CloseRPC()
4.39. Control box motion AO start
New in version python: SDK-v2.0.4
Prototype | MoveAOStart(AONum,maxTCPSpeed=1000,maxAOPercent=100,zeroZoneCmp=20) |
Description | Control Box Motion AO Start |
Mandatory parameters |
|
Default Parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
4.40. End of control box movement AO
New in version python: SDK-v2.0.4
Prototype | MoveAOStop() |
Description | End of control box motion AO |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
4.41. End Motion AO Start
New in version python: SDK-v2.0.4
Prototype | MoveToolAOStart(AONum,maxTCPSpeed=1000,maxAOPercent=100,zeroZoneCmp =20) |
Description | End Motion AO Start |
Mandatory parameters |
|
Default Parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
4.42. End movement AO end
New in version python: SDK-v2.0.4
Prototype | MoveToolAOStop() |
Description | end movement AO end |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |