Use MoveIt Pro without the CLI
MoveIt Pro ships compatible with docker compose
to run all the services associated with the MoveIt Pro Runtime, including the UI, in the chance that the moveit_pro
CLI verb is inaccessible for your use case, such as in a CI/CD Pipeline. You will need your workspace docker-compose.yaml
directly attaching to the services found in the docker-compose.yaml
installed by MoveIt Pro (default location:/opt/moveit_pro
)
The docker-compose.yaml
We recommend following the below example when constructing your own docker-compose.yaml
.
# Docker Compose file for user overlays of the MoveIt Pro images.
services:
# Sets common properties for other services. Should not be instantiated directly.
base:
# Extend the installed MoveIt Pro docker compose file.
# Change this to match your environment, if MoveIt Pro was installed to a different location.
extends:
file: /opt/moveit_pro/docker-compose.yaml
service: base
image: moveit-pro-overlay
build:
context: .
target: user-overlay
args:
- USER_UID=${STUDIO_USER_UID:-1000}
- USER_GID=${STUDIO_USER_GID:-1000}
- USERNAME=${STUDIO_USERNAME:-studio-user}
- MOVEIT_STUDIO_BASE_IMAGE=picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main}
# Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI
agent_bridge:
extends: base
privileged: true
volumes:
# Allow the user to run graphical programs from within the docker container.
- /tmp/.X11-unix:/tmp/.X11-unix:ro
# Allow access to host hardware e.g. RealSense cameras
- /dev:/dev
deploy:
restart_policy:
condition: any
delay: 2s
command: agent_bridge.app
# Starts the robot drivers.
drivers:
extends: base
privileged: true
# Ensures the drivers container has RT priority
ulimits:
rtprio: 99
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0" # Allow access to the gripper.
command: robot.app
# Starts the web UI frontend.
web_ui:
image: picknikciuser/moveit-studio-frontend:${STUDIO_DOCKER_TAG:-main}
ports:
- "80:80"
network_mode: host
# Starts RViz for visualization.
rviz:
extends: base
profiles:
- rviz
command: bash -c "ros2 launch moveit_studio_agent developer_rviz.launch.py"
# Starts MoveIt Setup Assistant for creating MoveIt configurations.
setup_assistant:
extends: base
profiles:
- setup_assistant
command: bash -c "ros2 launch moveit_setup_assistant setup_assistant.launch.py"
# Developer specific configuration
dev:
extends: base
build:
target: user-overlay-dev
image: moveit-studio-overlay-dev
stdin_open: true
tty: true
privileged: true
volumes:
# Mount the source code, colcon generated artifacts, and ccache
- ./src/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/src:rw
- ./build/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/build:rw
- ./install/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/install:rw
- ./log/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/log:rw
- ./.ccache/:/home/${STUDIO_USERNAME:-studio-user}/.ccache:rw
- ${HOME}/.ros/log_moveit_pro:/home/${STUDIO_USERNAME:-studio-user}/.ros/log
# Allow access to host hardware e.g. RealSense cameras
- /dev:/dev
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 key principle is that you should extend the base
service from the installed MoveIt Pro docker-compose.yaml
.
From here, docker compose build
can build packages in your workspace that connect with 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. Add the following lines to this .env
file:
#your_username found by running `whoami`
STUDIO_USERNAME=your_username
#your_user_id found by running `id -u your_username`
STUDIO_USER_UID=your_user_id
#your_user_gid found by running `id -g your_username`
STUDIO_USER_GID=your_user_gid
You can alternatively write all the necessary environment variables yourself into the .env
file for more advanced users.
Running with Docker commands
Upon extending the services in the installed docker-compose.yaml
, you can run the following to build the workspace:
docker compose build
docker compose run --rm base
Inside the container:
colcon build
From here, launch the agent_bridge
and drivers
services to start the MoveIt Pro runtime:\
docker compose up --build agent_bridge drivers
You can aso launch the dev
service:
docker compose 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 up --build web_ui
From here, go to localhost
in your browser of choice, and you can access the MoveIt Pro UI.
Please contact [email protected]
if you need assistance with creating and running this docker-compose.yaml
.