Skip to content

Latest commit

 

History

History
474 lines (385 loc) · 11.8 KB

INSTALL.md

File metadata and controls

474 lines (385 loc) · 11.8 KB

Table of Contents

Installation

Ubuntu 18.04

Basic requirements

ROS Melodic related dependencies

sudo apt-get install \
python-pip python3-vcstool python3-pyqt4 \
pyqt5-dev-tools \
libbluetooth-dev libspnav-dev \
pyqt4-dev-tools libcwiid-dev \
cmake gcc g++ qt4-qmake libqt4-dev \
libusb-dev libftdi-dev \
python3-defusedxml python3-vcstool \
ros-melodic-octomap-msgs        \
ros-melodic-joy                 \
ros-melodic-geodesy             \
ros-melodic-octomap-ros         \
ros-melodic-control-toolbox     \
ros-melodic-pluginlib	       \
ros-melodic-trajectory-msgs     \
ros-melodic-control-msgs	       \
ros-melodic-std-srvs 	       \
ros-melodic-nodelet	       \
ros-melodic-urdf		       \
ros-melodic-rviz		       \
ros-melodic-kdl-conversions     \
ros-melodic-eigen-conversions   \
ros-melodic-tf2-sensor-msgs     \
ros-melodic-pcl-ros \
ros-melodic-navigation \
ros-melodic-sophus

Install Python Packages:

sudo pip install gym
sudo apt-get install python-skimage
sudo pip install h5py
pip install tensorflow-gpu (if you have a gpu if not then just pip install tensorflow)
sudo pip install keras

Install gym-gazebo

cd ~
git clone https://github.com/erlerobot/gym-gazebo
cd gym-gazebo
sudo pip install -e .

Run bash files, build the ros workspace:

cd gym-gazebo/gym_gazebo/envs/installation
bash setup_melodic.bash

Execution examples

Run example for qlearn:

terminal 1

cd gym-gazebo/gym_gazebo/envs/installation/
bash turtlebot_setup.bash

terminal 2

cd gym-gazebo/examples/turtlebot
python circuit_turtlebot_lidar_qlearn.py
Run example for dqn:

terminal 1

cd gym-gazebo/gym_gazebo/envs/installation/
bash turtlebot_nn_setup.bash

terminal 2

cd gym-gazebo/examples/turtlebot
python circuit_turtlebot_lidar_qlearn.py
Using Neural Networks

This part of the installation is required only for the environments using DeepQLearning.

Keras and Theano installation
# 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
Enablig GPU for Theano

Follow the instructions here and change $PATH instead of $CUDA_ROOT.

Working on a clean installation of Ubuntu 18.04 using CUDA 10.0.

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

Ubuntu 16.04

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

ROS Kinetic dependencies

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 \
libbluetooth-dev libspnav-dev \
pyqt4-dev-tools libcwiid-dev \
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 \
ros-kinetic-ar-track-alvar-msgs
#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"

Gazebo gym

cd 
git clone https://github.com/erlerobot/gym-gazebo
cd gym-gazebo
sudo pip3 install -e .

If successful, expect something like this.

Dependencies and libraries

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

Try it out (turtlebot simple env)

Issues:

  • spacenav_node not compiling. CATKIN_IGNOREd.
  • wiimote not compiling. CATKIN_IGNOREd.
  • kobuki_qtestsuite not compiling. CATKIN_IGNOREd.

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

Ubuntu 14.04

ROS Indigo

Install the Robot Operating System via:

ros-indigo-desktop-full is the only recommended installation.

Gazebo

  • 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

Gym Gazebo Pip

cd 
git clone https://github.com/erlerobot/gym-gazebo
cd gym-gazebo
sudo pip install -e .

Additional dependencies

There are two options to install dependencies: automatic installation or step-by-step installation

Automatic 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
Step-by-step installation

Needs to be updated, use automatic installation.

Keras and Theano 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
Enablig GPU for Theano

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

Docker

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_ID=`docker ps | grep gym-gazebo | awk '{print $1}'`
export GAZEBO_MASTER_IP=$(sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $GAZEBO_ID)
export GAZEBO_MASTER_URI=$GAZEBO_MASTER_IP:11345