Skip to content

Installation Guide

EdwardGao edited this page Apr 15, 2017 · 4 revisions

Install ros-kinetic-desktop-full:

follow the guide in http://wiki.ros.org/kinetic/Installation/Ubuntu to install ros kinetic

Install gazebo-7.5.0:

follow /alternative installation/ in http://gazebosim.org/tutorials?tut=install_ubuntu&cat=install to install gazebo7. The required gazebo version is gazebo7.5.0 or latter.

Install PX4 toolchain:

  1. follow the instructions in /Install/ section to install the toolchain(https://dev.px4.io/starting-installing-linux.html).
  2. Execute the following commands in your working directory.If the toolchain is successfully installed, the gazebo simulator would be launched with an iris model.
$ git clone https://github.com/PX4/Firmware.git
$ cd Firmware; checkout v1.5.5 -b v1.5.5
$ git submodule update --init --recursive
$ make posix_sitl_default gazebo

setup catkin workspace:

Use the following steps to setup your catkin workspace.

cd ~
mkdir -p catkin_ws/src
cd catkin_ws/src
catkin_init_workspace
cd ..
catkin_make
echo 'source ~/catkin_ws/devel/setup.bash' >> ~/.bashrc
source ~/.bashrc

Install necessary ROS Packages

sudo apt install ros-kinetic-mavros ros-kinetic-mavros-extras ros-kinetic-rosjava -y

Get the simulation source code

Clone the 'simulation' repository to the catkin workspace source directory. Update the submodules with git submodule update --recursice --init.

Setup necessary environment variables

In ~/.bashrc, add the following lines.~/workspace/Firmware is the example PX4 firmware source code path. Replace this path with the actual path of the source code on your machine.

export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/workspace/Firmware
source ~/workspace/Firmware/Tools/setup_gazebo.bash ~/workspace/Firmware ~/workspace/Firmware/build_posix_sitl_default

Build the simulation source code

run catkin_make in the catkin workspace ~/catkin_ws

Run the simulation

Try to run the demo of the simulation with the following commands.

rosrun launcher run_swarm.sh demo

After a while, a gazebo window would be prompted. type the following command to start the simulation.

rosservice call /drone1/navigator/ControlInterface start
rosservice call /drone2/navigator/ControlInterface start
rosservice call /drone3/navigator/ControlInterface start
rosservice call /drone4/navigator/ControlInterface start