ros2_bot_mini/docker-compose.yaml

167 lines
4.0 KiB
YAML
Raw Permalink Normal View History

2023-07-24 10:28:21 +00:00
version: "3.9"
services:
# Base image containing dependencies.
base:
2023-07-26 07:52:31 +00:00
image: ghcr.io/bjoernellens1/ros2_bot_mini/bot_mini:base
2023-07-24 10:28:21 +00:00
build:
context: .
dockerfile: docker/Dockerfile
args:
ROS_DISTRO: humble
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:
# 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
2023-07-25 10:09:50 +00:00
2023-07-24 10:28:21 +00:00
# Overlay image containing the example source code.
overlay:
extends: base
2023-07-26 07:52:31 +00:00
image: ghcr.io/bjoernellens1/ros2_bot_mini/bot_mini:overlay
2023-07-24 10:28:21 +00:00
build:
context: .
dockerfile: docker/Dockerfile
target: overlay
2023-07-25 10:09:50 +00:00
2023-07-26 10:15:51 +00:00
# Robot State Publisher
robot_state_publisher:
extends: overlay
command: >
ros2 launch bot_mini_bringup rsp.launch.py
stdin_open: true
tty: true
# Networking and IPC for ROS 2
network_mode: host
ipc: host
2023-07-24 10:28:21 +00:00
# Controller and teleop
controller:
2023-07-26 07:52:31 +00:00
extends: overlay
2023-07-25 08:59:21 +00:00
command: >
2023-07-25 09:29:56 +00:00
/controller_startup.sh
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyACM0:/dev/ttyACM0
- /dev/input/js0:/dev/input/js0
# 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
2023-07-26 10:15:51 +00:00
depends_on:
- robot_state_publisher
2023-07-25 09:29:56 +00:00
2023-07-25 11:42:12 +00:00
# MicroRos Agent
microros_agent:
image: microros/micro-ros-agent:humble
command: >
2023-07-25 11:43:16 +00:00
serial --dev /dev/ttyUSB1 -v6
2023-07-25 11:42:12 +00:00
devices:
- /dev/ttyUSB1:/dev/ttyUSB1
# 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
2023-07-26 10:15:51 +00:00
# sensors
sensors:
extends: overlay
command: >
ros2 launch bot_mini_bringup robot_lidar.launch.py
stdin_open: true
tty: true
# Networking and IPC for ROS 2
network_mode: host
ipc: host
depends_on:
- robot_state_publisher
2023-07-25 10:12:15 +00:00
# Localization
localization:
extends: overlay
command: >
2023-07-26 10:15:51 +00:00
ros2 launch bot_mini_bringup robot_localization.launch.py
2023-07-25 10:12:15 +00:00
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
2023-07-25 11:36:17 +00:00
- /dev/ttyUSB1:/dev/ttyUSB1
2023-07-25 10:12:15 +00:00
- /dev/ttyACM0:/dev/ttyACM0
- /dev/input/js0:/dev/input/js0
# 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
2023-07-25 11:42:12 +00:00
depends_on:
- controller
- microros_agent
2023-07-25 10:10:23 +00:00
2023-07-25 10:12:48 +00:00
# mapping
mapping:
extends: overlay
command: >
ros2 launch bot_mini_bringup robot_mapper.launch.py
# Interactive shell
stdin_open: true
tty: true
# Networking and IPC for ROS 2
network_mode: host
ipc: host
2023-07-25 11:46:33 +00:00
depends_on:
- localization
2023-07-25 09:59:39 +00:00
2023-07-25 10:13:24 +00:00
# navigation
navigation:
extends: overlay
command: >
ros2 launch bot_mini_bringup robot_navigation.launch.py
map_subscribe_transient_local:=true
stdin_open: true
tty: true
# Networking and IPC for ROS 2
network_mode: host
ipc: host
2023-07-25 11:46:33 +00:00
depends_on:
- localization
2023-07-25 10:09:50 +00:00
# # Behavior demo using Python and py_trees
# demo-behavior-py:
# extends: overlay
# command: >
# ros2 launch tb3_autonomy tb3_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 tb3_autonomy tb3_demo_behavior_cpp.launch.py
# tree_type:=${BT_TYPE:?}
# enable_vision:=${ENABLE_VISION:?}
# target_color:=${TARGET_COLOR:?}