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')
# Set the UDP communication parameters and load
robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
robot.ExtDevLoadUDPDriver()
# Set the parameters of the extended axis
robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
robot.SetRobotPosToAxis(1)
robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
# Expand the axis to enable and return to zero
robot.ExtAxisServoOn(1, 0)
robot.ExtAxisSetHoming(1, 0, 20, 3)
# Extended axis coordinate system calibration
pos = [] # Please fill in the specific coordinates
robot.SetRefPointInExAxisEnd(pos)
robot.PositionorSetRefPoint(1) # This operation should be repeated 4 times (using 4 dots)
error,coord = robot.PositionorComputeECoordSys()
robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
# Synchronize the starting and ending points of the movement
startdescPose = [] # Please fill in the specific coordinates
startjointPos = [] # Please fill in the specific coordinates
startexaxisPos = [] # Please fill in the specific coordinates
enddescPose = [] # Please fill in the specific coordinates
endjointPos = [] # Please fill in the specific coordinates
endexaxisPos = [] # Please fill in the specific coordinates
# Move to the starting point
robot.ExtAxisMove(startexaxisPos, 20, -1)
offdese = [0, 0, 0, 0, 0, 0]
robot.MoveJ(joint_pos=startjointPos,tool= 1,user= 1,vel= 100,acc= 100,ovl= 100,exaxis_pos= startexaxisPos,blendT= 0,offset_flag= 0,offset_pos= offdese)
robot.ExtAxisSyncMoveJ(endjointPos, enddescPose, 1, 1, endexaxisPos, 100, 100, 100, -1, 0, offdese)
robot.CloseRPC()
13.43. UDP extension axes synchronized with robot linear motion
New in version python: SDK-v2.1.5
Prototype | ExtAxisSyncMoveL(desc_pos, tool, user, exaxis_pos, joint_pos = [0.0,0.0,0.0,0.0,0.0,0.0,0.0], vel=20.0, acc=0.0, ovl=100.0, blendR=-1.0, search=0, offset_flag= 0, offset_pos=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],config=-1) |
Description | UDP extension axis synchronized motion with robot linear motion |
Mandatory parameters |
|
Default Parameters |
|
Return Value | Error Code Success-0 Failure- errcode; |