Docker is an open-source project that automates the deployment of Linux applications inside software containers. Docker is an open-source project that automates the deployment of Linux applications inside software containers.
Docker can help you easily evaluate someone else’s code changes without changing your local setup, as well as test on versions of Linux other than your locally installed one. MoveIt has an official MoveIt Docker build that lets you quickly run MoveIt in a local container.
Before starting this tutorial, please complete the installation as described in Docker’s installation instructions. Installation instructions are available for multiple operating systems.
Note that for recent Linux distros, the installation is basically just a single wget command. You may also want to add your user to the docker group to avoid having to use sudo permissions when you use the docker command.
If you are running a recent version of Ubuntu (e.g. 16.04, 18.04) it can be as simple as:
sudo apt install curl
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker $(whoami)
And you will likely need to log out and back into your user account for the changes to take effect.
To use Rviz (and other GUIs), you probably want to set up hardware acceleration for Docker as described here.
The next step is to download the gui-docker script that handles everything to get your docker up and running with graphical user interfaces such as RViz and Gazebo. To download the script run the following command:
curl -o gui-docker \
https://raw.githubusercontent.com/ros-planning/moveit/master/.docker/gui-docker && \
chmod +x gui-docker
Then, the wrapper script gui-docker can be used to correctly setup the docker environment for graphics support. For example, you can run the MoveIt docker container using the following command to pull the current noetic source build. If you want to pull the docker image for other distributions, see official MoveIt Docker Hub Repository for available docker images.
./gui-docker -it --rm moveit/moveit:noetic-source /bin/bash
You can test that the GUI works by running rviz:
roscore > /dev/null & rosrun rviz rviz
As the previous command dropped the --rm option, the container will be persistent, so changes you make inside the container will remain.
Running gui-docker in multiple terminals will connect them all to the same container. For convenience, the script defines sensible defaults. For example running the following command will try to pull the docker image containing the current master branch's source build namely, moveit/moveit:master-source, and if there already exists a container with this image, will directly connect to that container.
Start planning in Rviz with:
There are many variants of the MoveIt Docker available as documented here. For example, any of the two current distros work: [melodic, noetic]. Other variations include:
contains a full MoveIt workspace downloaded and built to ~/ws_moveit/src. This container is useful for developers wanting to test or develop in a sandbox.
builds on top of the CI image, the full debian-based install of MoveIt using apt.
an image optimized for running continuous integration with Travis
an image optimized for running continuous integration with Travis using the latest unreleased build of ROS
In the moveit/moveit:master-source container, "install/setup.bash" needs to be sourced instead of "devel/setup.bash".
Your container may have an issue. Try
1. Deleting it by:
docker stop default_container && docker rm default_container
2. And running: