|Note: The procedure is similar for controlling a Robotiq 2-Finger Gripper using the "robotiq_2f_gripper_control" package.|
|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Control of a 3-Finger Gripper using the Modbus TCP protocol (ros kinetic and newer releases)Description: This tutorial explains how to use the "robotiq_3f_gripper_control" and "robotiq_modbus_tcp" packages to control an 3-Finger Gripper configured with the Modbus TCP protocol. Please visit this website for more information on the Robotiq Adaptive Robot Grippers.
Tutorial Level: BEGINNER
This tutorial assumes that you have a 3-Finger Gripper configured with the Modbus TCP protocol. The Gripper should be connected to a network, which has been properly configured (you can validate the communication with the Gripper using the Robotiq User Interface).
Finally, make sure that the external dependency for the package "robotiq_modbus_tcp" has been installed. The dependency is the python package pyModbus. From Ubuntu Precise, it is simply installed using "rosdep install robotiq_modbus_tcp". On other systems, it can be installed using "easy_install -U pymodbus".
Make sure that the ethernet card in your PC to which your gripper is connected has the following static IP network configuration:
The static IP address of the PC (192.168.1.2) can be any IP address different from the hand's IP address (whose default is 192.168.1.11).
ROS Nodes to Control the Gripper
Run the 3-Finger Gripper Driver Node
The Gripper is driven by the node "Robotiq3FGripperTcpNode.py" contained in the package "robotiq_3f_gripper_control". The IP address of the Gripper has to be provided as an argument.
For example, the driver for controlling a 3-Finger Gripper with the IP address 192.168.1.11 is launched using the following command: "rosrun robotiq_3f_gripper_control Robotiq3FGripperTcpNode.py 192.168.1.11".
Run the 3-Finger Gripper Simple Controller Node
The driver listens for messages on "Robotiq3FGripperRobotOutput" using the "Robotiq3FGripper_robot_output" msg type. The messages are interpreted and commands are sent to the gripper accordingly. A simple controller node is provided which can be run (at another terminal) using "rosrun robotiq_3f_gripper_control Robotiq3FGripperSimpleController.py".
The "Robotiq3FGripper_robot_output" msg type is simply composed of the robot output variables described in the Robotiq 3-Finger Gripper Instruction Manual. The simple controller node can therefore be modified to send custom commands to the Gripper.
Run the 3-Finger Gripper Status Listener Node
In the package "robotiq_3f_gripper_control", there is also a node for listening to and interpreting the status of the Gripper. The driver publishes the status of the Gripper on "Robotiq3FGripperRobotInput" using the "Robotiq3FGripper_robot_input" msg type. The msg type is composed of the robot input variables described in the Robotiq 3-Finger Gripper Instruction Manual. The status listener node can be run (at another terminal) using the following command: "rosrun robotiq_3f_gripper_control Robotiq3FGripperStatusListener.py".