Skip to content

Drone navigation and collision avoidance Gazebo

Notifications You must be signed in to change notification settings

s3rgiux/DroneETF

Repository files navigation

Autonomous drone

Mirai logo

Requirements

  • ROS Melodic
  • Python 2.7
  • MAVproxy 1.8
  • Pymavlink 2.4
  • Dronekit 2.9
  • Dronekit-sitl 3.3
  • OpenCV Contrib
  • Ardupilot: cloned from the repository and followe the instructions. Link to Ardupilot page.

Plugins

Gazebo world downloaded from Ardupilot page.

Gazebo

At the path ~/ardupilot_gazebo/models/, there is a folder called iris_with_ardupilot. Change this folder with the one in this repository (make sure this files are also in the path /usr/share/gazebo-9/models) and add the gimbal_2d, lidar_h, lidar_v and aruco folders to get the model with lidar and camera.

At the path ~/ardupilot_gazebo/worlds/, we need to create a world file. This file is attached to this repository.

ROS

Remember create a catkin workspace and a ROS package. This files are already include in this repository. Nevertheless, don't forget to source your package and workspace with nano ~/.bashrc.

At the path /opt/ros/melodic/share/gazebo_ros/launch we need to create a launch file for our world. This file is attached to this repository.

MAVROS and rqt

To get the ROS topics from MAVlink we need to instal MAVROS. Follow the steps from the Ardupilot page. (Already done in this repository)

YOLO

Follow instructions for YOLO in ROS by ETH Zurich. NOTE: this only works with a Nvidia graphics card and CUDA enabled.

How to run

  1. In one terminal...
# For run only Gazebo
$ gazebo --verbose worlds/drone.world
# For Gazebo with ROS
$ roslaunch gazebo_ros drone_world.launch
  1. In a new terminal...
$ cd ~/ardupilot/ArduCopter
$ sim_vehicle.py -f gazebo-iris --console --map
  1. In a new terminal...
$ cd ~/Drone_EFT/src/ros_drone_node/launch
$ roslaunch apm.launch
  1. In a new terminal...
$ cd ~/Drone_EFT/src/src/darknet_ros/darknet_ros/launch
$ roslaunch darknet_ros.launch
  1. In a new terminal...
# Search for Visualization -> Image View and select the topic /detected_markers
$ rqt
  1. In a new terminal...
# Using rosrun
$ cd ~/Drone_EFT/src/ros_drone_node/scripts
$ rosrun ros_drone_node ros_main.py
# Using dronekit
$ cd ~/Drone_EFT/src/ros_drone_node/scripts
$ python main.py --connect 127.0.0.1:14550

Resources

Reference images

Added code lines to bash: Image of bash

TODO

  • Dronekit code
  • Gazebo connected to Ardupilot
  • Drone moving in Gazebo environment
  • Add camera and lidar to drone model
  • Connect with ROS
  • Visualize camera view and lidar raw data
  • Create ROS code
  • Collision avoidance algorithm
  • OpenCV algorithm

##Creator

  • Domenico Morales

##Support

  • Sergio Reyes