ros2_bot_mini/docker-compose.yaml

88 lines
2.5 KiB
YAML
Raw Normal View History

2023-07-24 10:28:21 +00:00
version: "3.9"
services:
# Base image containing dependencies.
base:
image: bot_mini:base
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
# Overlay image containing the example source code.
overlay:
extends: base
image: bot_mini:overlay
build:
context: .
dockerfile: docker/Dockerfile
target: overlay
# Controller and teleop
controller:
extends: overlay
2023-07-25 09:01:44 +00:00
entrypoint: ["/bin/sh","-c"]
2023-07-25 08:59:21 +00:00
command: >
2023-07-25 09:03:17 +00:00
&& source install/setup.bash
&&
2023-07-25 08:59:21 +00:00
ros2 launch bot_mini_bringup robot_controller.launch.py
priority:=80 cpu-affinity:=4 lock-memory-size:=100 config-child-threads:=True
&& ros2 launch bot_mini_bringup robot_twist_mux.launch.py
&& ros2 launch bot_mini_bringup robot_joy_teleop.launch.py
2023-07-25 07:20:52 +00:00
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyACM0:/dev/ttyACM0
- /dev/input/js0:/dev/input/js0
2023-07-25 07:41:16 +00:00
# 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-24 10:28:21 +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:?}