top of page

Python 11. Peripherals

11.1. Configuration of jaws

Prototype

SetGripperConfig(company,device,softversion=0,bus=0)

Description

Configuration jaws

Required Parameters

  • company: gripper claw manufacturer, 1-Robotiq, 2-Huiling, 3-Tianji, 4-Dahuan, 5-Knowledge;

  • device: device number, Robotiq (0-2F-85 series), Huiling (0-NK series, 1-Z-EFG-100), Tianji (0-TEG-110), Dahuan (0-PGI-140), Zhixing (0-CTPM2F20)

Default parameters

  • softversion: software version number, not used for now, default is 0;

  • bus: device mount end bus location, not used yet, default is 0;

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

  • errorcode Success-0 Failure- errcode

  • [number,company,device,softversion]: number, jaw number; company, jaw manufacturer, 1-Robotiq, 2-Huiling, 3-Tianji, 4-Dahuan, 5-Zhixing ;device, device number, Robotiq (0-2F-85 series), Huiling (0 -NK series,1-Z-EFG-100), Tianji(0-TEG-110), Dahuan(0-PGI-140), Zhixing(0-CTPM2F20) ;softvesion, software version number, not in use for the time being, default is 0.

11.3. Activate jaws

Prototype

ActGripper(index,action)

Description

Activate the jaws.

Mandatory parameter

  • index: jaw number;

  • action: 0-reset, 1-activate

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

  • index: jaw number;

  • pos: percentage of position, range [0~100];

  • vel: percentage of speed, in the range [0 to 100]; vel: percentage of speed, in the range [0 to 100].

  • force: percentage of torque, range [0 to 100];

  • maxtime: maximum wait time, range [0~30000], unit [ms];

  • block: 0-blocking, 1-non-blocking;

  • type: type of jaws, 0-parallel jaws; 1-rotary jaws;

  • rotNum:rotNum The number of rotations;

  • rotVel: Percentage of rotational velocity [0-100];

  • rotTorque: percentage of rotational torque [0-100].

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

  • errorcode Success-0 Failure- errcode

  • [fault,status]: status of gripper movement, fault:0-no error, 1-with error; status:0-movement not completed, 1-movement completed

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

  • errorcode Success-0 Failure- errcode

  • fault:0-correct,1-error

  • gripper_active:bit0 to bit15 correspond to the claw numbers 0 to 15. bit=0 indicates not activated, and bit=1 indicates activated

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

  • errorcode Success-0 Failure- errcode

  • fault:0-correct,1-error

  • position:Position percentage, ranging from 0 to 100%

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

  • errorcode Success-0 Failure- errcode

  • fault:0-correct,1-error

  • speed:Speed percentage, range 0 to 100%

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

  • errorcode Success-0 Failure- errcode

  • fault:0-correct,1-error

  • current:Current percentage, range 0 to 100%

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

  • errorcode Success-0 Failure- errcode

  • fault:0-correct,1-error

  • voltage:Voltage, unit: 0.1V

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

  • errorcode Success-0 Failure- errcode

  • fault:0-correct,1-error

  • temp:Temperature, unit: 0.1V

11.12. Calculate pre-capture point-visual

Prototype

ComputePrePick(desc_pos, zlength, zangle)

Description

Calculate pre-capture point-visual

Mandatory parameter

  • desc_pos: clip grab point Cartesian position.

  • zlength: z-axis offset.

  • zangle: rotational offset around the z-axis

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • pre_pos: pre-grip point Cartesian position

11.13. Calculate retreat point-visual

Prototype

ComputePostPick(desc_pos, zlength, zangle)

Description

Computing Retreat Point-Vision

Mandatory parameters

  • desc_pos: grab point Cartesian position;

  • zlength: z-axis offset.

  • zangle: rotational offset around the z-axis

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • post_pos: retreat point Cartesian poses

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, 905050, max_time, block, 0000)
print(f"MoveGripper retval is:{error}")
time.sleep(1)
error = robot.MoveGripper(index, 30500, max_time, block, 0000)
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.000351.569-178.1180.3143.833]
p2Desc = [-321.222185.189335.520-179.030-1.284-29.869]
retval, prepick_pose = robot.ComputePrePick(p1Desc, 100)
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, -100)
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()

robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 Fairino US official site Proudly created By G2T

bottom of page