From da939002af70862b91a2b47bd8a42ea7389a70a2 Mon Sep 17 00:00:00 2001 From: Daisuke Sato Date: Sun, 30 May 2021 15:28:51 +0900 Subject: [PATCH] Support both nvidia/without nvidia --- README.md | 12 ++++++++++-- docker-compose.yml | 6 ++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index de01368..533f837 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,20 @@ There are two ways to run this project. The first is by running the project in a [installing docker-compose](https://docs.docker.com/compose/install/). The benefit of running in the container is that you can run the project in any version of linux, as long as your kernel is new enough. -Once docker is installed, run the following command, and the project should show up: +Once docker is installed, run the following command, and the project should show up. + +without NVIDIA GPU: ``` docker-compose build ros && xhost +local:root && docker-compose up ros ``` +with NVIDIA GPU + +``` +docker-compose build nvidia-ros && xhost +local:root && docker-compose up nvidia-ros +``` + This command does three things: 1) `docker-compose build ros` @@ -46,7 +54,7 @@ This command does three things: 3) `docker-compose up ros` This runs the image specified in the `docker-compose.yml`, which by default runs - the command `roslaunch mycobot_ros control_slider.launch` within the container. + the command `roslaunch mycobot_ros mycobot_slider.launch` within the container. ### Option 2: Local diff --git a/docker-compose.yml b/docker-compose.yml index 9b053d1..bbbb5df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ x-app: &common environment: PYTHONUNBUFFERED: 1 QT_X11_NO_MITSHM: 1 - DISPLAY: :1 + DISPLAY: $DISPLAY volumes: - "/tmp/.X11-unix:/tmp/.X11-unix:rw" build: @@ -19,7 +19,9 @@ x-app: &common services: # This configuration builds the project for computers with NVIDIA hardware - nvidia-ros: *common + nvidia-ros: + <<: *common + runtime: nvidia # This is the default for computers that don't have nvidia hardware accelerators ros: