Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

initial commit for updated docker process. #165

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
436 changes: 0 additions & 436 deletions Dockerfile

This file was deleted.

159 changes: 0 additions & 159 deletions Dockerfile.old

This file was deleted.

52 changes: 52 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Gym-Gazebo Docker
There are two catagories of dockerfiles in this repo: base images and example images. The base images are simply versions of the gym-gazebo images with only the nessesary support libraries such as ROS and Gym.

The application images are built on the base images described above and have examples loaded into them.

This fodler is setup such that each image has its own folder is an image and each subfolder is a tagged version. This enbles automated build in https://hub.docker.com. For example:



## Requirements
[nvidia-docker 2](https://github.com/NVIDIA/nvidia-docker) allows running cuda-based nueral nets and render displays from the container.


## Recommended (Easy) Method
```
docker run \
--runtime=nvidia \
-v="/tmp/.gazebo/:/root/.gazebo/" \
--rm \
-it \
-p 11345:11345 \
-p 11311:11311 \
--name=gym-gazebo-turtlebot \
austinderic/gym-gazebo-turtlebot:kinetic-nvidia9.2 \
/bin/bash
```
This will open a bash shell in the container:
```
python /root/gym-gazebo/examples/turtlebot/circuit2_turtlebot_lidar_qlearn.py
```
then we can connect to our new container
```
export GAZEBO_MASTER_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' gym-gazebo-turtlebot) && export GAZEBO_MASTER_URI=$GAZEBO_MASTER_IP:11345 && sudo gzclient --verbose
```

Run tests in the base image. Simply enter the following command, all you need is nvidia-docker2 setup:
```
docker run --runtime=nvidia --rm austinderic/gym-gazebo:kinetic-nvidia9.2 /bin/bash -c "nvidia-smi; echo $(rosversion -d); pip show gym; pip show gym-gazebo"
```
Even easier with docker-compose:
```
docker-compose up
```

## Manual Method
```
mkdir -p ./catkin_ws/src
cd ./catkin_ws/src
wstool initW
wstool merge https://raw.githubusercontent.com/turtlebot/turtlebot/kinetic/turtlebot.rosinstall && wstool merge ../../gym-gazebo/gym_gazebo/envs/installation/gym-gazebo.rosinstall
```

75 changes: 75 additions & 0 deletions docker/gym-gazebo-turtlebot/kinetic/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# docker build -t austinderic/gym-gazebo-turtlebot:kinetic
FROM austinderic/gym-gazebo:kinetic
LABEL maintainer "Austin.Deric@gmail.org"

#--------------------
# Install gzweb
#------------------

RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y \
imagemagick \
nodejs \
libjansson-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root
RUN hg clone https://bitbucket.org/osrf/gzweb
WORKDIR /root/gzweb
RUN hg up gzweb_1.4.0
RUN echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc
RUN npm run deploy -m

#--------------------
# Install Gym-Gazebo Turtlebot dependencies
#------------------

RUN apt-get update && apt-get install -y \
ros-kinetic-depthimage-to-laserscan \
ros-kinetic-turtlebot-create \
ros-kinetic-yujin-ocs \
ros-kinetic-yocs-msgs \
ros-kinetic-xacro \
ros-kinetic-roslint \
ros-kinetic-ros-control \
ros-kinetic-image-common \
ros-kinetic-control-toolbox \
ros-kinetic-gazebo-ros-pkgs \
ros-kinetic-roslint \
ros-kinetic-driver-common \
ros-kinetic-navigation \
ros-kinetic-joystick-drivers \
ros-kinetic-kobuki-desktop \
ros-kinetic-kobuki-core \
ros-kinetic-kobuki \
ros-kinetic-kobuki-msgs \
ros-kinetic-ecl \
ros-kinetic-pcl-ros \
libbullet-dev \
libusb-dev \
libsdl-dev \
libsdl-image1.2-dev \
python-skimage \
mesa-utils \
&& rm -rf /var/lib/apt/lists/*

#--------------------
# Install Gym-Gazebo Turtlebot Example
#------------------

RUN mkdir -p /root/catkin_ws/src
WORKDIR /root/catkin_ws/src
RUN wstool init
RUN wstool merge https://gist.githubusercontent.com/AustinDeric/3362c86437d88347807beaba3501602e/raw/ecadfddc98a1865dfe60b29d17ff03a513b39279/gym-gazebo.rosinstall
RUN wstool update
WORKDIR /root/catkin_ws
RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash && catkin build"
RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc
RUN echo "export GYM_GAZEBO_WORLD_CIRCUIT2=/root/gym-gazebo/gym_gazebo/envs/assets/worlds/circuit2.world" >> ~/.bashrc
RUN export GYM_GAZEBO_WORLD_CIRCUIT2=/root/gym-gazebo/gym_gazebo/envs/assets/worlds/circuit2.world
RUN echo "export GAZEBO_MODEL_PATH=/root/gym-gazebo/gym_gazebo/envs/assets/models" >> ~/.bashrc

COPY ./kobuki_description/ /root/gzweb/http/client/assets/kobuki_description/
COPY ./turtlebot_description/ /root/gzweb/http/client/assets/turtlebot_description/

WORKDIR /root/

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# generated from catkin/cmake/template/pkgConfig-version.cmake.in
set(PACKAGE_VERSION "0.7.6")

set(PACKAGE_VERSION_EXACT False)
set(PACKAGE_VERSION_COMPATIBLE False)

if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_EXACT True)
set(PACKAGE_VERSION_COMPATIBLE True)
endif()

if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE True)
endif()
Loading