This commit is contained in:
Your Name 2024-03-28 09:53:35 +01:00
parent 5b5c0ca098
commit cbc84b434b
2 changed files with 125 additions and 80 deletions

View File

@ -2,7 +2,7 @@
# debug # debug
# } # }
http://loki { http://cps-seggy {
root * /usr/share/caddy root * /usr/share/caddy
file_server browse file_server browse
@ -20,7 +20,7 @@ http://loki {
} }
} }
http://loki.local { http://cps-seggy.local {
root * /usr/share/caddy root * /usr/share/caddy
file_server browse file_server browse

View File

@ -1,28 +1,5 @@
version: "3.9" version: "3.9"
# First network configuration. Change this to the network interface you want to use primarily. (Better configuration for multiple Network interfaces needed).
networks:
# rmp:
# driver: macvlan
# driver_opts:
# parent: eno1 # robot network interface
# ipam:
# config:
# - subnet: 192.168.0.0/24
# gateway: 192.168.0.1
# ip_range: 192.168.0.200/25
# aux_addresses:
# net-address: 192.168.0.100 #? what is this for --> to exclude addresses from buing used.
# make new bridge network for ros
rmp:
driver: bridge
# ipam:
# config:
# - subnet:
# add this mountpoint to all services: - ./customize/entrypoint.sh:/entrypoint.sh
# Attention: child services will inherit settings from their parents. So if you set a network_mode: host in the base service, all child services will also use host networking. This is not always what you want. So be careful with this.
services: services:
# Base image containing dependencies. # Base image containing dependencies.
base: base:
@ -141,8 +118,8 @@ services:
ros2 launch cps_rmp220_support robot_lidar.launch.py serial_port:=/dev/rplidarA1 ros2 launch cps_rmp220_support robot_lidar.launch.py serial_port:=/dev/rplidarA1
devices: devices:
- /dev/rplidarA1:/dev/rplidarA1 #udevrules needed for this to work: - /dev/rplidarA1:/dev/rplidarA1 #udevrules needed for this to work:
# SUBSYSTEM=="tty", ATTRS{serial}=="0001", SYMLINK+="segway" # SUBSYSTEM=="tty", ATTRS{serial}=="0001", SYMLINK+="segway"
# SUBSYSTEM=="tty", ATTRS{serial}=="3453995662b3af4f81f4a69eba5f3f29", SYMLINK+="rplidarA1" # SUBSYSTEM=="tty", ATTRS{serial}=="3453995662b3af4f81f4a69eba5f3f29", SYMLINK+="rplidarA1"
# Lidar filtering node. # Lidar filtering node.
lidar_filter: lidar_filter:
@ -241,6 +218,8 @@ services:
tty: true tty: true
# Networking # Networking
network_mode: bridge network_mode: bridge
networks:
- caddy_network
ports: ports:
- 8080:8080 - 8080:8080
depends_on: depends_on:
@ -272,41 +251,41 @@ services:
### Images for ROS1 Interactions ### Images for ROS1 Interactions
#ROS1 Bridge #ROS1 Bridge
ros1bridge: # ros1bridge:
image: ghcr.io/bjoernellens1/ros2_rmp/ros1bridge # image: ghcr.io/bjoernellens1/ros2_rmp/ros1bridge
command: > # command: >
ros2 run ros1_bridge dynamic_bridge --bridge-all-2to1-topics # ros2 run ros1_bridge dynamic_bridge --bridge-all-2to1-topics
build: # build:
context: . # context: .
dockerfile: docker/Dockerfile # dockerfile: docker/Dockerfile
tags: # tags:
- ghcr.io/bjoernellens1/ros2_rmp/ros1bridge # - ghcr.io/bjoernellens1/ros2_rmp/ros1bridge
args: # args:
ROS_DISTRO: humble # ROS_DISTRO: humble
target: bridge # target: bridge
x-bake: # x-bake:
platforms: # platforms:
#- linux/arm64 # #- linux/arm64
- linux/amd64 # - linux/amd64
# Networking and IPC for ROS 2 # # Networking and IPC for ROS 2
network_mode: host # network_mode: host
ipc: host # ipc: host
environment: # environment:
- ROS_DOMAIN_ID=5 # - ROS_DOMAIN_ID=5
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
- ROS_MASTER_URI=http://localhost:11311 # is configured to run roscore on the robot but could change to local ros1 machine here # - ROS_MASTER_URI=http://localhost:11311 # is configured to run roscore on the robot but could change to local ros1 machine here
#ROS1 roscore #ROS1 roscore
roscore: # roscore:
command: > # command: >
roscore # roscore
extends: ros1bridge # extends: ros1bridge
network_mode: host # network_mode: host
ipc: host # ipc: host
environment: # environment:
- ROS_DOMAIN_ID=5 # - ROS_DOMAIN_ID=5
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
- ROS_MASTER_URI=http://localhost:11311 # is configured to run roscore on the robot but could change to local ros1 machine here # - ROS_MASTER_URI=http://localhost:11311 # is configured to run roscore on the robot but could change to local ros1 machine here
## Configure on ROS1 Hosts ## Configure on ROS1 Hosts
# seggy 192.168.0.100 # seggy 192.168.0.100
@ -360,25 +339,91 @@ services:
- DISPLAY=${DISPLAY} - DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1 - QT_X11_NO_MITSHM=1
- NVIDIA_DRIVER_CAPABILITIES=all - NVIDIA_DRIVER_CAPABILITIES=all
zerotier: ################################################################################################################################
image: "zyclonite/zerotier:router" # Core Services for Web Management #
container_name: zerotier-one ################################################################################################################################
devices: caddy:
- /dev/net/tun image: caddy:latest
network_mode: host networks:
- caddy_network
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "80:80"
- "443:443"
volumes: volumes:
- '/var/lib/zerotier-one:/var/lib/zerotier-one' - ./config/caddy/Caddyfile:/etc/caddy/Caddyfile
cap_add: - ./config/caddy/content:/usr/share/caddy/
- NET_ADMIN restart: always
- SYS_ADMIN depends_on:
- NET_RAW - foxglove
restart: unless-stopped - olivetin
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: environment:
- TZ=Europe/Amsterdam - ROS_DOMAIN_ID=5
- PUID=1000 restart: always
- PGID=1000 ros1bridge:
- ZEROTIER_ONE_LOCAL_PHYS=enp5s0 wlx00e04c5513fc # change for actual interfaces image: husarion/ros1-bridge:foxy-0.9.6-20230327-stable
- ZEROTIER_ONE_USE_IPTABLES_NFT=false command: |
- ZEROTIER_ONE_GATEWAY_MODE=inbound # might change to both ways ros2 run ros1_bridge dynamic_bridge
#- ZEROTIER_ONE_NETWORK_IDS= # does not really do much? network_mode: host
ipc: host
environment:
- ROS_DOMAIN_ID=5
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
restart: always
webui-joystick:
image: husarion/webui-ros-joystick:noetic-0.0.1-20230510-stable
network_mode: host
# networks:
# - caddy_network
# ports:
# - 8000:8000
ipc: host
environment:
- ROS_DOMAIN_ID=5
restart: always
depends_on:
- ros1bridge
command: roslaunch webui-ros-joystick webui.launch
olivetin:
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
networks:
- caddy_network
ports:
- "1337:1337"
restart: always
################################################################################################################################
# Docker related extra stuff #
################################################################################################################################
networks:
caddy_network:
driver: bridge