Qualisys Drone SDK
qfly | Qualisys Drone SDK is a Python library to track and fly drones with Qualisys motion capture systems. It is is designed to be an entry point for students, researchers, engineers, artists, and designers to develop drone applications.
STATUS: DEV PREVIEW :: Development and testing is ongoing for many features. For bug reports, feature requests, and other contributions, please use Issues.
qfly is architected as a concurrent wrapper running the Qualisys Python SDK together with Python libraries for popular drone platforms like Bitcraze Crazyflie and Robomaster TT. It dramatically reduces the software development workload for real-time drone control, compared to using these libraries vanilla form. For creative applications like drone shows, light painting, and cinematography, movements can be easily programmed by non-engineers using principles of keyframe animation. For interactive applications like games and exercise, qfly is able to ingest signals and control drones in real time.
Various safety, stability, and convenience measures are built in, including:
- speed limits
- smooth takeoff and landing
- interrupt and land
qfly can control swarms comprising an arbitrary combination of drones, e.g. Bitcraze Crazyflie and Ryze Tello EDU drones can be flown together. The maximum number of drones in the swarm depends on limitations of the drone's software and electronics as well as fleet management practicalities.
- Python 3.10 or equivalent
- Python packages (install using pip):
qfly has been designed and tested on Windows. It may or may not work on other operating systems.
To install qfly DEV PREVIEW:
- Clone the qfly source code to your local machine.
- Navigate to the package root directory and install the qfly package in "development mode" by running:
python -m pip install -e .
Drone Platforms and Example Scripts
- Bitcraze Crazyflie 2.1
- For tracking: For best results, we recommend the Active Marker Deck. Alternatively, a Motion Capture Marker Deck is available. Markers can also be mounted on the drone by hand.
- Install drivers for both Crazyflie and the Crazyradio dongle using Zadig following Bitcraze's instructions.
- This can be done over the Crazyradio (requires you to know the current radio address, see Bitcraze docs) or over USB (requires Crazyflie driver, see above).
To fly multiple drones, assign different radio addresses to them using the Crazyflie PC client. (Refer to "Firmware Configuration" in the Crazyflie PC client docs.) This can be done over the Crazyradio (requires you to know the current radio address, see Bitcraze docs) or over USB (requires Crazyflie driver, see above).
Before takeoff with the Crazyflie, always place the drone flat on the floor, with its front pointing in the positive x-direction of the QTM coordinate system.
In case of emergency, press
Cin the terminal window to terminate the program.
White running the example scripts, Press
Escto stop the program and attempt to calmly land the drone.
The swarm scripts have so far been tested with 4 drones. They may or may not work with more drones. Testing with larger swarms is in progress.
This script demonstrates a basic scenario using the Qualisys motion capture system to control the flight path of a Crazyflie. The script commands the Crazyflie to:
- Take off and hover at the center of its airspace
- Circle around the Z axis
- Circle around the Y axis
- Circle around the X axis
- Come back to center, land carefully
The drones take off and fly circles around Z axis.
This script demonstrates real-time interactive control of a Crazyflie, coupling the drone's flight to the position of another drone equipped with an Active Marker Deck.
The drone flies along the YZ plane while centered at 0 along the X plane. The Y and Z coordinates track the second Crazyflie.
This script demonstrates real-time interactive control of a Crazyflie, coupling the drone's flight to the position of a Qualisys Traqr.
The drone flies along the YZ plane while centered at 0 along the X plane. The Y and Z coordinates track the Traqr.
This script demonstrates real-time interactive control of a Crazyflie swarm, coupling the drones' flight to the position of a Qualisys Traqr.
The drones take off and fly circles around Z axis. The altitude (z) tracks the Traqr. ESC to land at any time.
Resources and Inspirations
- Tutorial on Building Interactions with the Bitcraze Crazyflie and Motion Capture by Mehmet Aydın Baytaş
- Fun project: Santa's Flying Helpers by Bitcraze
- Overview of different positioning systems you can use with the Bitcraze Crazyflie
- Notes on the design of Drone Chi, a meditative human-drone interaction experiment by Joseph La Delfa
The auto-generated documentation needs to be rebuilt using pdoc3 following code contributions. To re-generate the documentation files and place them correctly into the
docs/ folder that is served to the web, use the commands in Windows:
del docs\*.html pdoc qfly --force --html --output-dir docs move .\docs\qfly\* .\docs\
Expand source code
# # "qfly" # Qualisys Drone SDK # # Copyright (C) 2022 Qualisys AB # # include README to auto-generate documentation with pdoc """ .. include:: ../README.md """ from .crazyflie import QualisysCrazyflie from .deck import QualisysDeck from .pose import Pose from .qtm import QtmWrapper from .traqr import QualisysTraqr from .world import World from .parallel_contexts import ParallelContexts