Support both nvidia/without nvidia

This commit is contained in:
Daisuke Sato 2021-05-30 15:28:51 +09:00
parent bd7fbd9ec8
commit da939002af
2 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -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: