This repository contains the drivers and configurations needed to work with the LAR Collaborative Cell. It was built to work with:
- UR10e manipulator (Universal Robot 10 e-series)
- Ubuntu 20.04.3 LTS or other Linux distros using Docker
- ROS Noetic
- UR10e Controller Configuration
- Installation
- Controlling the UR10e through MoveIt
- Real-time UR10e following a tracked object
- Gripper Remote Control
- Real-time UR10e following & picking a tracked object
This configuration only needs to be done once when setting up the robot.
Click for details...
For working on a real robot you need to install the externalcontrol-1.0.5.urcap which can be found inside the resources folder of this repository.
Using a USB pen drive, follow:
- Format the flash drive
- Download and save the externalcontrol-1.0.5.urcap on the USB pen drive
- Insert the USB drive on UR10e controller (the controller has two USB ports)
- Turn on the Teach Pendant
- Click on Menu (top right corner) + System + URCaps + Select External Control and press "+"
- Configure the remote host's IP to
192.168.56.1
-
Click on Menu (top right corner) + System + Network
-
Configure:
- Network method : Static Address
- IP address:
192.168.56.2
- Subnet mask:
255.255.255.0
- Default gateway:
192.168.56.2
-
Click on Apply
- Disable EtherNet/IP fieldbus:
Installation > Fieldbus > EtherNet/IP > Disable
Click for details...
First, it is required to have MoveIt and other packages installed in your system:sudo apt install ros-noetic-moveit ros-noetic-industrial-robot-status-interface ros-noetic-scaled-controllers ros-noetic-pass-through-controllers ros-noetic-ur-client-library ros-noetic-ur-msgs ros-noetic-velocity-controllers ros-noetic-force-torque-sensor-controller socat
(Note: At this moment, if you do not have a catkin workspace, you should now create one, by following the steps described here)
After all these installations, on your catkin workspace you need to clone this repository:
cd catkin_ws/src
git clone https://github.com/lardemua/larcc_drivers.git
So that packages are able to import from each other, run the following:
echo "export PYTHONPATH=\$PYTHONPATH:~/catkin_ws/src/larcc_drivers" >> ~/.bashrc
source ~/.bashrc
troubleshooting: in case protobuf version >=3.20:
pip install protobuf==3.19.*
Now compile your catkin workspace:
cd ~/catkin_ws
catkin_make
Finally, to establish the communication between the robot and the computer, it is required to connect an Ethernet cable from the UR10e controller to the computer. After you connect the cable, you need to configure the IPv4 like this:
-
For the astra_camera package, install the following dependencies:
sudo apt-get install -y libgflags-dev ros-noetic-image-geometry ros-noetic-camera-info-manager \ ros-noetic-image-transport ros-noetic-image-publisher libgoogle-glog-dev libusb-1.0-0-dev libeigen3-dev
and install libuvc:
git clone https://github.com/libuvc/libuvc.git cd libuvc mkdir build && cd build cmake .. && make -j4 sudo make install sudo ldconfig
Then clone the ros_astra_camera repository:
cd ~/catkin_ws/src git clone https://github.com/orbbec/ros_astra_camera.git
Compile your catkin workspace:
cd ~/catkin_ws catkin_make
Install udev rules:
roscd astra_camera sudo cp 56-orbbec-usb.rules /etc/udev/rules.d sudo service udev reload sudo service udev restart sudo udevadm control --reload && sudo udevadm trigger
-
For the usb_cam package, install the following dependencies:
sudo apt install libv4l-dev v4l-utils
Then clone the usb_cam repository:
cd ~/catkin_ws/src git clone https://github.com/lardemua/usb_cam.git
Finally, compile your catkin workspace.
cd ~/catkin_ws catkin_make
After installing Docker and Distrobox, build one of the docker images with ROS Noetic available at lar_docker. The Dockerfile available in this repository uses the one with Cuda 11.8 by default.
Next build the larcc image from the Dockerfile in this repository:
docker build -t lardemua/larcc-distrobox .
Create and enter the created distrobox:
SHELL=/bin/bash distrobox create --image lardemua/larcc-distrobox --name larcc-distrobox --additional-flags "--gpus all" --home $HOME/larcc-distrobox
distrobox enter larcc-distrobox
Set up ROS for your user inside the distrobox:
/user-setup.sh
Clone the usb_cam repository and the ros_astra_camera repository:
cd ~/catkin_ws/src
git clone https://github.com/lardemua/usb_cam.git
git clone https://github.com/orbbec/ros_astra_camera.git
Compile your catkin workspace.
cd ~/catkin_ws
catkin_make
Install udev rules by running the following outside the container:
cd $HOME/larcc-distrobox/catkin_ws/src/ros_astra_camera
sudo cp 56-orbbec-usb.rules /etc/udev/rules.d
sudo service udev reload
sudo service udev restart
sudo udevadm control --reload && sudo udevadm trigger
Follow the next 4 steps to remotely control the real UR10e robot:
-
Connect the robot to your computer using the Ethernet cable.
-
Launch the robot drivers with:
roslaunch larcc_bringup ur10e_bringup.launch
-
Run the external control program on the teach pendant:
Click on Program + URCaps + External Control + Press "play"
At this point, you should get the message "Robot connected to reverse interface. Ready to receive control commands." printed out on your terminal window, just like this:
-
Then you have 3 options to control the robot:
-
control the robot using a Python script for joint positions:
roslaunch larcc_examples arm_gripper_movement_joints.launch
-
control the robot using a Python script for 3D positions with quaternions:
roslaunch larcc_examples arm_gripper_movement_quaternions.launch
-
control the robot using the MoveIt Rviz interface:
roslaunch ur10e_moveit_config moveit_rviz.launch config:=true
With this interface, you can control the real robot by simply moving the manipulator marker on RViz, and then asking the robot to move to that goal (using the Motion Planning Panel). MoveIt will plan the trajetory.
-
By using ViSP RGB-D object tracking (see this repository) and MoveIt to remotely control the UR10e, it was developed this demonstration of a real-time followed object that is being tracked with one RGB-D camera (Intel RealSense D435):
In order to control the ROBOTIQ 2F-140 gripper from an external computer, it is required to:
- Turn on the robot (UR10e)
- Connect the TCP/IP communication between the robot and the computer
- Remove/Uninstall any ROBOTIQ URCap: remove 'Robotiq_Grippers' on UR10e Teach Pendant (Click on Menu (top right corner) + System + URCaps)
- Install the rs485-1.0.urcap. See the first 5 points of on-ur10e-controller.
Finally, for testing:
-
cd larcc_interface/gripper/src
-
python3 test_robotiq.py
The Python module for controlling Robotiq 2F-140 from an external PC can be found here.
On test_robotiq.py, you may have to change HOST ip address to UR10e.
Notes:
- UR10e can either be on Remote Control or in Local Control mode (does not make any difference).
- It is not required to launch any robot driver. The TCP/IP connection is enough, since the RS485 communication will be directly established between the gripper and the external PC
- It is necessary rs485 URcap. That is daemon for communicate between UR10e's rs485 network and external pc via tcp (port 54321). RobotiqHand module use this mechanism. So you must activate rs485 URCap on UR10e. And, If you activate Robotiq_Gripper URCap on UR10e, that URCap always use inner rs485 network without exclusive. This means external rs485 communication make conflict communication contents. So if you want to control 2f-140 via rs485 from external pc, you must deactivate Robotiq_Gripper URCap on UR10e