- This file provides instructions for setting up the Robot Operating System 2 (ROS2) Universal Robots' (UR) driver in conjunction with a UR simulator using containers running on a Windows host machine.
- Install Docker Desktop
- Install Chocolatey then install VcXsrv
- Google Chrome (for NoVNC client purposes)
NOTE: The resolution for all image resources in this file can be enhanced by clicking on them.
-
Create a docker network by opening a console and using the following command:
docker network create --subnet=192.168.56.0/24 ursim_net
-
Create container1 using the official UR simulator image by opening a console and using the following command:
docker run -it -e ROBOT_MODEL=UR3e --net ursim_net --ip 192.168.56.101 -p 30002:30002 -p 30004:30004 -p 6080:6080 --name ur3e_container universalrobots/ursim_e-series
-
Open Google Chrome, visit http://localhost:6080/vnc_auto.html then perform the following actions to turn the cobot on.
-
Create a Windows X server using VcXsrv's XLaunch with the following actions:
-
Identify your virtual ethernet adapter by opening a console on your Windows host machine and using the following command:
ipconfig
- It'll typically look something like this.
-
Create container2 using the community contributed ROS2 Humble Desktop image by opening a console and using the following command:
docker run -it --name ros2_container --net ursim_net osrf/ros:humble-desktop
-
Inside container2, execute the following commands to install the ROS2 UR driver and set necessary environment variables.
apt-get update apt-get install sudo sudo apt-get install ros-humble-ur-robot-driver export DISPLAY=<YOUR_IP_ADDRESS_GOES_HERE>:2.0 ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur3e robot_ip:=192.168.56.101 launch_rviz:=true
- Use the IP address from step5 in the export command.
-
If everything was done successfully you should be able to observe the demo on your machine.
- A simple
movej
command was executed in PolyScope and the related data was sent to container2.
- A simple
- We used Docker to create a network with two containers; one running the UR simulator and the other running Ubuntu with ROS2 installed.
- The Ubuntu container instantiates the ROS2 UR driver then makes a connection with the UR simulator.
- The UR simulator sends messages containing cobot data to the Ubuntu container.
- The driver running on the container receives the messages then converts them into a format that can be used internally by ROS2.
- The converted messages are used to model the cobot inside ROS2's RViz.
- According to collaborators in the UR driver repo the UR driver does not support Windows. This setup is intended to be used as an alternative work around for Windows users.
- Docker containers are not designed for dealing with heavy graphical payloads; for this reason, rViz will likely have a noticeable delay running in the container. The more important aspect is that we can observe that the two systems are communicating properly.
Hi Shawn!
Thanks for this write-up. It helped me tremendously. However, I encountered another problem after this.
After this, even when the robot model shows up in the rviz, I cannot play the remote control program on the VNC panel.
If it's on a real robot, I know how to set up the network to make this disappear, but on URSim, I am kinda clueless.