(!) 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 an RG2 / RG6 Gripper using the Modbus / TCP protocol (ROS Noetic)

Description: This tutorial explains how to use the "onrobot_rg_control" and "onrobot_rg_modbus_tcp" packages to control an RG2 / RG6 Gripper configured with the Modbus / TCP protocol.

Tutorial Level: BEGINNER

Prerequisites

This tutorial assumes that you have an RG2 / RG6 Gripper configured with the Modbus / TCP protocol. The Gripper should be connected to a network, which has been properly configured.

Finally, make sure that the external dependency for the package "onrobot_rg_modbus_tcp" has been installed. The dependency is the python package pymodbus.

$ rosdep install onrobot_rg_modbus_tcp

Network configuration

Make sure that the ethernet card in your PC to which your gripper is connected has the following static IP network configuration:

onrobot_network_setup.jpg

The static IP address of the PC (192.168.1.10) can be any IP address different from the hand's IP address (whose default is 192.168.1.1).

ROS Nodes to Control the RG Gripper

Run the RG Gripper Driver Node

The Gripper is driven by the node "OnRobotRGTcpNode.py" contained in the package "onrobot_rg_control". The IP address of the Gripper has to be provided as an argument.

For example, the driver for controlling an RG2 /RG6 Gripper with the IP address 192.168.1.1 is launched using the following command:

$ roslaunch onrobot_rg_control bringup.launch ip:=192.168.1.1

Run the RG Gripper Status Listener Node

In the package "onrobot_rg_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 "OnRobotRGInput". The status listener node can be run together with the driver node using the following same command:

$ roslaunch onrobot_rg_control bringup.launch ip:=192.168.1.1

status_listener.jpg

Run the RG Gripper Simple Controller Node

The driver listens for messages on "OnRobotRGOutput". 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 onrobot_rg_control OnRobotRGSimpleController.py

simple_controller.jpg

The simple controller node can therefore be modified to send custom commands to the Gripper.

Wiki: onrobot/Tutorials/Control of a RG gripper using the Modbus TCP protocol (Noetic) (last edited 2022-02-24 13:19:38 by TakuyaKiyokawa)