Giter Site home page Giter Site logo

danfoa / robotiq_2finger_grippers Goto Github PK

View Code? Open in Web Editor NEW
104.0 6.0 55.0 1.04 MB

ROS packages enabling the control, visualization and simulation of the Robotiq 2 Fingers Adaptive Grippers model version C3

CMake 7.04% C++ 7.16% Python 85.80%
ros ros-kinetic ros-melodic robotiq robotiq-gripper robotiq-grippers robotiq-85mm robotiq-140mm actionlib grippers

robotiq_2finger_grippers's Introduction

This package contains the necesary files to connect and control the Robotiq 2 finger adaptive grippers (85mm and 140mm stroke) of the C series through a USB port using the Modbus RTU communication protocol. (Currently only URDF descriptions of models C3 are available)

C3 models

Note: This package is based on waypointrobotics/robotiq_85_gripper and ros-industrial/robotiq, with many code changes and feature inclusions as:

  • Use of ros actionlib Action Server/Clients to properly connect, control and command the grippers.
  • Gripper driver joint position update to /joint_state topic.
  • Simulation of grippers operation.
  • Configuration of collision meshes as simplified convex hulls of the visual meshes for both 85mm and 140mm stroke grippers.
  • Helper functions and examples for python and C++.

A pull request to this packages requires further analysis since I performed many structural changes, which will create conflict for previous users.

Ros Distro

This package has been tested on Kinetic and Melodic.

Contents

Operation Instructions

Prior to executing control of the grippers make sure you have connected a 2-finger adaptive gripper model to a USB port of your computer. The RS-485 to USB converter ACC-ADT-USB-RS485 that comes by default when you order these grippers allow connecting the 2-finger gripper directly to a computer through a USB 2.0 port using Modbus RTU communication protocol.

Serial Port Configuration

To control the gripper over a serial port, you may need to give proper privileges to the user:

sudo adduser <YOUR_USERNAME> dialout

To find out the port on which the controller is connected, use:

dmesg | grep tty

The output should look something similar to:

[####.#####] USB 1-2: FTDI USB Serial Device converter now attached to ttyUSB0

Test communication and control

On a new terminal type the following line:

# Connect and move 85 mm gripper  
roslaunch robotiq_2f_gripper_control test_85mm_gripper.launch comport:="<YOUR GRIPPER TTY PORT NAME>"
# Simulate 85mm gripper 
roslaunch robotiq_2f_gripper_control test_85mm_gripper.launch sim:=true

This launch file starts a robotiq_action_server and an example action client which recursively commands the the real gripper *or simulated one) with diferent poses/speeds while updating the gripper joints on rviz.

gripper operation

Documentation

Control Robotiq gripper/s

The control of both 140mm and 85mm stroke robotiq grippers is done though an actionlib client-server interaction (see actionlib documentation).

robotiq_actionlib_structure


Node robotiq_2f_action_server

This node creates an instance of an action server that will handle the gripper connection, initialization, joint state publishing, and control by listening for incoming goals on the action name command_robotiq_action. It offers also the option to simulate a gripper response to incoming goals.

Arguments:

  • sim: Whether to use a simulated gripper or not
  • comport: Communication port to which the gripper is connected.
  • baud: Communication baud rate (must be the same baud rate as configured on the gripper)
  • stroke: Stroke of the gripper (maximum distance between fingers) currently only 0.085m or 0.140m values are supported.
  • joint_name: Name of the gripper driver joint as defined in your robot URDF description. This parameter is used to publish the state of the gripper joint on the /joint_states topic. Default is finger_joint.
  • rate: Frequency in Hz to send/request of data to the gripper and update of joint state.

Action type:

CommandRobotiqGripper.action (see action declaration for goal, feedback and result message fields)

or

FollowJointTrajectory.action (see action declaration for goal, feedback and result message fields): This is the default control scheme from MoveIt!, meaning that with the appropiate configuration you can plan and command the gripper through the MoveIt!-Rviz GUI, and through Pick and Place operations.

Note: The Action Server will only become active and ready after Robotiq gripper has been propertly initialized (see robotiq documentation).


Command gripper through an instance of a SimpleActionClient in Python

An example action client implementation is provided on the script robotiq_2f_action_client_example.py, showing how to initialize the client, create custom goals, and use predefined functions for fast control of the gripper, position, speed and force. But basically you just need to:

Import the Action messages and actionlib library

import actionlib
from robotiq_2f_gripper_msgs.msg import CommandRobotiqGripperFeedback, CommandRobotiqGripperResult, CommandRobotiqGripperAction, CommandRobotiqGripperGoal
from robotiq_2f_gripper_control.robotiq_2f_gripper_driver import Robotiq2FingerGripperDriver as Robotiq

Instantiate the action client

action_name = 'command_robotiq_action'    # Use your action server namespace if necesary
# Create an action client
robotiq_client = actionlib.SimpleActionClient(action_name, CommandRobotiqGripperAction)   
# Wait until grippers are ready to take command (communication is stablished and gripper is activated)
robotiq_client.wait_for_server()   

Command your robotiq gripper

# Use pre-defined functions for robot gripper manipulation.
Robotiq.close(robotiq_client, block=True)   # Close and wait until completion
Robotiq.open(robotiq_client, block=False)   # Open and do not block thread while completing goal
Robotiq.goto(robotiq_client, pos=0.04, speed=0.1, force=10, block=True)  # Send command Pose[m], speed[m/s], force [%]
Robotiq.emergency_release(robotiq_client)   # Slowly open gripper and deactivate it

Command gripper through an instance of a SimpleActionClient in C++

Import the Action messages and actionlib library

#include <actionlib/client/simple_action_client.h>
#include <robotiq_2f_gripper_msgs/CommandRobotiqGripperAction.h>
#include <robotiq_2f_gripper_control/robotiq_gripper_client.h>

typedef robotiq_2f_gripper_control::RobotiqActionClient RobotiqActionClient;

Instantiate a RobotiqActionClient class

std::string action_name = "/command_robotiq_action";  
bool wait_for_server = true;                  // Wait for Action Server connection (gripper is ready and activated)
RobotiqActionClient* gripper = new RobotiqActionClient(action_name, wait_for_server);

Command your robotiq gripper

gripper.close(speed, force, false);    // Close and do not wait
gripper.close();                       // Block thread until gripper is closed.
gripper.open();
gripper.goToPosition( position, speed, force, true);

Operation of Multiple Grippers

To control multiple grippers simultaneously you need to correctly namespace the grippers Action service and client nodes. A correct example is provided in the robotiq_dual_action_server.launch file.

robotiq_2finger_grippers's People

Contributors

danfoa avatar tholiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

robotiq_2finger_grippers's Issues

robotiq_2f_gripper_msgs.msg not found

Hi,

I am trying to use the robotiq_2f_action_client_example.py but the following line
from robotiq_2f_gripper_msgs.msg import CommandRobotiqGripperFeedback, CommandRobotiqGripperResult, CommandRobotiqGripperAction, CommandRobotiqGripperGoal
returns an error:

No module named my_folder.robotiq_2f_gripper_msgs.msg

Was there something changed here or what am I missing?

Best

Can I use this only in simulation?

I'm trying to use this package only in simulation, I don't have the real gripper. But I have an error that says:
from pymodbus.client.sync import ModbusSerialClient
ImportError: No module named pymodbus.client.sync
The question is, can I use this package without having the real gripper?

Support for Robotiq Hand-E

Would it be possible to add official support for the Robotiq Hand-E? From my testing, it looks like communications are the same as with the larger 85mm Robotiq gripper. But of course, the stroke is not the same, and the xacro and mesh will differ as well.

no header file CommandRobotiqGripperAction.h

I follow all your installation but when I build the package I receive fatal error fatal error: robotiq_2f_gripper_msgs/CommandRobotiqGripperAction.h: No such file or directory
I check all package and I find that no file like that in the package
So pls help me to update the file
I want to ask a question about create cartesian trajectory I have create a custom arm with 3 Dof and then I can simulate it on gazebo and Rviz I can use the random valid for arm and execute it on Rviz and Gazebo but when I try coding to send command to Moveit to plan a trajectory there are no valid sample and no plan found (I also check the end effector from tflistener to get ee pose ) so I am sure that the pose is valid I using Trac-Ik for arm

Self-collisions in gripper when used with MoveIt!

Hello! I'm having trouble when using this package, using MoveIt to control a real robot. The 2-finger gripper is connected to a UR5 arm. All seems to be fine, with the gripper attached properly in rviz and moving as expected when commanded.

The trouble is with MoveIt. I used the MoveIt setup assistant to create a collision matrix, set up groups, etc. Yet when I launch MoveIt in rviz, the gripper seems to be colliding with itself. I get the following errors when MoveIt tries to plan:

  • Found a contact between 'gripper_left_inner_knuckle' (type 'Robot link') and 'gripper_left_inner_finger' (type 'Robot link'), which constitutes a collision. Contact information is not stored.
  • Collision checking is considered complete (collision was found and 0 contacts are stored)
  • Start state appears to be in collision with respect to group manipulator

Can you suggest anything I might investigate to eliminate the collision condition I'm experiencing? Or a known reliable MoveIt! configuration? Thanks!

how to control with moveit

Hi. Thank you for such a great work. I have successfully managed to control my gripper through [CommandRobotiqGripper.action].
However, it would be great if I can control it through [FollowJointTrajectory.action] using moveit.
I am having a hard time trying to figure how to control it through moveit. (I tried moveit_setup_assistant)

Can you give me instructions on how to setup moveit?? @Danfoa

Symlink warning

While controlling gripper using C++, catkin warning appears:
Warning: Cannot symlink from /home/artemii/robotmove_ws/devel/.private/myworkcell_demo/lib/python2.7/dist-packages/robotiq_2f_gripper_control/__init__.py to existing file /home/artemii/robotmove_ws/devel/lib/python2.7/dist-packages/robotiq_2f_gripper_control/__init__.py Warning: Source hash: fc022dd798d6b7e274f2ad0844eaeb0b Warning: Dest hash: 0e8d2401a15010fceb3aab8bb23e71a5
Not sure, if it's related to the package. Thanks

Model simulation in Gazebo9

Hi! Would it be possible to show an example of how to spawn your models in Gazebo 9? Like a robotiq_2f_85_gripper_simulation package, for instance.

Action client initialization problem cpp

Hi, thanks for your wonderful driver.

I want to include action client to a moveit code, I want to call the server after excuting motion command.

I do not know how to instantiate the client using RobotiqActionClient gripper = new RobotiqActionClient(action_name, wait_for_server);

When I put this inside main(), or outside of any function, the error says:

conversion from ‘RobotiqActionClient* {aka robotiq_2f_gripper_control::RobotiqActionClient*}’ to non-scalar type ‘RobotiqActionClient {aka robotiq_2f_gripper_control::RobotiqActionClient}’ requested

Could you give any hint?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.