A simple way to start working with ROS noetic and UR robots using Docker.
Use the docker command line interface to get the latest built docker image:
docker pull ghcr.io/abc-irobotics/ros_base:main
After pulling the docker image run it in interactive mode by:
docker run -it IMAGE_NAME
With this you should already be able to use the simulated UR robots with ROS.
The default working directory is /usr/catkin_ws
. To use your custom ROS packages inside the container, mount a folder containing the source code of your ROS packages on your host machine to the source folder of this working directory like so:
docker run -it -v PATH/TO/FOLDER/WITH/ROS_PACKAGES:/usr/catkin_ws/src IMAGE_NAME
After running the container like this, you should see the contents of the PATH/TO/FOLDER/WITH/ROS_PACKAGES
inside the container.
Usecatkin build
to build your ROS packages from source. After running source devel/setup.bash
you should be able to use your own ROS packages inside the container.
For using the real UR robots with this container, first follow the instructions from the Universal Robot ROS Driver repository on how to set up your robot. In order to communicate with the real robot the ports 50001-50003 should be bound to the host's respective ports. To do this run the container like so:
docker run -it -p 50001-50003:50001-50003 IMAGE_NAME
After this start the driver, setting the robot ip to the IP of your robot and reverse IP to the IP of your HOST machine:
roslaunch ur_robot_driver <robot_type>_bringup.launch robot_ip:=192.168.56.101 reverse_ip:=192.168.56.123
Setting the reverse IP is needed because the driver runs from the docker container and without explicitly specifying this, the robot will not be able to communicate with the driver!
If the driver is running, start the robot program on your robot that contains the ExternalControl URCap. The robot should connect to the driver and in the driver's terminal a message should appear telling that the robot is ready to recieve control commands. (To actually move the robot don't forget to set it to remote control mode!)
Inside the container there is a working ros-noetic install, and a pre-built catkin workspace (in /usr/underlay_ws). The ROS packages required for moving simulated or real (UR) robots are already installed inside the docker container.
Since on Windows you can't use GUIs from docker, a web interface is provided instead of the RViz GUI. For this purpose, the rvizweb package is used. It is already pre-installed in the container. For the web interface the 8001 and 9090 ports have to be bound to the host, so run the container like so:
docker run -it -p 8001:8001 -P 9090:9090 IMAGE_NAME
To use rvizweb simply run:
roslaunch rvizweb rvizweb.launch
inside the container. Then in the host navigate to localhost/rvizweb/www/index.html
in the browser.
If you run
roslaunch ur16e_moveit_config demo.launch use_rviz=false
and add the Robot model panel in the RVizWeb browser window, you should already be able to see the simulated robot.