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

Controlling a Robotiq gripper #20

Closed
RaduCorcodel opened this issue Aug 9, 2019 · 5 comments
Closed

Controlling a Robotiq gripper #20

RaduCorcodel opened this issue Aug 9, 2019 · 5 comments

Comments

@RaduCorcodel
Copy link

RaduCorcodel commented Aug 9, 2019

I'm trying to get the Robotic gripper to open and close in position mode. Here is the code I am using:

#!/usr/bin/env python

import sys
import rospy
from kortex_driver.srv import *
from kortex_driver.msg import *

def Gripper_client():

    rospy.wait_for_service('SendGripperCommand')
    rospy.wait_for_service('GetMeasuredGripperMovement')

    try:
        function_Gripper = rospy.ServiceProxy('SendGripperCommand', SendGripperCommand)
        function_GetMeasuredGripper = rospy.ServiceProxy('GetMeasuredGripperMovement',GetMeasuredGripperMovement)

        current_gripper = function_GetMeasuredGripper()
        request = SendGripperCommandRequest()

        request.input.gripper.finger = current_gripper.output.finger
        request.input.mode = 3
        request.input.gripper.finger[0].value = 0.1

        function_Gripper(request)

    except rospy.ServiceException as e:
        print "Service call failed: %s"%e

if __name__ == "__main__":
    Gripper_client() `

Though I set the gripper mode to 3 (per documentation) the gripper either fully closes if I give it any negative value, and fully opens when I give it any positive value. This also contradicts the documentation where it says that in position mode, admissible values for each finger is between 0 and 1.0, where 0 is closed and 1.0 is fully open.

Any ideas? Maybe the code I'm using has a bug?
Thanks.

@alexvannobel
Copy link
Contributor

alexvannobel commented Aug 13, 2019

Hi @RaduCorcodel ,

Since the version 2.0 has just been released, can you try either the low-level gripper control example or the high-level gripper control example? The latter may be more useful to you since you use the SendGripperCommand function in your own code. Note that this code is not ROS based and uses the Kortex Python API (ROS uses the C++ API in the driver).

Since this is ROS code, I also invite you to look at the ros_kortex 2.0 release and the full_arm_movement example, which controls the gripper in position.

Best,
Alex

@RaduCorcodel
Copy link
Author

Thank you. I pulled the new release and will try that. So far I have upgraded the firmware on the robot but the vision module fails to update. I know it's an unrelated topic so I won't go into details here. I submitted a ticket and hopefully will get sorted out soon.

@alexvannobel
Copy link
Contributor

Hi @RaduCorcodel ,

I invite you to take a look at #22 for the vision module problem.

Best,
Alex

@alexvannobel
Copy link
Contributor

Hi @RaduCorcodel
Was that problem solved for you?

@RaduCorcodel
Copy link
Author

Hi @alexvannobel, so sorry for the late reply. Yes, it is all sorted out since the 2.0 release. Thank you for the help.

Closing

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

No branches or pull requests

2 participants