Skip to content

MerlinLaboratory/schunk_ros_interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 drivers for EGK Schunk Grippers

This repository serves as a ROS2 and ROS1 (see ros_1 branch) wrapper for controlling EGK Schunk grippers with Ethernet/IP connection. The repo leverages the EIPScanner repository to establish the necessary Ethernet/IP connection with the gripper.

Hardware Dependencies

OS: Linux Ubuntu
Gripper: EGK-40-EI-M-B

Tested on Ubuntu 20.04 with ROS2 Foxy and Ubuntu 22.04 with ROS2 Humble.
For the ROS1 implementation see ros_1 branch.
While the code has been exclusivelly tested with the EGK40 model, support for all other EGK models is not excluded.

Features

  • Gripper State Logging: Access real-time information about the gripper's state through a dedicated ROS topic.
  • Control Services: Utilize ROS services to command various gripper actions, such as:
    • jog_to: Move the gripper to a specified position.
    • release: Release any grasped object.
    • simple_grip: Perform a simple gripping action.

Additional information about each service can be found within the schunk_interface package.

Repository Structure

The principal packages are briefly described in the following table:

Package Description
Doc (Contains the necessary documentation to understand how to use the gripper and the .EDS file for Ethernet/IP Assembly communication. All the files can be found on the Schunk website.).
schunk_hardware_interface Contains the actual code responsible for establishing the connection with the gripper and providing the necessary services and topics.
schunk_interfaces Contains information about the messages and services used by this repository.

Hardware Connection

Taking as reference the gifs in the next paragraphs, the gripper exposes two cables:

  • the green one for communication with external devices
  • the black one that powers the system

To connect the green cable with the ethernet port of your computer you will need to buy an adapter. The black cables that powers the system is composed of 4 cables. Two provide power to the gripper and two provide power to the control system. These two need to be supplied with a tension of 24V and can be connected as the left for testing purposes. On the right instead how they are connected to the robot. Notice that the brown and black connectors are the source (+24V) while the white and the blue are the ground (0V).

Testing Robot connection
Testing connection Robot connection

Usage

Prerequisites and Dependencies

ROS2 Humble needs to be installed and configured in your computer.

The only other dependency that the repo requires is EIPScanner. Just clone it and build it (it is not necessary to put this repo in your ROS workspace):

git clone https://github.com/nimbuscontrols/EIPScanner.git
mkdir build && cd build
cmake ..
cmake --build . --target install

Finally, in the same terminal where you are going to launch the gripper node, run:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

otherwise place it inside your .bashrc file to avoid doing this step everytime you open a new terminal where you launch the schunk_node.

Installation

  1. Clone the repository into your ROS2 workspace and build it:
    git clone https://github.com/MerlinLaboratory/schunk_ros_interface.git
    colcon build
    

Usage + examples

  1. Launch the Node: Set the gripper ip in config file and launch the node to start communication with the gripper.

    ros2 launch schunk_hardware_interface gripper.launch
    

    See here in case of problems or errors.

  2. Access Gripper State: Subscribe to the gripper state topic to receive updates on the gripper's status.

    ros2 topic echo TODO
    
  3. Control the Gripper: Call the provided services to command the gripper's actions. For example:

    ros2 service call /schunk/egk_40/jog_to schunk_interfaces/jog_to "position: 0.0 velocity: 6.0 motion_type: 0"
    
    ros2 service call /schunk/egk_40/simple_grip schunk_interfaces/simple_grip "gripping_force: 50 gripping_direction: 0"
    
    ros2 service call /schunk/egk_40/release schunk_interfaces/release "{}"
    

Troubleshooting

No Data received from gripper/ gripper does not respond to commands

In case the gripper does not communicates with your system, try to allow UDP connection through port 2222 with the following command (pay attenction that this needs to be done everytime the computer is restarted):

sudo iptables -A OUTPUT -p udp -m udp --sport 2222 -j ACCEPT
sudo iptables -I INPUT -p udp --dport 2222 -j ACCEPT

Node crashes at launch with communication error

If the node of the gripper crashes at launch, be sure that your computer running ROS has exclusive ownership of the device. For example, in our setup, we have all the devices connected to a switch, creating a subnetwork under 192.168.125.X, as the following figure shows:

As soon the gripper is connected to the subnetwork, the robot might take exclusive ownership of the gripper, making the code crash. Unluckily, I cannot provide a unique solution since it is robot-dependent. However, you need to make the robot 'forget' the gripper. In my case, we have a GoFa from ABB with the Schunk App installed on the Teach Pendant; we just had to click 'Delete Gripper' once I opened the App.

Future Development

No further developments are expected.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published