-
Notifications
You must be signed in to change notification settings - Fork 62
/
docker-compose.yaml
92 lines (86 loc) · 2.5 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Docker Compose file for TurtleBot Behavior Examples
#
# Usage:
#
# To build the images:
# docker compose build
#
# To start up a specific service by name:
# docker compose up <service_name>
#
# To open an interactive shell to a running container:
# docker exec -it <container_name> bash
services:
# Base image containing dependencies.
base:
image: turtlebot_behavior:base
build:
context: .
dockerfile: docker/Dockerfile
args:
ROS_DISTRO: ${ROS_DISTRO:?}
target: base
# Interactive shell
stdin_open: true
tty: true
# Networking and IPC for ROS 2
network_mode: host
ipc: host
# Needed to display graphical applications
privileged: True
environment:
# Needed to define a TurtleBot model type (3 or 4)
- TURTLEBOT_MODEL=${TURTLEBOT_MODEL:-3}
# Allows graphical programs in the container.
- DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1
- NVIDIA_DRIVER_CAPABILITIES=all
volumes:
# Allows graphical programs in the container.
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ${XAUTHORITY:-$HOME/.Xauthority}:/root/.Xauthority
# Overlay image containing the example source code.
overlay:
extends: base
image: turtlebot_behavior:overlay
build:
context: .
dockerfile: docker/Dockerfile
target: overlay
# Developer container
dev:
extends: overlay
image: turtlebot_behavior:dev
build:
context: .
dockerfile: docker/Dockerfile
target: dev
volumes:
# Mount the source code
- ./tb_autonomy:/overlay_ws/src/tb_autonomy:rw
- ./tb_worlds:/overlay_ws/src/tb_worlds:rw
# Mount colcon build artifacts for faster rebuilds
- ./.colcon/build/:/overlay_ws/build/:rw
- ./.colcon/install/:/overlay_ws/install/:rw
- ./.colcon/log/:/overlay_ws/log/:rw
command: sleep infinity
# Demo simulation world
demo-world:
extends: overlay
command: ros2 launch tb_worlds tb_demo_world.launch.py
# Behavior demo using Python and py_trees
demo-behavior-py:
extends: overlay
command: >
ros2 launch tb_autonomy tb_demo_behavior_py.launch.py
tree_type:=${BT_TYPE:?}
enable_vision:=${ENABLE_VISION:?}
target_color:=${TARGET_COLOR:?}
# Behavior demo using C++ and BehaviorTree.CPP
demo-behavior-cpp:
extends: overlay
command: >
ros2 launch tb_autonomy tb_demo_behavior_cpp.launch.py
tree_type:=${BT_TYPE:?}
enable_vision:=${ENABLE_VISION:?}
target_color:=${TARGET_COLOR:?}