Add-on devices such as robot grippers often require software extensions, called URCaps, to be installed on the robot controller. URCaps typically provide custom instructions which are not part of standard URScript. Plugins of the extension type are used so that custom instructions can be called by ur_ros_rtde.
In this package are provided implementation examples of commands that can be used to interact with an OnRobot soft gripper. To control the gripper it is mandatory to:
-
Install and configure the OnRobot SG
-
Install the OnRobot URCap using the robot teach pendant.
-
Clone
ur_rtdeand apply one of the patches provided inur_ros_rtde/config. Then install the package.
Two patches are available, each identified by a commit hash. They are functionally equivalent but differ slightly to match different versions of theur_rtderepository.
Patches for newer versions can be easily derived from the existing ones.# optional: remove ur_rtde binaries if installed with apt sudo apt remove --purge librtde librtde-dev # clone ur_rtde cd <desired_path> git clone https://gitlab.com/sdurobotics/ur_rtde.git cd ur_rtde git submodule update --init --recursive # apply the patch git apply <path>.patch # install ur_rtde mkdir build cd build cmake .. make sudo make install
-
Compile
ur_ros_rtde_gripper_commandspackage.cd <ros_workspace_path> colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to ur_ros_rtde_gripper_commands
-
Remove the plugins implemented in this package from the blacklist in the example launch file.
If everything was set up as indicated above, the CommandServer will be able to discover and load the plugins related to OnRobot commands.
Each command, as done for the other plugins, will be exposed as an action server.
The command server can be launched and commands can be requested to the robot as shown in the tutorials.
Example: control the SG gripper by setting its width using sg_grip:
# Run in a new terminal
ros2 action send_goal /ur_ros_rtde/sg_grip_command ur_ros_rtde_gripper_commands/action/SgGrip "{target_width: 30}"