/anafi_tools

Anafi tools we use at IRI (Institut de Robòtica i Informàtica industrial) UPC

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

anafi_tools

These tools were used to ease the development and testing of my bachelor thesis on autonomous, social-aware drones. The available tools are based in the Parrot Drone SDK.

If you are using a DJI Tello Ryze drone, check out tello_tools.

Modules

Control

The control module allows to control the drone, either being simulated or not.

  • controller allows to control a real-life Anafi drone.
  • controller_sim allows to control a simulated Anafi drone.

Processing

The processing module contains methods and algorithms that process the data obtained from the drone and the environment. These algorithms usually produce intermediate results and return a final result, commonly the velocity twist used to control the drone.

  • human_tracking
  • object_tracking
  • asfm is the former Aerial Social Force Model that moves the drone with a NN in the background.
  • asfm_recurrent is a sub-module that processes the environment and drone data to train a RNN which moves the drone.

Some of these methods have been previously tested in the Jupyter notebooks found at $root/notebooks, as well as test data at $root/data/test_data.

Streaming

The streaming module contains methods that handles the data streams created either by the simulator or the drone driver.

  • video_streaming_tlm handles the camera streaming from the simulator.
  • video_streaming_drv handles the camera streaming from the drone driver.
  • telemetry handles the simulator stat data stream.
  • sim_objs handles the simulator object data stream, which is non-variant (static).
  • optitrack handles the OptiTrack stat data stream.

Teleop

The teleop module allows to control the drone by using teleoperators. The use for real-life runs can be specified either from the command line or by using flags.

  • joystick allows to control the drone with a Gamepad or Joystick controller.
  • keyboard allows to control the drone with a keyboard.

Take into account that the drone can be controlled with a phone app, but this must be set up in both the simulator and the real-life drone driver.

Utils

The utils module adds up cross-module methods.


Quickstart

Default simulator run

The simulator run is described in the simulator.py source file.

The simulator is built in such a way that it generates a simulated en-vironment, which must be defined following a strict format in a text file,and which is specified when the simulator is launched. During the simu-lation an output text file is generated each time the simulation is updated,which happens at a frequency of 30Hz. The directory where the output ofthe simulator is stored must be specified when it is launched. The simula-tion ends when the condition that ends the simulation (explained below) ismet. Thus, the information generated by a single run of the simulator fora given environment is a directory with as much output files as simulatediterations. Each output file contains the position of all the objects in the en-vironment so that it is possible to compute any distance between any pairof objects, and consequently any interaction force.

Default real-life run

EXCLAIMER: Try to run it in the simulator first

The real-life run is described in the freeflight.py source file.

(used for A*): https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2