11.1. Configuration of jaws
Prototype | SetGripperConfig(company,device,softversion=0,bus=0) |
Description | Configuration jaws |
Required Parameters |
|
Default parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
11.2. Get Jaw Configuration
Prototype | GetGripperConfig() |
Description | Get Jaw Configuration |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
11.3. Activate jaws
Prototype | ActGripper(index,action) |
Description | Activate the jaws. |
Mandatory parameter |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
11.4. Control jaws
Prototype | MoveGripper(index,pos,vel,force,maxtime,block,type,rotNum,rotVel,rotTorque) |
Description | Control jaws |
Mandatory parameter |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
11.5. Getting the jaw movement status
Prototype | GetGripperMotionDone() |
Description | Get the state of the jaw motion |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
11.6. Obtain the activated status of the gripper
New in version python: SDK-v2.1.2
Prototype | GetGripperActivateStatus() |
Description | Obtain the activated status of the gripper |
Mandatory parameter | NULL |
Default parameters | NULL |
Return Value |
|
11.7. Obtain the position of the gripper
New in version python: SDK-v2.1.2
Prototype | GetGripperCurPosition() |
Description | Obtain the position of the gripper |
Mandatory parameter | NULL |
Default parameters | NULL |
Return Value |
|
11.8. Obtain the gripper speed
New in version python: SDK-v2.1.2
Prototype | GetGripperCurSpeed() |
Description | Obtain the gripper speed |
Mandatory parameter | NULL |
Default parameters | NULL |
Return Value |
|
11.9. Obtain the gripper current
New in version python: SDK-v2.1.2
Prototype | GetGripperCurCurrent() |
Description | Obtain the gripper current |
Mandatory parameter | NULL |
Default parameters | NULL |
Return Value |
|
11.10. Obtain the gripper voltage
New in version python: SDK-v2.1.2
Prototype | GetGripperVoltage() |
Description | Obtain the gripper voltage |
Mandatory parameter | NULL |
Default parameters | NULL |
Return Value |
|
11.11. Obtain the temperature of the gripper
New in version python: SDK-v2.1.2
Prototype | GetGripperTemp() |
Description | Obtain the temperature of the gripper |
Mandatory parameter | NULL |
Default parameters | NULL |
Return Value |
|
11.12. Calculate pre-capture point-visual
Prototype | ComputePrePick(desc_pos, zlength, zangle) |
Description | Calculate pre-capture point-visual |
Mandatory parameter |
|
Default parameters | NULL |
Return Value |
|
11.13. Calculate retreat point-visual
Prototype | ComputePostPick(desc_pos, zlength, zangle) |
Description | Computing Retreat Point-Vision |
Mandatory parameters |
|
Default parameters | NULL |
Return Value |
|
11.14. Robot claw operation 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')
company = 4
device = 0
softversion = 0
bus = 2
index = 2
act = 0
max_time = 30000
block = 0
status = 0
fault = 0
active_status = 0
current_pos = 0
current = 0
voltage = 0
temp = 0
speed = 0
robot.SetGripperConfig(company, device, softversion, bus)
time.sleep(1)
error,[company, device, softversion, bus] = robot.GetGripperConfig()
print(f"gripper config:{company},{device},{softversion},{bus}")
robot.ActGripper(index, act)
time.sleep(1)
act = 1
robot.ActGripper(index, act)
time.sleep(1)
error = robot.MoveGripper(index, 90, 50, 50, max_time, block, 0, 0, 0, 0)
print(f"MoveGripper retval is:{error}")
time.sleep(1)
error = robot.MoveGripper(index, 30, 50, 0, max_time, block, 0, 0, 0, 0)
print(f"MoveGripper retval is:{error}")
error, [fault, status] = robot.GetGripperMotionDone()
print(f"motion status:{fault},{status}")
error, [fault, active_status] = robot.GetGripperActivateStatus()
print(f"gripper active fault is:{fault},status is:{active_status}")
error, [fault, current_pos] = robot.GetGripperCurPosition()
print(f"fault is:{fault},current position is:{current_pos}")
error, [fault, current] = robot.GetGripperCurCurrent()
print(f"fault is:{fault},current current is:{current}")
error, [fault, voltage] = robot.GetGripperVoltage()
print(f"fault is:{fault},current voltage is:{voltage}")
error, [fault, temp] = robot.GetGripperTemp()
print(f"fault is:{fault},current temperature is:{temp}")
error, [fault, speed] = robot.GetGripperCurSpeed()
print(f"fault is:{fault},current speed is:{speed}")
retval = 0
prepick_pose = [0.0]*6
postpick_pose = [0.0]*6
p1Desc = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
p2Desc = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
retval, prepick_pose = robot.ComputePrePick(p1Desc, 10, 0)
print(f"ComputePrePick retval is:{retval}")
print(f"xyz is:{prepick_pose[0]},{prepick_pose[1]},{prepick_pose[2]};rpy is:{prepick_pose[3]},{prepick_pose[4]},{prepick_pose[5]}")
retval, postpick_pose = robot.ComputePostPick(p2Desc, -10, 0)
print(f"ComputePostPick retval is:{retval}")
print(f"xyz is:{postpick_pose[0]},{postpick_pose[1]},{postpick_pose[2]};rpy is:{postpick_pose[3]},{postpick_pose[4]},{postpick_pose[5]}")
robot.CloseRPC()