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

Commit 2a9a4a0

Browse files
authored
Devel (#1)
WIP
1 parent a371f51 commit 2a9a4a0

File tree

4 files changed

+92
-23
lines changed

4 files changed

+92
-23
lines changed

docker/README.md

+35-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,47 @@ This fodler is setup such that each image has its own folder is an image and eac
88

99

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

14-
Allows running cuda-based nueral nets and render displays from the container.
1513

1614
## Recommended (Easy) Method
15+
```
16+
docker run \
17+
--runtime=nvidia \
18+
-v="/tmp/.gazebo/:/root/.gazebo/" \
19+
--rm \
20+
-it \
21+
-p 11345:11345 \
22+
-p 11311:11311 \
23+
--name=gym-gazebo-turtlebot \
24+
austinderic/gym-gazebo-turtlebot:kinetic-nvidia9.2 \
25+
/bin/bash
26+
```
27+
This will open a bash shell in the container:
28+
```
29+
python ./gym-gazebo/examples/turtlebot/circuit2_turtlebot_lidar_qlearn.py
30+
```
31+
then we can connect to our new container
32+
```
33+
export GAZEBO_MASTER_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' gym-gazebo-turtlebot)
34+
export GAZEBO_MASTER_URI=$GAZEBO_MASTER_IP:11345
35+
sudo gzclient --verbose
36+
```
37+
1738
Run tests in the base image. Simply enter the following command, all you need is nvidia-docker2 setup:
1839
```
1940
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"
41+
```
42+
Even easier with docker-compose:
43+
```
44+
docker-compose up
2045
```
2146

47+
## Manual Method
48+
```
49+
mkdir -p ./catkin_ws/src
50+
cd ./catkin_ws/src
51+
wstool initW
52+
wstool merge https://raw.githubusercontent.com/turtlebot/turtlebot/kinetic/turtlebot.rosinstall && wstool merge ../../gym-gazebo/gym_gazebo/envs/installation/gym-gazebo.rosinstall
53+
```
2254

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM austinderic/gym-gazebo:kinetic-nvidia9.2
2+
LABEL maintainer "[email protected]"
3+
4+
#--------------------
5+
# Install Gym-Gazebo Turtlebot dependencies
6+
#------------------
7+
8+
RUN apt-get update && apt-get install -y \
9+
ros-kinetic-turtlebot-create \
10+
ros-kinetic-yujin-ocs \
11+
ros-kinetic-yocs-msgs \
12+
ros-kinetic-xacro \
13+
ros-kinetic-roslint \
14+
ros-kinetic-ros-control \
15+
ros-kinetic-image-common \
16+
ros-kinetic-control-toolbox \
17+
ros-kinetic-gazebo-ros-pkgs \
18+
ros-kinetic-roslint \
19+
ros-kinetic-driver-common \
20+
ros-kinetic-navigation \
21+
ros-kinetic-joystick-drivers \
22+
ros-kinetic-kobuki-desktop \
23+
ros-kinetic-kobuki-core \
24+
ros-kinetic-kobuki \
25+
ros-kinetic-kobuki-msgs \
26+
ros-kinetic-ecl \
27+
ros-kinetic-pcl-ros \
28+
libbullet-dev \
29+
libusb-dev \
30+
libsdl-dev \
31+
libsdl-image1.2-dev \
32+
python-skimage \
33+
&& rm -rf /var/lib/apt/lists/*
34+
35+
#--------------------
36+
# Install Gym-Gazebo Turtlebot Example
37+
#------------------
38+
39+
RUN mkdir -p /root/catkin_ws/src
40+
WORKDIR /root/catkin_ws/src
41+
RUN wstool init
42+
RUN wstool merge https://gist.githubusercontent.com/AustinDeric/3362c86437d88347807beaba3501602e/raw/ecadfddc98a1865dfe60b29d17ff03a513b39279/gym-gazebo.rosinstall
43+
RUN wstool update
44+
WORKDIR /root/catkin_ws
45+
RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash && catkin build"
46+
RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc
47+
48+
#--------------------
49+
# Setup environment variables
50+
#------------------
51+
RUN echo "export GYM_GAZEBO_WORLD_CIRCUIT2=/root/gym-gazebo/gym_gazebo/envs/assets/worlds/circuit2.world" >> ~/.bashrc
52+
RUN export GYM_GAZEBO_WORLD_CIRCUIT2=/root/gym-gazebo/gym_gazebo/envs/assets/worlds/circuit2.world
53+
54+
WORKDIR /root/

docker/gym-gazebo/kinetic-nvidia9.2/Dockerfile

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
11
FROM austinderic/ros-desktop-full:kinetic-nvidia9.2
22
LABEL maintainer "[email protected]"
33

4-
#--------------------
5-
# Setup nvidia-docker2
6-
#--------------------
7-
# Reference: http://wiki.ros.org/docker/Tutorials/Hardware%20Acceleration
8-
9-
ENV NVIDIA_VISIBLE_DEVICES \
10-
${NVIDIA_VISIBLE_DEVICES:-all}
11-
ENV NVIDIA_DRIVER_CAPABILITIES \
12-
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
13-
144
#--------------------
155
# Install OpenAI gym
16-
#--------------------
17-
18-
RUN apt-get update && apt-get install -y --no-install-recommends \
19-
python-pip && \
20-
apt-get clean && \
21-
rm -rf /var/lib/apt/lists/*
22-
23-
RUN pip install --upgrade pip
6+
#-------------------
247

258
RUN pip install gym
269

gym_gazebo/envs/installation/turtlebot_setup.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ else
3838
fi
3939

4040
#copy altered urdf model
41-
cp -r ../assets/urdf/kobuki_urdf/urdf/ catkin_ws/src/kobuki/kobuki_description
41+
cp -r ../assets/urdf/kobuki_urdf/urdf/ ./catkin_ws/src/kobuki/kobuki_description
4242

4343
#copy laser mesh file
44-
cp ../assets/meshes/lidar_lite_v2_withRay.dae catkin_ws/src/kobuki/kobuki_description/meshes
44+
cp ../assets/meshes/lidar_lite_v2_withRay.dae ./catkin_ws/src/kobuki/kobuki_description/meshes
4545

4646
exec bash # reload bash
4747

0 commit comments

Comments
 (0)