Configuring your environment

We recommended to install Ubuntu 14.04 64 bits.

First at all, install the base packages

sudo apt-get update
sudo apt-get install gawk make git curl cmake -y

Then install the dependencies for MAVProxy

sudo apt-get install g++ python-pip python-matplotlib python-serial python-wxgtk2.8 python-scipy python-opencv python-numpy python-pyparsing ccache realpath libopencv-dev -y

Now, install MAVProxy

sudo pip install future
sudo apt-get install libxml2-dev libxslt1-dev -y
sudo pip2 install pymavlink catkin_pkg --upgrade
sudo pip install MAVProxy==1.5.2

Download and install ArUco.

  1. Download ArUco 1.3.0 from here
  2. Install ArUco
    cd ~/Downloads # Replace this with your Download directory
    tar -xvzf aruco-1.3.0.tgz
    cd aruco-1.3.0/
    mkdir build && cd build
    cmake ..
    make
    sudo make install

The ArduPilot project is an open source autopilot for drones. We'll be using its code to simulate the UAVs:

mkdir -p ~/simulation; cd ~/simulation
git clone https://github.com/erlerobot/ardupilot -b gazebo

cd ~/simulation
git clone git://github.com/tridge/jsbsim.git
# Additional dependencies required
sudo apt-get install libtool automake autoconf libexpat1-dev
cd jsbsim
./autogen.sh --enable-libraries
make -j2
sudo make install

Setup your computer to accept software from packages.ros.org, setup your keys and install (make sure your Debian package index is up-to-date):

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
sudo apt-get update

Install, ROS package, build, and communication libraries. No GUI tools.:

sudo apt-get install ros-indigo-ros-base -y

Initialize rosdep, before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.

sudo rosdep init
rosdep update

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:

echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
source ~/.bashrc

Get rosinstall and some additional dependencies

sudo apt-get    install python-rosinstall          \
                        ros-indigo-octomap-msgs    \
                        ros-indigo-joy             \
                        ros-indigo-geodesy         \
                        ros-indigo-octomap-ros     \
                        ros-indigo-mavlink         \
                        ros-indigo-control-toolbox \
                        ros-indigo-transmission-interface \
                        ros-indigo-joint-limits-interface \
                        unzip -y

mkdir -p ~/simulation/ros_catkin_ws/src

Initialize the workspace

cd ~/simulation/ros_catkin_ws/src
catkin_init_workspace
cd ~/simulation/ros_catkin_ws
catkin_make
source devel/setup.bash

Download these repositories in src:

cd src/
git clone https://github.com/erlerobot/ardupilot_sitl_gazebo_plugin
git clone https://github.com/tu-darmstadt-ros-pkg/hector_gazebo/
git clone https://github.com/erlerobot/rotors_simulator -b sonar_plugin
git clone https://github.com/PX4/mav_comm.git
git clone https://github.com/ethz-asl/glog_catkin.git
git clone https://github.com/catkin/catkin_simple.git
git clone https://github.com/erlerobot/mavros.git
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b indigo-devel
#Add Python and C++ examples
git clone https://github.com/erlerobot/gazebo_cpp_examples
git clone https://github.com/erlerobot/gazebo_python_examples

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 gazebo7

sudo apt-get update
sudo apt-get remove .*gazebo.* '.*sdformat.*' '.*ignition-math.*' && sudo apt-get update && sudo apt-get install gazebo7 libgazebo7-dev drcsim7 -y

Follow this instructions to install Gazebo from source.

Then compile everything together:

cd ~/simulation/ros_catkin_ws
catkin_make --pkg mav_msgs mavros_msgs gazebo_msgs
source devel/setup.bash
catkin_make -j 4

mkdir -p ~/.gazebo/models
git clone https://github.com/erlerobot/erle_gazebo_models
mv erle_gazebo_models/* ~/.gazebo/models