How control the gripper (tool/end-effector) through ROS2?

I have a UR3e, coupled with a VGC10 vacuum gripper at its end-effector.
I managed to control the UR3e to move etc.
However, I am failing to control the gripper via ROS.
I found the ROS drivers for the gripper here, but they are only for the gripper as standalone (with a compute box) and not coupled with a UR. I migrated them to ROS2 but they don’t work.
I also tried to use the “set_io” service by calling:
ros2 service call /io_and_status_controller/set_io ur_msgs/srv/SetIO “{fun: 4, pin: 0, state: 12.0}”
but this also didn’t work.

I saw that ROS1 UR drivers had some compatibility for controlling the tool through the use_tool_communication parameter and I am wondering whether this would be the way to control the end-effector.

Since it is a gripper, it only needs to receive on/off data from the end-effector flange of the UR so I would assume that there would be a way to do this through the UR ROS2 drivers, but did not find the way yet.

Alternatively I would have to write a UR script, similar to how is described here?

Any information is much appreciated. Thank you

You might take a look here.

I haven’t tried it yet.

I’ve found the doc folder in ur_robot_driver to be pretty useful, not sure if everything there is up to date, but I’ve found much of it helpful.

Thank you for your answer @dan2. Apparently ur_robot_driver is not updated yet for foxy, and it may not, since I remember there was a reason about it that forced to still use the ur_bringup instead.

I will be at the lab to do experiments on the real robot in 3 weeks, so I can’t give feedback now. But still, I’m not sure whether this would be sufficient to activate the vacuum gripper.

Since it is a vacuum gripper, it would only need an on/off message for the current. I see that ‘use_tool_communication’ offers the tool_voltage parameter but I’m not sure if that would be enough to activate the gripper.

Then I see this answer by @mauch but I was hoping that I wouldn’t have to go through the process of creating separate driver, since I only want to give current to the ur flange.

I found these 2 posts relevant: 1 and 2 but sending urscripts through python, is not yet supported in ROS2.

So any help on this would be really appreciated

Hey, I am having trouble controlling a custom gripper as well. My trouble is that I am trying to write a custom Client node and Service node, but I don’t know what to add as a response in the service node. I would like to ask if someone can tell me where “/io_and_status_controller/set_io” is located. I can’t seem to find it anywhere and I think that that will solve my issues since when I give it the following command ros2 service call /io_and_status_controller/set_io ur_msgs/srv/SetIO “fun: 1, pin: 0, state: 1.0" , it works. Or if somebody can give ma a better idea on how to solve my problem I would be very thankful.

@marko1

If I understand correctly, this will tell you which controller that is and you basically find the controller here.