Build/fetch the container:
docker pull erlerobotics/gym-gazebo:latest # to fetch the container
# docker build -t gym-gazebo .
Enter the container
docker run -it erlerobotics/gym-gazebo
If you wish to run examples that require plugins like cameras, create a fake screen with:
xvfb-run -s "-screen 0 1400x900x24" bash
If you have an equivalent release of Gazebo installed locally, you can connect to the gzserver inside the container using gzclient GUI by setting the address of the master URI to the containers public address.
export GAZEBO_MASTER_IP=$(sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' "id of running container")
export GAZEBO_MASTER_URI=$GAZEBO_MASTER_IP:11345
gzclient
Basic requirements:
- ROS Kinetic (
/rosversion: 1.12.7
) - Gazebo 8.1.1
- Python 3.5.2
- OpenCV3, installed from sources for Python 3 (
git clone https://github.com/Itseez/opencv.git
) - OpenAI gym
sudo pip3 install rospkg catkin_pkg
sudo apt-get install python3-pyqt4
sudo apt-get install \
cmake gcc g++ qt4-qmake libqt4-dev \
libusb-dev libftdi-dev \
python3-defusedxml python3-vcstool \
ros-kinetic-octomap-msgs \
ros-kinetic-joy \
ros-kinetic-geodesy \
ros-kinetic-octomap-ros \
ros-kinetic-control-toolbox \
ros-kinetic-pluginlib \
ros-kinetic-trajectory-msgs \
ros-kinetic-control-msgs \
ros-kinetic-std-srvs \
ros-kinetic-nodelet \
ros-kinetic-urdf \
ros-kinetic-rviz \
ros-kinetic-kdl-conversions \
ros-kinetic-eigen-conversions \
ros-kinetic-tf2-sensor-msgs \
ros-kinetic-pcl-ros \
ros-kinetic-navigation
#Install Sophus
cd
git clone https://github.com/stonier/sophus -b release/0.9.1-kinetic
cd sophus
mkdir build
cd build
cmake ..
make
sudo make install
echo "## Sophus installed ##\n"
git clone https://github.com/erlerobot/gym-gazebo
cd gym-gazebo
sudo pip3 install -e .
If successful, expect something like this.
sudo pip3 install h5py
sudo apt-get install python3-skimage
# install Theano
cd ~/
git clone git://github.com/Theano/Theano.git
cd Theano/
sudo python3 setup.py develop
#install Keras
sudo pip3 install keras
Issues:
spacenav_node
not compiling.CATKIN_IGNORE
d.wiimote
not compiling.CATKIN_IGNORE
d.kobuki_qtestsuite
not compiling.CATKIN_IGNORE
d.
Agent dependencies:
cd gym_gazebo/envs/installation
bash setup_kinetic.bash
Run the environment with a sample agent:
cd gym_gazebo/examples/scripts_turtlebot
python circuit2_turtlebot_lidar_qlearn.py
Install the Robot Operating System via:
ros-indigo-desktop-full is the only recommended installation.
- Ubuntu: http://wiki.ros.org/indigo/Installation/Ubuntu
- Others: http://wiki.ros.org/indigo/Installation
- Setup your computer to accept software from packages.osrfoundation.org:
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
- Setup keys:
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
- Install Gazebo:
sudo apt-get update
sudo apt-get remove .*gazebo.* && sudo apt-get update && sudo apt-get install gazebo7 libgazebo7-dev
git clone https://github.com/erlerobot/gym-gazebo
cd gym-gazebo
sudo pip install -e .
There are two options to install dependencies: automatic installation or step-by-step installation
Install dependencies running setup_indigo.bash. If you are going to use DQN with Keras, also install Keras and Theano.
cd gym_gazebo/envs/installation
bash setup_indigo.bash
Before running a environment, load the corresponding setup script. For example, to load the Turtlebot execute:
- Turtlebot
cd gym_gazebo/envs/installation
bash turtlebot_setup.bash
Needs to be updated, use automatic installation.
This part of the installation is required only for the environments using DQN.
# install dependencies
sudo apt-get install gfortran
# install sript specific dependencies (temporal)
sudo apt-get install python-skimage
# install Theano
git clone git://github.com/Theano/Theano.git
cd Theano/
sudo python setup.py develop
#isntall Keras
sudo pip install keras
dot_parser error fix:
sudo pip install --upgrade pydot
sudo pip install --upgrade pyparsing
Follow the instructions here and change $PATH instead of $CUDA_ROOT.
Working on a clean installation of Ubuntu 14.04 using CUDA 7.5.
The following flags are needed in order to execute in GPU mode, using an alias is recommended.
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32