This repository contains the Android Studio project, communication scripts and server files for drone request and location-based delivery.
-
A drone that communicates using MAVLink protocol (most vehicles made by 3DRobotics and other members of the DroneCode Foundation)
-
Android Studio installed.
-
DroneKit-Python environment installed. The DroneKit documentation has a quick start tutorial where you can check how to download pip, Python 2.7 and dronekit on your machine. Run the "Hello Drone" script to see if everything is properly installed.
-
Clone this repository on your computer. You can do this by opening the command prompt on your machine and typing:
git clone https://github.com/illinoistech-itm/amf.git
Open Android Studio and go to File > New > Import Project. Select the repository folder that you downloaded with the git clone
command and Android Studio should be able to recognize the build files itself.
Connect your Android smartphone via USB on your computer and hit "Run" on the upper toolbar on Android Studio.
This will install the app on your phone and open it when it's ready. It will ask for permissions to receive your GPS location. Click "Allow".
This step is required every time you make changes on your app, since your mobile device needs to be updated to the latest build.
If you did the Quick Start Tutorial on DroneKit's documentation you should have already installed and tested the tool for creating simulated vehicles (SITL) on your computer. This is needed to test your algorithms on a fake simulated vehicle, instead of a real drone.
To make the tests run on a simulated environment, you need to change a line of code. Open drone.py on the server folder and search for the line that calls the function fleet.request(). Comment that line by typing the character "#" at the start of the line. Delete the "#" character on the line below to uncomment the request to the simulator (fleet.requestSITL()). Save the changes. You need to reverse these to the original form if you want to test on a real drone.
Open your operational system command prompt and type:
dronekit-sitl copter --home=41.8348731,-87.62700589999997,584,353
This will initialize the simulated vehicle at the specified --home
location (Illinois Institute of Technology in this case). You can modify the latitude and longitude parameters to change the start drone location.
Open another command prompt on your machine and go to the server subdirectory located on this project folder. You can change directories on your command prompt by typing cd
followed by the path of the file.
Like this:
cd amf/server
After that, if you are on a Windows machine, type:
py server.py
If you are on a Linux/Mac machine, instead type:
python server.py
This will start the python server on your machine and it will be accessible by making a connection to your IP address.
Open the app and insert your IP address on the upper app menu (you can check this by typing ipconfig
on your command prompt). After that, send an example request to your simulated drone. If everything is set correctly, your drone should arrive at your position, deliver the package and return to its home location.
The original server code (located inside the Server folder) has support only for one drone at a time (by using preconfigured and paired antennas that connect one to one from the PC to the drone), however in case you want to use a single antenna to control a whole fleet of drones, please refer to the code inside the antenna/code
folder. A readme is also included that shows how to run the server and how the system operates.
- Android Studio
- Atom
- Sublime Text
This project is licensed under the MIT License - see the LICENSE.md file for details
- Illinoin Institute of Technology/School of Applied Technology
- Capes (Coordenação de Aperfeiçoamento de Pessoal de Nível Superior)