cps_loki/docker-compose.yaml

284 lines
8.3 KiB
YAML
Raw Normal View History

2023-08-02 14:18:54 +00:00
version: "3.9"
services:
# Base image containing dependencies.
base:
2023-11-30 10:53:19 +00:00
image: ghcr.io/bjoernellens1/cps_bot_mini_ws/base
2023-08-02 14:18:54 +00:00
build:
context: .
dockerfile: docker/Dockerfile
2023-08-02 14:36:47 +00:00
tags:
2023-11-30 10:53:19 +00:00
- ghcr.io/bjoernellens1/cps_bot_mini_ws/base
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
2023-11-27 07:58:33 +00:00
#privileged: true
2023-08-02 14:18:54 +00:00
environment:
# Allows graphical programs in the container.
- DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1
- NVIDIA_DRIVER_CAPABILITIES=all
2023-11-20 10:32:30 +00:00
- ROS_DOMAIN_ID=5
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
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
2024-02-08 10:48:19 +00:00
restart: unless-stopped
2023-08-02 14:18:54 +00:00
# Overlay image containing the project specific source code.
overlay:
extends: base
2023-11-30 10:53:19 +00:00
image: ghcr.io/bjoernellens1/cps_bot_mini_ws/overlay
2023-08-02 14:18:54 +00:00
build:
context: .
dockerfile: docker/Dockerfile
tags:
2023-11-30 10:53:19 +00:00
- ghcr.io/bjoernellens1/cps_bot_mini_ws/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-11-30 10:53:19 +00:00
image: ghcr.io/bjoernellens1/cps_bot_mini_ws/guis
2023-08-02 14:18:54 +00:00
build:
context: .
dockerfile: docker/Dockerfile
tags:
2023-11-30 10:53:19 +00:00
- ghcr.io/bjoernellens1/cps_bot_mini_ws/guis
2023-08-02 14:18:54 +00:00
target: guis
x-bake:
platforms:
- linux/arm64
- linux/amd64
2023-11-30 08:13:22 +00:00
command: |
2023-08-02 14:18:54 +00:00
/bin/bash
# Robot State Publisher
robot_state_publisher:
extends: overlay
2023-11-30 08:13:22 +00:00
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:
2023-11-30 08:13:22 +00:00
extends: overlay
command: |
2023-11-20 07:49:07 +00:00
ros2 launch cps_loki_bringup robot_controller.launch.py
2023-12-04 08:38:08 +00:00
privileged: true
2023-08-02 14:18:54 +00:00
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyACM0:/dev/ttyACM0
2024-03-25 09:02:56 +00:00
restart: always
2023-08-02 14:18:54 +00:00
# teleop
teleop:
2023-11-30 08:13:22 +00:00
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
2024-03-25 09:02:56 +00:00
restart: always
2023-11-24 08:53:30 +00:00
# scan filter node
lidar_filter:
extends: overlay
2023-11-30 08:13:22 +00:00
command: |
2023-11-24 08:53:30 +00:00
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 08:54:23 +00:00
depends_on:
- lidar_filter
2023-11-30 08:13:22 +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
- /dev/ttyACM0:/dev/ttyACM0
2023-08-02 14:18:54 +00:00
# mapping
mapping:
extends: overlay
2023-11-30 08:13:22 +00:00
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-30 08:13:22 +00:00
ros2 launch nav2_bringup bringup_launch.py slam:=True map:=/repo/map.yaml
use_sim_time:=False use_composition:=True
2024-02-05 11:00:26 +00:00
params_file:=/repo/config/nav2_params.yaml
2023-11-20 09:01:05 +00:00
depends_on:
- lidar
- controller
- teleop
2023-11-27 07:51:20 +00:00
# camera
cam:
extends: overlay
command: >
2023-11-27 16:53:28 +00:00
ros2 launch ffmpeg_image_transport cam.launch.py
2023-11-27 09:40:15 +00:00
privileged: true
2023-11-27 16:53:46 +00:00
devices:
- /dev/dri:/dev/dri
2023-11-27 07:51:20 +00:00
2023-12-04 09:09:55 +00:00
###################################################################################################################################
# Webgui Supervision via Foxglove Studio #
###################################################################################################################################
2024-02-05 11:36:28 +00:00
olivetin:
2024-01-11 15:07:52 +00:00
container_name: olivetin
image: jamesread/olivetin
#image: ghcr.io/bjoernellens1/cps_bot_mini_ws/olivetin
build:
context: .
dockerfile: docker/Dockerfile
tags:
- ghcr.io/bjoernellens1/cps_bot_mini_ws/olivetin
target: olivetin
x-bake:
platforms:
#- linux/arm64
- linux/amd64
user: root
privileged: true
volumes:
- ./config/olivetin/:/config/ # here is config.yaml and icons located
- ./config/olivetin/icons:/var/www/olivetin/customIcons
- .:/repo
- /var/run/docker.sock:/var/run/docker.sock
# - /var/lib/docker:/var/lib/docker
- ~/.ssh/id_rsa:/root/.ssh/id_rsa
2024-03-20 11:01:11 +00:00
networks:
- caddy_network
2024-01-11 15:07:52 +00:00
ports:
2024-02-08 10:48:19 +00:00
- "1337:1337"
2024-03-25 09:02:56 +00:00
restart: always
2024-01-11 15:07:52 +00:00
portainer:
container_name: portainer
#image: jamesread/olivetin
image: portainer/portainer-ce:latest
volumes:
- ./config/olivetin/:/config/ # here is config.yaml and icons located
- ./config/olivetin/icons:/var/www/olivetin/customIcons
- .:/repo
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
# - /var/lib/docker:/var/lib/docker
- ~/.ssh/id_rsa:/root/.ssh/id_rsa
ports:
- "8000:8000"
- "9443:9443"
restart: unless-stopped
2023-11-27 07:51:20 +00:00
################################################################################################################################
# This section is mostly for supervision from PC #
################################################################################################################################
2023-12-04 09:09:55 +00:00
2024-01-19 11:08:43 +00:00
# Foxglove Studio Bridge
2024-02-05 11:00:26 +00:00
foxglove_bridge:
2024-01-19 11:08:43 +00:00
extends: overlay
command: >
ros2 launch foxglove_bridge foxglove_bridge_launch.xml port:=8765
2023-12-04 09:09:55 +00:00
stdin_open: true
tty: true
# Networking and IPC for ROS 2
2024-01-19 11:08:43 +00:00
#network_mode: host
2023-12-04 09:09:55 +00:00
ipc: host
environment:
- ROS_DOMAIN_ID=5
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
2023-12-04 09:51:41 +00:00
foxglove:
2024-01-19 11:08:43 +00:00
#image: husarion/foxglove
image: ghcr.io/foxglove/studio:latest
2024-03-25 09:02:56 +00:00
restart: always
2023-12-04 09:51:41 +00:00
depends_on:
2024-02-05 11:00:26 +00:00
- foxglove_bridge
2024-03-20 11:01:11 +00:00
networks:
- caddy_network
2023-12-04 09:51:41 +00:00
ports:
- 8080:8080
2024-01-19 11:08:43 +00:00
volumes:
- ./config/foxglove/extensions:/src/extensions
- ./config/foxglove/foxglove-layout.json:/foxglove/default-layout.json
2023-12-04 09:09:55 +00:00
2023-08-02 14:18:54 +00:00
# rviz2
rviz2:
extends: guis
2023-11-30 08:13:22 +00:00
command: |
2023-08-02 14:18:54 +00:00
rviz2
# Needed to display graphical applications
privileged: true
2024-02-05 11:00:26 +00:00
################################################################################################################################
# Core Services for Web Management #
################################################################################################################################
2024-02-08 10:48:19 +00:00
caddy:
image: caddy:latest
2024-03-20 11:01:11 +00:00
networks:
- caddy_network
2024-02-05 11:00:26 +00:00
ports:
2024-02-08 10:48:19 +00:00
- "80:80"
- "443:443"
2024-02-05 11:00:26 +00:00
volumes:
2024-02-08 10:48:19 +00:00
- ./config/caddy/Caddyfile:/etc/caddy/Caddyfile
- ./config/caddy/content:/usr/share/caddy/
restart: always
2024-02-05 11:36:28 +00:00
depends_on:
- foxglove
- olivetin
2024-03-27 08:39:00 +00:00
roscore:
image: husarion/ros1-bridge:foxy-0.9.6-20230327-stable
command: |
bash -c "source /opt/ros/noetic/setup.bash && roscore"
network_mode: host
environment:
- ROS_DOMAIN_ID=5
restart: always
ros1bridge:
image: husarion/ros1-bridge:foxy-0.9.6-20230327-stable
command: |
ros2 run ros1_bridge dynamic_bridge
network_mode: host
2024-03-27 09:23:04 +00:00
ipc: host
2024-03-27 08:39:00 +00:00
environment:
- ROS_DOMAIN_ID=5
2024-03-27 09:23:04 +00:00
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
restart: no
2024-03-27 08:39:00 +00:00
webui-joystick:
image: husarion/webui-ros-joystick:noetic-0.0.1-20230510-stable
network_mode: host
2024-03-27 09:23:04 +00:00
ipc: host
2024-03-27 08:39:00 +00:00
environment:
- ROS_DOMAIN_ID=5
restart: always
2024-03-27 09:23:04 +00:00
depends_on:
- ros1bridge
command: roslaunch webui-ros-joystick webui.launch
2024-03-27 08:40:00 +00:00
2024-02-05 11:00:26 +00:00
################################################################################################################################
# Docker related extra stuff #
################################################################################################################################
2024-03-20 11:01:11 +00:00
networks:
caddy_network:
driver: bridge
2024-01-11 15:07:52 +00:00
volumes:
2024-03-20 11:01:11 +00:00
portainer_data:
npm-data:
npm-letsencrypt: