Skip to main content
Version: 7

Use MoveIt Pro without the CLI

If the moveit_pro CLI verb is inaccessible for your use case, such as in a CI/CD Pipeline, docker compose can be used to run all the services associated with the MoveIt Pro Runtime, including the UI. You will need your workspace docker-compose.yaml to extend the services found in the docker-compose.yaml installed by MoveIt Pro (default location:/opt/moveit_pro).

Click here to see the contents of docker-compose.yaml
# Launch MoveIt Pro
# Notes on usage:
# Several environment variables can be set on the host to configure the containers.
# The variables are documented in the `environment:` section of the `base` service.
# The recommended method for overriding these variables is by setting them using moveit_pro configure.

services:
# Sets common properties for other services. Should not be instantiated directly.
base:
# We assume the user has a user workspace and that user workspace contains a Dockerfile with a target layer called "user-overlay"
# As per these docs:
# https://docs.picknik.ai/en/stable/getting_started/configuration_tutorials/docker_configuration/create_overlay_docker_image.html#creating-a-release-overlay-container
# MOVEIT_STUDIO_BASE_IMAGE: The image and tag to where the user overlay will start FROM
# STUDIO_DOCKER_TAG: Version to pull from Docker Hub, e.g. "v1.10". Defaults to "main".
# The following args ensure log files aren't owned by root
# STUDIO_USERNAME: the username on the host
# STUDIO_USER_UID: the user uid on the host
# STDUIO_USER_GID: the user gid on the host
image: moveit-studio-base:${STUDIO_DOCKER_TAG:-main}
build:
context: ${STUDIO_HOST_USER_WORKSPACE}
pull: true
args:
USERNAME: ${STUDIO_USERNAME}
USER_UID: ${STUDIO_USER_UID}
USER_GID: ${STUDIO_USER_GID}
MOVEIT_STUDIO_BASE_IMAGE: picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main}
network_mode: host
# Run an init process within the container to allow using default signal handling to cleanly shut down the container.
# See this doc for more info: https://docs.docker.com/compose/compose-file/compose-file-v3/#init
init: true
environment:
# The default for MoveIt Pro will use mock hardware, if available, to simulate the robot.
- MOCK_HARDWARE=${MOCK_HARDWARE:-true}
# TODO: Should we delete or tick/tock ROS_DOMAIN_ID here?
# The ROS domain ID to use in deployment. See https://docs.ros.org/en/humble/Concepts/About-Domain-ID.html
- ROS_DOMAIN_ID
# Provides a license key for the MoveIt Pro application to validate in the container.
- STUDIO_LICENSE_KEY
# Robot configuration package for deployment. Defaults to a mock hardware UR5e.
- STUDIO_CONFIG_PACKAGE=${STUDIO_CONFIG_PACKAGE:-picknik_ur_mock_hw_config}
# The directory on the host machine where MoveIt Pro configurations should be saved, such as new objectives.
# Typically, this is "$HOME/.config/moveit_pro", which is the default.
# Individual robot configuration packages will be stored in this folder.
- STUDIO_HOST_CONFIG_DIR=${STUDIO_HOST_CONFIG_DIR:-$HOME/.config/moveit_pro}
# The directory on the host machine where persistent MoveIt Pro data is stored, e.g. the frontend authentication data.
# Typically, this is "$HOME/.local/share/moveit_pro", which is the default.
- STUDIO_HOST_DATA_DIR=${STUDIO_HOST_DATA_DIR:-$HOME/.local/share/moveit_pro}
# The path to the colcon workspace on the host machine containing user-defined packages,
# containing, e.g., configuration packages and custom behaviors
# Defaults to a folder named "moveit_studio_ws" in the current directory.
# If this folder is blank, it will be ignored at container startup.
- STUDIO_HOST_USER_WORKSPACE=${STUDIO_HOST_USER_WORKSPACE:-./moveit_studio_ws}
# The location of the user workspace inside the Docker container
- USER_WS=/home/${STUDIO_USERNAME:-studio-user}/user_ws/
# Network interface to use in the generated DDS configuration (in the container). Defaults to "lo".
- CYCLONEDDS_NETWORK_INTERFACE=${CYCLONEDDS_NETWORK_INTERFACE:-lo}
# Comma-separated list of the IP addresses of machines that will participate in the ROS network,
# including the host machine's own IP address. For example: CYCLONEDDS_PEER_ADDRESSES=192.168.0.35,192.168.0.37)
# Defaults to "127.0.0.1"
- CYCLONEDDS_PEER_ADDRESSES=${CYCLONEDDS_PEER_ADDRESSES:-127.0.0.1}
# TODO: Should we delete or tick/tock CYCLONEDDS_USE_MULTICAST here?
- CYCLONEDDS_USE_MULTICAST=${CYCLONEDDS_USE_MULTICAST:-false}
# The ROS middleware to use. Defaults to rmw_cyclonedds_cpp, the CycloneDDS middleware.
# MoveIt Pro supports CycloneDDS and FastRTPS, and will respect your CYCLONEDDS_URI and FASTRTPS_DEFAULT_PROFILES_FILE for custom configurations.
- RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION:-rmw_cyclonedds_cpp}
# If using FastRTPS, setting this variable to 1 allows modifying Quality-of-Service (QoS) settings from a specified XML file.
- RMW_FASTRTPS_USE_QOS_FROM_XML
# Renderer used for Gazebo (can be ogre or ogre2)
- GAZEBO_RENDERER=${GAZEBO_RENDERER:-ogre}
# Allow the user to run graphical programs from within the container. You probably don't want to change these!
- DISPLAY
- QT_X11_NO_MITSHM=1
# User settings
- USER_UID=${STUDIO_USER_UID:-1000}
- USERNAME=${STUDIO_USERNAME:-studio-user}
# If USE_HOST_DDS=true, MoveIt Pro will replicate the host DDS configuration files.
- USE_HOST_DDS=${USE_HOST_DDS:-false}
# enable bash prompt colorization
- TERM=xterm-256color
# Allow the user to use the host's network video4linux and usb_device devices.
# "c 81:* rmw": This rule specifies that the container has read, write, and mknod access (rmw) to all character devices (c) with a major number of 81 (video4linux).
# "c 189:* rmw": This rule gives the container read, write, and mknod access (rmw) to all character devices (c) with a major number of 189 (usb_device).
device_cgroup_rules:
- "c 81:* rmw"
- "c 189:* rmw"
volumes:
- ${HOME}/.ros/log_moveit_pro:/home/${STUDIO_USERNAME:-studio-user}/.ros/log
- type: tmpfs
target: /home/${STUDIO_USERNAME:-studio-user}/.config/moveit_pro/
- ${STUDIO_HOST_DATA_DIR:-$HOME/.local/share/moveit_pro}:/home/${STUDIO_USERNAME:-studio-user}/.local/share/moveit_pro/:rw
- ${STUDIO_HOST_USER_WORKSPACE:-./moveit_studio_ws}:/home/${STUDIO_USERNAME:-studio-user}/user_ws/:rw
# Persist Ignition model download cache
- ignition_resources:/home/${STUDIO_USERNAME:-studio-user}/.ignition/

# Mount the host's DDS config(s) so we can talk to user's ROS tooling
# TODO: This should only occur if USE_HOST_DDS=true, RMW_IMPLEMENTATION=rmw_cyclonedds_cpp, and CYCLONEDDS_URI points to a file.
- ${CYCLONEDDS_URI:-/dev/null}:/home/${STUDIO_USERNAME:-studio-user}/.ros/cyclonedds_host.xml
# TODO: This should only happen if USE_HOST_DDS=true, RMW_IMPLEMENTATION=rmw_fastrtps_cpp, and FASTRTPS_DEFAULT_PROFILES_FILE points to a file.
- ${FASTRTPS_DEFAULT_PROFILES_FILE:-/dev/null}:/home/${STUDIO_USERNAME:-studio-user}/.ros/fastdds_host.xml
# Allow access to host hardware e.g. RealSense cameras, Force/torque sensors, gripper
- /dev:/dev
# Allow the user to run graphical programs from within the docker container.
- /tmp/.X11-unix:/tmp/.X11-unix:ro

# Starts the MoveIt Pro Agent and Bridge between the Agent and the Web UI
agent_bridge:
image: moveit-studio-agent-bridge:${STUDIO_DOCKER_TAG:-main}
build:
target: ${AGENT_BRIDGE_IMAGE:-user-overlay}
extends: base
privileged: true
command: ros2 launch ${STUDIO_CONFIG_PACKAGE} agent_bridge.launch.xml

# Starts the robot drivers
drivers:
image: moveit-studio-drivers:${STUDIO_DOCKER_TAG:-main}
extends: base
privileged: true
# Ensures the drivers container has RT priority
ulimits:
rtprio: 99
command: bash -c "robot.app && exec sleep infinity" # Sleep infinity to always keep the container running

web_ui:
image: picknikciuser/moveit-studio-frontend:${STUDIO_DOCKER_TAG:-main}
pull_policy: always
ports:
- "80:80"
network_mode: host

# Developer specific configuration
dev:
extends: base
build:
target: user-overlay-dev
image: moveit-studio-overlay-dev:${STUDIO_DOCKER_TAG:-main}
stdin_open: true
tty: true
privileged: true
command: sleep infinity
# Making a separate profile prevents this service from being built when using `docker compose build`
# and launched when using `docker compose up`.
profiles: ["dev"]

volumes:
ignition_resources:

The docker-compose.yaml

We recommend following the below template when extending docker-compose.yaml.

# Docker Compose file that will be merged with /opt/moveit_pro/docker-compose.yaml.
# For more details on how merging works, see https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/#merging-rules.

# Services that are listed under `/opt/moveit_pro/docker-compose.yaml` are mirrored here for merging.
# Feel free to remove services here that are unmodified.
services:
# The base image that all MoveIt Pro services extend off of. Builds the user workspace.
base:
build:
# List any arguments for building the user workspace here.
args:

# Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI.
agent_bridge:

# Starts the robot drivers.
drivers:

# Starts the web UI frontend.
web_ui:

# Developer specific configuration when running `moveit_pro dev`.
dev:

With the correct environment, docker compose build will build packages in your workspace that launch MoveIt Pro.

Creating an envfile

Run moveit_pro configure and moveit_pro envfile to generate a .env file that has the same required parameters for a build environment that Docker will use.

You can alternatively write all the necessary environment variables yourself into the .env file for more advanced users.

Running with Docker commands

Upon crafting your build arguments and specifications in your docker-compose.yaml, you can use the following to build and run the Docker services:

note

Relative paths are used for your docker-compose.yaml in the following commands, so they must be executed from the same location.

docker compose -f /opt/moveit_pro/docker-compose.yaml -f ./docker-compose.yaml build
docker compose -f /opt/moveit_pro/docker-compose.yaml -f ./docker-compose.yaml run --rm base

Inside the container (~/user_ws), make sure to build your workspace:

colcon build

From the host, launch the agent_bridge and drivers services to start the MoveIt Pro runtime:

docker compose -f /opt/moveit_pro/docker-compose.yaml -f ./docker-compose.yaml up --build agent_bridge drivers

You can alternatively launch the dev service if you want to run the container without launching the MoveIt Pro runtime:

docker compose -f /opt/moveit_pro/docker-compose.yaml -f ./docker-compose.yaml up --build dev

Launching the Web UI

You can launch the web_ui in a separate container after following the above instructions by calling:

docker compose -f /opt/moveit_pro/docker-compose.yaml -f ./docker-compose.yaml up --build web_ui

From here, go to localhost in your browser of choice, and you can access the MoveIt Pro UI.

To simply these commands, we recommend the following alias:

alias moveit-pro-compose="docker compose -f /opt/moveit_pro/docker-compose.yaml -f ./docker-compose.yaml"

Alternative Setup

One other option is to copy the system compose configuration found at /opt/moveit_pro/docker-compose.yaml into your workspace and work with a single file. Creating an envfile is still necessary with this setup.

This will simplify the docker commands above as you will no longer need to specify -f /opt/moveit_pro/docker-compose.yaml -f ./docker-compose.yaml with each command, but you must manually replicate any changes to the system docker-compose.yaml in future releases.

Please contact [email protected] if you need assistance with creating and running this docker-compose.yaml.