Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Using Robotiq Airpick Vacuum Gripper through API

#1
Hello everyone,

I am trying to develop a custom app through Python API. I am working online with a UR10e robot and Robotiq AirPick Vacuum Gripper. In the RoboDK UI I have created a custom code called AttachRobot and selected the InsertCode option.
My code is:
Code:
rq_vacuum_grip()
When I click "Send program to Robot" it works ok. The gripper pulls air through suction cups.

I want to incoorporate this command in my Python API script.
I tried using

Code:
robot.RunInstruction('rq_vacuum_grip()', run_type=1)

but when the program reaches this line nothing happens on the robot.

Does anyone have any idea how can I use RobotiQ AirPick through Python API?

Toni
#2
Did you customize your post processor to make the vacuum gripper work offline?

When you use the online connection, the driver sends a special script to the robot that should include the same header you have with default scripts.

For example, we wrote this procedure when you use the standard RobotiQ gripper:
https://robodk.com/doc/en/Robots-Univers...er-RobotiQ

From this procedure you can download the special script to drive the gripper. You can customize the header to include all necessary functions. The included progrobodk.script file already includes the rq_vacuum_grip and rq_vacuum_release functions you need.

And more importantly, you can customize the behavior of the MSG_RUNPROG instruction. This MSG_RUNPROG passes the string and the number. You'll have to replace rq_move_and_wait(prog_num) by the corresponding commands to turn on or off the vacuum gripper.

You may need something like this:
Code:
if prog_id > 0:
  rq_vacuum_grip()
else:
  rq_vacuum_release()
end
And then through the API:
Code:
# Grip with the vacuum gripper:
robot.RunInstruction('grip(1)')

# Release the vacuum gripper:
robot.RunInstruction('grip(0)')
The number is more important than the name with this implementation.
#3
Hi Albert,

thank you for your answer. I had some time so I have been trying to do what you told me.
I have modified the progrobodk.script file so:
Code:
# Run a program
          prog_num = socket_read_binary_integer(1)
          prog_name = socket_read_string()
         
          # we can run the following code and call the program by number in a customized way
          if prog_num[0] != 1:
            popup("One value expected","Error",False,True,blocking=True)
            break
          end


        prog_id = prog_num[1]
         
         
          if prog_num[0] != 1:
            popup("One value expected","Error",False,True,blocking=True)
            break
          end
          prog_id = prog_num[1]
         
         
       
          if True:
            rq_vacuum_grip()
          else:
            rq_vacuum_release()
          end
and in my API I am using the commands
Code:
robot.RunInstruction('grip(1)')
time.sleep(3)
robot.RunInstruction('grip(0)')

On the robot, both commands are executing vaccum_grip instead of vacuum_release.

Where have I made a mistake?
#4
In your sample code, the condition is always True, which will always run the grip command.

The value of the number is prog_id, so you should check against this variable as shown in the following example:
Code:
          if prog_id > 0:
            rq_vacuum_grip()
          else:
            rq_vacuum_release()
          end
  




Users browsing this thread:
1 Guest(s)