From 286d0cae9fc8a96e92cc5ba35c308ad07cfd66e8 Mon Sep 17 00:00:00 2001 From: Jakub Delicat Date: Mon, 15 Jan 2024 08:34:18 +0100 Subject: [PATCH] Added multirobot demo and set using prebuilt imags as default for gazebo Signed-off-by: Jakub Delicat --- demo/compose.gazebo.multirobot.yaml | 33 +++++++++++++++++++++++++++++ demo/compose.gazebo.yaml | 8 +++---- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 demo/compose.gazebo.multirobot.yaml diff --git a/demo/compose.gazebo.multirobot.yaml b/demo/compose.gazebo.multirobot.yaml new file mode 100644 index 0000000..d0e960b --- /dev/null +++ b/demo/compose.gazebo.multirobot.yaml @@ -0,0 +1,33 @@ +# Quick Start +# +# 1. run `xhost +local:docker && docker compose -f compose.gazebo.yaml up` on the laptop +# 2. open a shell inside a docker container `docker compose -f compose.gazebo.yaml exec -it rosbot bash` +# 2. run `ros2 run teleop_twist_keyboard teleop_twist_keyboard` inside the container + +x-gpu-config: + &gpu-config + runtime: nvidia + environment: + - DISPLAY=${DISPLAY:?err} + - NVIDIA_VISIBLE_DEVICES=all + - NVIDIA_DRIVER_CAPABILITIES=all + +x-cpu-config: + &cpu-config + environment: + - DISPLAY=${DISPLAY:?err} + - LIBGL_ALWAYS_SOFTWARE=1 + +services: + rosbot: + # image: husarion/rosbot-gazebo:humble + # build: + # context: ../ + # dockerfile: Dockerfile.gazebo + <<: [ *gpu-config] + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix:rw + command: > + ros2 launch rosbot_gazebo simulation.launch.py + mecanum:=${MECANUM:-False} + robots:="robot1={y: 0.0}; robot2={y: 1.0}; robot3={y: 2.0}; diff --git a/demo/compose.gazebo.yaml b/demo/compose.gazebo.yaml index 52032cd..54c35c9 100644 --- a/demo/compose.gazebo.yaml +++ b/demo/compose.gazebo.yaml @@ -20,10 +20,10 @@ x-cpu-config: services: rosbot: - # image: husarion/rosbot-gazebo:humble - build: - context: ../ - dockerfile: Dockerfile.gazebo + image: husarion/rosbot-gazebo:humble + # build: + # context: ../ + # dockerfile: Dockerfile.gazebo <<: [ *gpu-config] volumes: - /tmp/.X11-unix:/tmp/.X11-unix:rw