mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-14 09:00:53 +00:00
Add support for computers without NVIDIA hardware
This commit is contained in:
parent
61f76d6edb
commit
6034999702
3 changed files with 30 additions and 19 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
|
ARG BASE_IMAGE
|
||||||
|
|
||||||
ARG UBUNTU_VERSION
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
FROM nvidia/opengl:1.1-glvnd-runtime-ubuntu${UBUNTU_VERSION}
|
|
||||||
|
|
||||||
# For this build, we pull the entire ros image, and then merge the filesystem
|
# For this build, we pull the entire ros image, and then merge the filesystem
|
||||||
# with the nvidia/opengl image, so that displaying to the screen on GPU
|
# with the nvidia/opengl image, so that displaying to the screen on GPU
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,11 @@ 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:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker-compose build && xhost +local:root && docker-compose up
|
docker-compose build ros && xhost +local:root && docker-compose up ros
|
||||||
```
|
```
|
||||||
|
|
||||||
This command does three things:
|
This command does three things:
|
||||||
1) `docker-compose build`
|
1) `docker-compose build ros`
|
||||||
|
|
||||||
This builds the project in a container. That means nothing is installed on your host machine!
|
This builds the project in a container. That means nothing is installed on your host machine!
|
||||||
The first time this runs, this command will take a long while. After running it once, caching
|
The first time this runs, this command will take a long while. After running it once, caching
|
||||||
|
|
@ -43,7 +43,7 @@ This command does three things:
|
||||||
|
|
||||||
This command gives X the ability to display GUI's from within the docker container
|
This command gives X the ability to display GUI's from within the docker container
|
||||||
|
|
||||||
3) `docker-compose up`
|
3) `docker-compose up ros`
|
||||||
|
|
||||||
This runs the image specified in the `docker-compose.yml`, which by default runs
|
This runs the image specified in the `docker-compose.yml`, which by default runs
|
||||||
the command `roslaunch myCobotROS control_slider.launch` within the container.
|
the command `roslaunch myCobotROS control_slider.launch` within the container.
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,31 @@
|
||||||
version: '3'
|
version: '3.4'
|
||||||
|
|
||||||
|
x-app: &common
|
||||||
|
command: [ "roslaunch myCobotROS control_slider.launch" ]
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
PYTHONUNBUFFERED: 1
|
||||||
|
QT_X11_NO_MITSHM: 1
|
||||||
|
DISPLAY: :1
|
||||||
|
volumes:
|
||||||
|
- "/tmp/.X11-unix:/tmp/.X11-unix:rw"
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args: &common-args
|
||||||
|
ROS_DISTRO: "kinetic"
|
||||||
|
PYMYCOBOT_VERSION: ">=2<3"
|
||||||
|
BASE_IMAGE: nvidia/opengl:1.1-glvnd-runtime-ubuntu18.04
|
||||||
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
# This configuration builds the project for computers with NVIDIA hardware
|
||||||
|
nvidia-ros: *common
|
||||||
|
|
||||||
|
# This is the default for computers that don't have nvidia hardware accelerators
|
||||||
ros:
|
ros:
|
||||||
image: elephantrobotics/my-cobot-ros
|
<<: *common
|
||||||
command: ["roslaunch myCobotROS control_slider.launch"]
|
|
||||||
privileged: true
|
|
||||||
environment:
|
|
||||||
PYTHONUNBUFFERED: 1
|
|
||||||
QT_X11_NO_MITSHM: 1
|
|
||||||
DISPLAY: :1
|
|
||||||
volumes:
|
|
||||||
- "/tmp/.X11-unix:/tmp/.X11-unix:rw"
|
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
args:
|
args:
|
||||||
UBUNTU_VERSION: "16.04"
|
<<: *common-args
|
||||||
ROS_DISTRO: "kinetic"
|
BASE_IMAGE: ubuntu:18.04
|
||||||
PYMYCOBOT_VERSION: ">=2<3"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue