Gazebo simulator with Hector quadrotor to train for the TIERS drone racing challenge.
The races are later done with a Tello drone controlled via ROS, as part of the master course Perception and Navigation in Robotics.
This instructions are for Ubuntu 18.04 with ROS Melodic already installed.
Clone this repo into your workspace (the code below creates a new catkin workspace named drone_racing_ws
in your home folder):
mkdir -p ~/drone_racing_ws/src && cd ~/drone_racing_ws/src
git clone --recursive https://github.com/TIERS/drone_racing.git
Install dependencies
sudo apt install ros-melodic-geographic-msgs ros-melodic-hector-gazebo-plugins ros-melodic-hector-sensors-*
We also need some Gazebo models that we use for the virtual race scenario. You have two opcions here, download the full Gazebo models database, or just a few that we provide to be able to run this simulations. Either way, first create a folder where Gazebo can find your models:
mkdir -p ~/.gazebo/models
Download Gazebo models database (we actually only use a few of them, this will download the full database with approx. 400MB of basic models):
git clone https://github.com/osrf/gazebo_models/ ~/.gazebo/models
Read more about the Gazebo database here.
Copy to the same folder the models included in this repo (change the path if you cloned the repo somewhere else):
cp -r ~/drone_racing_ws/src/drone_racing/gazebo_models/* ~/.gazebo/models/
We recommend using catkin build
. Install it if needed with
sudo apt install python-catkin-tools
and then run
cd ~/drone_racing_ws
catkin init
catkin build
Build the uav messages with
catkin build hector_uav_msgs
Run the simulator with
source ~/drone_racing_ws/devel/setup.bash
roslaunch tiers_drone_racing hector_dronerace.launch
Start the motors in another terminal window/tab:
source ~/drone_racing_ws/devel/setup.bash
rosservice call /enable_motors "enable: true"
In order to control the UAV with keyboard teleop, install it with
sudo apt install ros-melodic-teleop-twist-keyboard
if you don't have it yet, and run the teleop node in a separate terminal window/tab:
rosrun tiers_drone_racing tello_controller.py
Install the image_view
package:
sudo apt install ros-melodic-image-view
rosrun image_view image_view image:=/camera/rgb/image_raw
For any questions, write to [email protected]
.
Visit us at https://tiers.utu.fi