Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for OnRobot RG2 Gripper #45

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Mofeywalker
Copy link
Contributor

@Mofeywalker Mofeywalker commented Aug 13, 2018

Hi,

I needed support for the OnRobot RG2 Gripper, so I implemented a little plugin which allows to open and close the gripper via a very simple API. I needed a lot of boilerplate code which is generated by the URCap plugin of the gripper.

Maybe this code is helpful for others.

Tested on an UR3 with FW 3.6.1.30595 and RG2 URCap version 1.9.0 and RG2 Firmware version 1.5.0

Best regards
Moritz

@Mofeywalker
Copy link
Contributor Author

I messed up the description. It's not a Robotique gripper, it's an OnRobot gripper.

@Mofeywalker Mofeywalker changed the title Support for Robotique RG2 Gripper Support for OnRobot RG2 Gripper Aug 27, 2018
@@ -277,6 +277,17 @@ def movej(self, joints, acc=0.1, vel=0.05, wait=True, relative=False, threshold=
self._wait_for_move(joints[:6], threshold=threshold, joints=True)
return self.getj()

def movej_to_pose(self, tpose, acc=0.1, vel=0.05, wait=True, relative=False, threshold=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is that method supposed to do? it looks like the same as movj or is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, the movej_to_pose method allows to set a pose instead of joints as target of the movej. I haven't found that variant in the api.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry forgot that one. Bit does that make sense at all? is tpose is a list of joint values then it is the same as movej, if it is a pose, then you need the inverse kinematic to find joint values to send... I really do not get what it does...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i pass a pose variable to movej the robot itself calculates the kinematic. You can try this yourself within Polyscope. You can pass a pose to movej. IMHO this just makes it easier to use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

joint positions (q can also be specified as a pose, then
inverse kinematics is used to calculate the corresponding
joint positions
)

From the script manual for movej

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not know about it. Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you should writ that comment in doc string so other people understand it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mofeywalker I am wondering is your movej_to_pose_list method working? BTW, I want to switch ON the welding torch and then use movej_to_pose_list, however the set_digital_out method is sent over as a complete program. When it finishes there is no program running and hence the digital output will fall back to OFF for safety sake. Thank you for your help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mofeywalker I am wondering is your movej_to_pose_list method working? BTW, I want to switch ON the welding torch and then use movej_to_pose_list, however the set_digital_out method is sent over as a complete program. When it finishes there is no program running and hence the digital output will fall back to OFF for safety sake. Thank you for your help.

hey @blackhorsewu the last time i worked on this in december 2018 it worked :) But I changed jobs in the meantime and don't have access to an UR anymore.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mofeywalker thank you very much for your reply. I would then try on it. Thank you also very much for the movej_to_pose. That solved my problem. I was trying to find out ways to call get_inverse_kin() and was getting nowhere! Anyway thank you again for the good work.

@@ -0,0 +1,273 @@

from urx.urscript import URScript
import time
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is a good idea to move all these gripper files to a directory called grippers or devices?

@@ -0,0 +1,273 @@

from urx.urscript import URScript
import time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,I am a student in Turkish German University and we are working on a project with UR3 and RG2 Gripper and we only found your python code for RG2 Gripper.Some movement code(movej,movep...) that you have been writen does not match the dokument (https://s3-eu-west-1.amazonaws.com/ur-support-site/45989/scriptManual.pdf) that have been lead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cengizfurkan patch welcome in another PR. but generally I think we should more the RG2 wrapper out of that repository

@michael-hart
Copy link

I've found the boilerplate code will close and open the gripper immediately, no matter which of the functions is called on it. Could anyone verify the same behaviour on their own gripper?

Fix syntax errors and documentation
@IE-MangChi
Copy link

import urx
import time
from urx.gripper import OnRobotGripperRG2
import sys

if name == 'main':

rob = urx.Robot("192.168.50.100")
gripper = OnRobotGripperRG2(rob)

if len(sys.argv) != 2:
    print("false")
    sys.exit()

if sys.argv[1] == "close":
    gripper.close_gripper()
if sys.argv[1] == "open":
    gripper.open_gripper()
time.sleep(2)

rob.close()
print("true")
sys.exit()

Hello, i want to control onrobot rg2 gripper in python.
i have succeeded in moving the robot.
but the gripper is not working. what can i do...ㅠ0ㅠ..
please give me some advice. i've been trying several things for nearly a month.
Thanks.

@kend11
Copy link

kend11 commented May 29, 2023

Hello, I am trying to control my onrobot rg2 gripper on UR10e in python but when I run the code, the error as shown below pops up. Any advice on how to solve this? Thank you!
Screenshot 2023-05-29 153424

The code that I run is this
image

I searched online that those people that faced similar issues, they solved it uninstalling urx that they installed through pip and cloning this repository directly. I tried that method but the issue persists. Any help will be greatly appreciated thanks!

@IE-MangChi
Copy link

IE-MangChi commented Jun 9, 2023 via email

@kend11
Copy link

kend11 commented Jun 9, 2023

@IE-MangChi what did you mean by "I failed and am controlling it through digital signals"? So, you are not using the function open_gripper() to control the gripper? Did you just set digital signals to true and false to open and close the gripper respectively? Thank you!

@Now4czyk
Copy link

Now4czyk commented Dec 1, 2023

Thanks to your code our gripper started to work. Thank you ;)
If anyone is looking for ROS2 solution with OnRobot RG2 and UR3e here is the working one:
https://github.com/Now4czyk/arws/blob/main/src/gripper_control/gripper_control/gripper_control_node.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants