|
| 1 | +# Docker Compose file for user overlays of the MoveIt Pro images. |
| 2 | + |
| 3 | +services: |
| 4 | + # Sets common properties for other services. Should not be instantiated directly. |
| 5 | + base: |
| 6 | + # Extend the installed MoveIt Pro docker compose file. |
| 7 | + # Change this to match your environment, if MoveIt Pro was installed to a different location. |
| 8 | + extends: |
| 9 | + file: /opt/moveit_pro/docker-compose.yaml |
| 10 | + service: base |
| 11 | + image: moveit-pro-overlay |
| 12 | + build: |
| 13 | + context: . |
| 14 | + target: user-overlay |
| 15 | + args: |
| 16 | + - USER_UID=${STUDIO_USER_UID:-1000} |
| 17 | + - USER_GID=${STUDIO_USER_GID:-1000} |
| 18 | + - USERNAME=${STUDIO_USERNAME:-studio-user} |
| 19 | + - MOVEIT_STUDIO_BASE_IMAGE=picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main} |
| 20 | + |
| 21 | + # Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI |
| 22 | + agent_bridge: |
| 23 | + extends: base |
| 24 | + privileged: true |
| 25 | + # This service relies on cgroup_rules defined in base which allow the user to use the host's network video4linux and usb_device devices. |
| 26 | + depends_on: |
| 27 | + rest_api: |
| 28 | + condition: service_healthy |
| 29 | + volumes: |
| 30 | + # Allow the user to run graphical programs from within the docker container. |
| 31 | + - /tmp/.X11-unix:/tmp/.X11-unix:ro |
| 32 | + # Allow access to host hardware e.g. RealSense cameras |
| 33 | + - /dev:/dev |
| 34 | + deploy: |
| 35 | + restart_policy: |
| 36 | + condition: any |
| 37 | + delay: 2s |
| 38 | + command: agent_bridge.app |
| 39 | + |
| 40 | + # Starts the REST API for the Web UI. |
| 41 | + rest_api: |
| 42 | + extends: base |
| 43 | + healthcheck: |
| 44 | + test: "curl -f http://localhost:3200/objectives" |
| 45 | + interval: 5s |
| 46 | + timeout: 1m |
| 47 | + command: rest_api.app |
| 48 | + |
| 49 | + # Starts the robot drivers. |
| 50 | + drivers: |
| 51 | + extends: base |
| 52 | + privileged: true |
| 53 | + # Ensures the drivers container has RT priority |
| 54 | + ulimits: |
| 55 | + rtprio: 99 |
| 56 | + devices: |
| 57 | + - "/dev/ttyUSB0:/dev/ttyUSB0" # Allow access to the gripper. |
| 58 | + command: robot.app |
| 59 | + |
| 60 | + # Starts the web UI frontend. |
| 61 | + web_ui: |
| 62 | + image: picknikciuser/moveit-studio-frontend:${STUDIO_DOCKER_TAG:-main} |
| 63 | + ports: |
| 64 | + - "80:80" |
| 65 | + network_mode: host |
| 66 | + |
| 67 | + # Starts RViz for visualization. |
| 68 | + rviz: |
| 69 | + extends: base |
| 70 | + profiles: |
| 71 | + - rviz |
| 72 | + command: bash -c "ros2 launch moveit_studio_agent developer_rviz.launch.py" |
| 73 | + |
| 74 | + # Starts MoveIt Setup Assistant for creating MoveIt configurations. |
| 75 | + setup_assistant: |
| 76 | + extends: base |
| 77 | + profiles: |
| 78 | + - setup_assistant |
| 79 | + command: bash -c "ros2 launch moveit_setup_assistant setup_assistant.launch.py" |
| 80 | + |
| 81 | + # Developer specific configuration |
| 82 | + dev: |
| 83 | + extends: base |
| 84 | + build: |
| 85 | + target: user-overlay-dev |
| 86 | + image: moveit-studio-overlay-dev |
| 87 | + stdin_open: true |
| 88 | + tty: true |
| 89 | + privileged: true |
| 90 | + volumes: |
| 91 | + # Mount the source code, colcon generated artifacts, and ccache |
| 92 | + - ./src/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/src:rw |
| 93 | + - ./build/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/build:rw |
| 94 | + - ./install/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/install:rw |
| 95 | + - ./log/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/log:rw |
| 96 | + - ./.ccache/:/home/${STUDIO_USERNAME:-studio-user}/.ccache:rw |
| 97 | + - ${HOME}/.ros/log_moveit_pro:/home/${STUDIO_USERNAME:-studio-user}/.ros/log |
| 98 | + # Allow access to host hardware e.g. RealSense cameras |
| 99 | + - /dev:/dev |
| 100 | + command: sleep infinity |
| 101 | + # Making a separate profile prevents this service from being built when using `docker compose build` |
| 102 | + # and launched when using `docker compose up`. |
| 103 | + profiles: ["dev"] |
| 104 | + |
| 105 | +volumes: |
| 106 | + ignition_resources: |
0 commit comments