Docker Containerization
We distribute MoveIt Pro using docker to ensure MoveIt Pro dependencies do not interfere with other ROS 2 projects on your computer.
Dockerfile and Docker Compose
We provide a default Dockerfile for use in your custom MoveIt Pro workspaces here. The default docker-compose.yaml file can be found on your host computer at /opt/moveit_pro
. The environment variables used by the docker-compose file are set in ~/.config/moveit_pro/moveit_pro_config.yaml
.
Also see Run MoveIt Pro for other ways to run MoveIt Pro.
User workspace mounting
You need to mount a user workspace into the MoveIt Pro Docker containers, which allows you to:
- Add your own custom packages into MoveIt Pro, including custom robot configuration or Behavior packages.
- Ensure that Behavior packages generated when you Create a New Behavior Package in the web app are available on your host file system.
To mount a user workspace, run moveit_pro configure
and follow the prompts.
Note that the user workspace folder must:
- Be a valid Colcon workspace.
This means that the folder must contain a
src
subdirectory, which in turn contains Colcon packages. - Contain a
colcon-defaults.yaml
at the workspace root to enable colcon build and test arguments. See our example here. - Contain a
Dockerfile
at the workspace root to enable creating a docker overlay image. See our example here.
A user workspace folder can contain a docker-compose.yaml
at the workspace root to define new environment variables and functionality to the services required by MoveIt Pro command line verbs. See our example here.
For example, you can mount a folder located at ~/project1_ws
into MoveIt Pro and use its packages if it has the following structure.
~/moveit_studio_ws
+ --- colcon-defaults.yaml
+ --- docker-compose.yaml
+ --- Dockerfile
+ --- src/
+ --- my_package_1/
+ --- my_package_2/
Your workspace will be bind mounted into the ${HOME}/user_ws
folder of the MoveIt Pro containers.
Docker Container Interactions
There are three main ways to interact with the MoveIt Pro Docker containers:
- moveit_pro dev – This starts a standalone container with the same runtime environment, but no robot configuration is launched. Use for it development such as writing, building, and testing packages and code along with your preferred IDE.
- moveit_pro shell – Use for runtime interactions, such the ROS 2 Command Line Interface. MoveIt Pro must be running (
moveit_pro run
ormoveit_pro dev
). - Direct Dockerfile modifications - use for permanently installing dependencies (packages installed in
moveit_pro shell
ormoveit_pro dev
will not persist when you close the container). docker compose
- Using basic Docker tools likedocker compose
, the MoveIt Pro runtime images can be built and executed by those who do not wish to use themoveit_pro
launcher.
Systems with discrete GPUs that support CUDA require additional Dockerfile steps to support hardware acceleration. The Dockerfile stages with -gpu
in their name are only used on systems with discrete NVIDIA graphics.
If you have apt packages you want to install in your Docker image, you can add them to your Dockerfile so they are always available.
Details
Click for example
The following Dockerfile step will install tmux and vim in the container.RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=bind,target=${USER_WS}/,source=. \
. /opt/overlay_ws/install/setup.sh && \
apt-get update && \
rosdep install -q -y \
--from-paths src \
--ignore-src && \
apt-get install -y --no-install-recommends \
tmux vim
Don't forget to moveit_pro build user_image
after modifying the Dockerfile!
User Workspaces for Production
In production systems, it is often desirable to have a customized Docker build and bring-up procedure specific to that hardware. The MoveIt Pro Runtime is distributed through Docker images. When the robot starts, Docker services will launch the MoveIt Pro runtime, drivers, developer platform user interface, and/or additional Docker containers using your user image. A user image is built using the base MoveIt Pro image, your ROS 2 workspace, and MoveIt Pro configuration packages according to the steps in your Dockerfile.
The following diagram illustrates how a production system would share and build packages in the MoveIt Pro runtime:
The ROS 2 workspace can be built into the image as part of the Docker build context, mounted at runtime, or some combination of both. See our Docker Containerization page for more detail.