Used in the 5th semester Robotics LLM-Planner-for-Bimanual-object-mnipulation project. Package stack provides functionalities for controlling a Robotiq 3 Finger Adaptive Gripper using ROS2.
pip install pymodbus
Install colcon, then build this repository:
mkdir -p ~/ros_ws/src && cd ~/ros_ws/src
git clone https://github.com/andreasHovaldt/robotiq_3f_gripper_ros2_stack.git
cd ~/ros_ws
colcon build --symlink-install
source ~/ros_ws/install/setup.bash
For controlling the gripper, the custom interfaces used are based on the msg types Robotiq3FGripperInputRegisters.msg
and Robotiq3FGripperOutputRegisters.msg
, found in the folder /robotiq_3f_gripper_ros2_interfaces/msg
. More can be read about the Modbus registers and their contents in Robotiq's own documentation.
It is worth noting that this current implementation only uses the simplified control mode, which can also be read about in Robotiq's documentation.
The gripper is able to be controlled in 3 different ways:
ros2 run robotiq_3f_gripper_ros2_control gripper_control_listener_node
Using gripper_control_listener_node
the gripper is subscribed to the topic /Robotiq3FGripper/OutputRegisters
Additionally this node also publishes the input registers (status of gripper) to the topic /Robotiq3FGripper/InputRegisters
ros2 topic pub --once /Robotiq3FGripper/OutputRegisters robotiq_3f_gripper_ros2_interfaces/msg/Robotiq3FGripperOutputRegisters "{r_act: 1, r_mod: 1, r_gto: 1, r_atr: 0, r_pra: 80, r_spa: 255, r_fra: 0}"
ros2 run robotiq_3f_gripper_ros2_control gripper_control_service_server
This starts a service server for the gripper. Check the custom interface Robotiq3FGripperOutputService.srv
for more information on how to interact with the service server.
ros2 service call /Robotiq3FGripper/OutputRegistersService robotiq_3f_gripper_ros2_interfaces/srv/Robotiq3FGripperOutputService "{output_registers: {r_act: 1, r_mod: 1, r_gto: 1, r_atr: 0, r_pra: 255, r_spa: 255, r_fra: 0}}"
ros2 run robotiq_3f_gripper_ros2_control gripper_control_action_server
This starts an action server for the gripper. Check the custom interface Robotiq3FGripperOutputGoal.action
for more information on how to interact with the action server.
Currently, the action server has a bug, where, if you leave it without sending a goal for a while, the gripper has to run through its activation initialization again.
ros2 action send_goal -f /gripper_position robotiq_3f_gripper_ros2_interfaces/action/Robotiq3FGripperOutputGoal "{output_registers_goal: {r_act: 1, r_mod: 1, r_gto: 1, r_atr: 0, r_pra: 0, r_spa: 255, r_fra: 0}}"