cps_loki/docker-compose.yaml

163 lines
4.4 KiB
YAML
Raw Permalink Normal View History

2023-08-02 14:18:54 +00:00
version: "3.9"
services:
# Base image containing dependencies.
base:
2023-08-02 14:36:47 +00:00
image: ghcr.io/bjoernellens1/ros2-base:humble
2023-08-02 14:18:54 +00:00
build:
context: .
dockerfile: docker/Dockerfile
2023-08-02 14:36:47 +00:00
tags:
- ghcr.io/bjoernellens1/ros2-base:humble
2023-08-02 14:18:54 +00:00
args:
ROS_DISTRO: humble
2023-08-02 17:12:24 +00:00
UNDERLAY_WS: cps_bot_mini_ws
OVERLAY_WS: overlay_ws
2023-08-02 14:18:54 +00:00
target: base
x-bake:
platforms:
- linux/arm64
- linux/amd64
# 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
2023-11-24 09:16:34 +00:00
- CYCLONEDDS_URI=file:///cyclonedds.xml
2023-08-02 14:18:54 +00:00
volumes:
# Allows graphical programs in the container.
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ${XAUTHORITY:-$HOME/.Xauthority}:/root/.Xauthority
2023-11-24 09:16:34 +00:00
- ./config/cyclonedds.xml:/cyclonedds.xml
2023-08-02 14:18:54 +00:00
# Overlay image containing the project specific source code.
overlay:
extends: base
2023-08-02 14:36:47 +00:00
image: ghcr.io/bjoernellens1/cps_bot_mini_ws/bot:overlay
2023-08-02 14:18:54 +00:00
build:
context: .
dockerfile: docker/Dockerfile
tags:
2023-08-02 14:36:47 +00:00
- ghcr.io/bjoernellens1/cps_bot_mini_ws/bot:overlay
2023-08-02 14:18:54 +00:00
target: overlay
x-bake:
platforms:
- linux/arm64
- linux/amd64
volumes:
- .:/repo
# Additional dependencies for GUI applications
guis:
extends: overlay
2023-08-02 14:36:47 +00:00
image: ghcr.io/bjoernellens1/cps_bot_mini_ws/bot:guis
2023-08-02 14:18:54 +00:00
build:
context: .
dockerfile: docker/Dockerfile
tags:
2023-08-02 14:36:47 +00:00
- ghcr.io/bjoernellens1/cps_bot_mini_ws/bot:guis
2023-08-02 14:18:54 +00:00
target: guis
x-bake:
platforms:
- linux/arm64
- linux/amd64
command: >
/bin/bash
# Robot State Publisher
robot_state_publisher:
extends: overlay
command: >
2023-11-20 07:49:07 +00:00
ros2 launch cps_loki_bringup rsp.launch.py
2023-08-02 14:18:54 +00:00
# Controller
controller:
extends: overlay
command: >
2023-11-20 07:49:07 +00:00
ros2 launch cps_loki_bringup robot_controller.launch.py
2023-08-02 14:18:54 +00:00
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyACM0:/dev/ttyACM0
2023-10-16 15:49:45 +00:00
restart: unless-stopped
2023-11-20 07:49:07 +00:00
2023-08-02 14:18:54 +00:00
# teleop
teleop:
extends: overlay
command: >
2023-11-20 07:49:07 +00:00
ros2 launch cps_loki_bringup robot_joy_teleop.launch.py
2023-08-02 14:18:54 +00:00
devices:
2023-11-20 07:49:07 +00:00
- /dev/input:/dev/input
2023-10-16 15:49:45 +00:00
restart: unless-stopped
2023-08-02 14:18:54 +00:00
2023-11-24 09:13:46 +00:00
# scan filter node
lidar_filter:
extends: overlay
command: >
ros2 launch cps_loki_bringup robot_scan_filter.launch.py
2023-08-02 14:18:54 +00:00
# lidar
lidar:
extends: overlay
2023-11-24 09:13:46 +00:00
depends_on:
- lidar_filter
2023-08-02 14:18:54 +00:00
command: >
2023-11-20 07:49:07 +00:00
ros2 launch cps_loki_bringup robot_lidar.launch.py
2023-08-02 14:36:47 +00:00
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
2023-11-20 07:49:07 +00:00
#- /dev/ttyUSB1:/dev/ttyUSB1
2023-08-02 14:36:47 +00:00
- /dev/ttyACM0:/dev/ttyACM0
2023-08-02 14:18:54 +00:00
# mapping
mapping:
extends: overlay
command: >
2023-11-20 07:49:07 +00:00
ros2 launch cps_loki_bringup robot_mapper.launch.py
2023-08-02 14:18:54 +00:00
# navigation
navigation:
extends: overlay
2023-11-16 13:41:30 +00:00
#command: >
# ros2 launch cbot_mini_bringup robot_navigation.launch.py
# map_subscribe_transient_local:=true
2023-08-02 14:18:54 +00:00
command: >
2023-11-20 08:48:37 +00:00
ros2 launch nav2_bringup bringup_launch.py slam:=True map:=/repo/map.yaml use_sim_time:=False use_composition:=True params_file:=/overlay_ws/src/cps_loki_bringup/config/nav2_params.yaml
2023-11-20 09:01:05 +00:00
depends_on:
- lidar
- controller
- teleop
2023-08-02 14:18:54 +00:00
# rviz2
rviz2:
extends: guis
command: >
rviz2
# Needed to display graphical applications
privileged: true
2023-11-22 09:53:50 +00:00
#####################################################################################################
# Follwowing section adds mesh vpn configuration for the whole system via tailscale docker container#
#####################################################################################################
# tailscale
2023-11-22 09:56:32 +00:00
tailscale:
privileged: true
hostname: tailscale # This will become the tailscale device name
network_mode: "host"
container_name: tailscale
image: tailscale/tailscale:latest
volumes:
- "/opt/appdata/tailscale/var_lib:/var/lib" # State data will be stored in this directory
- "/dev/net/tun:/dev/net/tun" # Required for tailscale to work
cap_add: # Required for tailscale to work
- net_admin
- sys_module
command: tailscaled
restart: unless-stopped