/mavsdk_drone_show

All in one Drone Show and Smart Swarm Solutin for PX4

Primary LanguagePython

PX4 Based Drone Show and Smart Swarm cooperative missions using MAVSDK

Introduction to the Project Welcome to our drone programming project, a wild and ongoing journey from the simple to the complex. We started with basic offboard trajectory following and creating static drone formations in the sky. Over time, we've ramped up to creating multiple dynamic shapes and orchestrating impressive sky drone shows using SkyBrush.

Our attention then turned to developing intelligent drone swarm behaviors based on a multi-level leader/follower model. With every version, we're pushing the envelope, enhancing the world of drone programming and swarm control bit by bit.

And here's the fun part, we're far from done. Every new release peels back another layer, revealing more complexities and pushing our abilities further. We're pretty stoked about what's coming up and we hope you're too!

We've built this project hoping it'll make a dent in the drone programming universe, enabling anyone to create breathtaking drone shows and foster a community where we share, learn, and grow together.

We encourage you to check out our previous versions to get a feel for our journey so far. And hey, we absolutely love hearing from you all - your thoughts, ideas, questions - bring 'em on! They fuel our drive to keep pushing. Enjoy exploring and happy coding!

Version 0.8: Major GUI Improvements and Enhanced Swarm Intelligence

In version 0.8, we have made significant improvements to the GUI and drone dashboard, which is a web-based React application. We have also introduced smarter and smoother drone swarm behaviors using a Kalman Filter implementation.

follow the step-by-step instructions to run this version.

New Features:

  • Visually create/manage/import/export mission config file
  • Visually create/manage/import/export swarm file
  • Auto check for any position or config mismatch
  • Auto convert SkyBrush CSV zip files to MAVSDK drone show template
  • Docker optimization for running all your SITLs in the cloud in a few minutes
  • MAVLink router installation script (only needed when running in the cloud)
  • Auto startup scripts

Improvements:

  • Huge improvements in GUI and drone dashboard
  • 3D environment improvement for multi drones
  • Improved command handling to ensure each drone receives command
  • Kalman Filter implementation for smarter and smoother drone following
  • Many minor improvements and bug fixes

Known Bugs:

  • Sometimes you need to refresh the page when a new drone is added to the system
  • If relaying the MAVLink commands from the cloud, sometimes QGroundControl won't send
  • When starting a swarm mission, you can no longer send any commands through the dashboard
  • Docker Image for Drone Instance: Download Here
  • Demo Video: Coming Soon (Placeholder for YouTube link)

As always, we welcome your feedback, suggestions, and contributions!

Version 0.7: React GUI for Swarm Monitoring & Real-World and SITL Environment Scenario Automization Improvements

In version 0.7, we have implemented a React-based graphical user interface (GUI) for real-time drone swarm monitoring. This allows for an intuitive centralized dashboard to track and command multiple drones in a swarm.

Additionally, we have further optimized and automated the PX4 Docker environment startup and configuration. These improvements enhance the user experience and streamline swarm orchestration.

New Features:

  • Implemented React GUI for real-time swarm monitoring
  • Automated PX4 Docker and virtual machine environment startup and configuration
  • Automized scenario with startup scripts both for SITL environment and Real Drone Hardware
  • Optimized codebase and fixed bugs
  • Added documentation

As always, we welcome your feedback, suggestions, and contributions!

Version 0.6: Enhanced Complex Leader/Follower Swarm Control & Docker-Based SITL

As we progress in our drone programming journey, version 0.6 of our project brings more advanced features and improvements, with enhanced swarm control and dockerized SITL demonstrations. In this release, we aim to increase efficiency and automation in managing larger numbers of drones with complex mission dynamics. The demonstration of these features can be found in the link to the YouTube video below.

Changelogs:

  • Improved CDH subsystem, telemetry, and command handling for supporting a larger number of drones
  • Optimized main code and transitioned structures to classes
  • Fixed bugs for smoother operations
  • Automated mav_sys_id and hwID file generation
  • Enabled Docker instances auto-creation for each drone
  • Automatic initialization of each instance for user-friendly operation
For demonstrations, we've run two demos:
  • 1. Single group, single leader 11 followers with a fixed layout arrangement.
  • 2. Three groups, three leaders, each group has three followers maintaining a fixed layout, and each group can be controlled independently.
Docker Image Backupfile. You can import it easily using Portainer and create drone instances from that. It includes PX4 SITL, JMAVSIM, Gazebo, MAVLink Router,mavsdk, Mavsdk_drone_show , ...
https://www.mediafire.com/file/g9m5gyx4ru8ndzv/drone-template-1.tar/file

Version 0.5: Implementing Leader Follower Swarm Mission

In this release, we're stepping beyond simple drone shows and implementing real drone swarm capabilities, like leader/follower missions, using PX4 and MAVSDK in Python. v0.5 introduces the following features and improvements:

v0.5 Changelogs:
  • Node-to-node telemetry and communication using the new CDH subsystem
  • Added swarm.csv to arrange our swarm mission prototype
  • Improved ground station data handling and reporting
  • Improved coordinator app and bug fixes
  • Improved logging and debugging capabilities
  • Improved Threads management in Coordinator App
  • Improved error reporting and handling
Limitations in v0.5
  • I haven't implemented considerations for telemetry and command acknowledgment yet. will be implemented soon.
  • No Smoothing and Estimation algorithm for the following setpoints has been implemented yet. will be quickly implemented.
We're excited to continue developing this project and exploring the possibilities of drone swarm intelligence. As always, we welcome collaboration, suggestions, and questions from the community.

Version 0.4: Advanced Swarm Control and Feature Enhancements

In version 0.4, we've made some major enhancements that will significantly improve the capabilities of our Drone Show system:

  • Coordinator.py: This Python script acts as the conductor of our drone orchestra, managing a host of tasks:

    • Synchronizes each drone's system time with a global clock.
    • Downloads the configuration file (config.csv) from our web server to ensure that each drone follows the most up-to-date flight plan.
    • Initiates the MAVLink-router (please ensure to download and install it separately from here).
    • Manages MAVLink routing between serial, UDP, GCS, and the Swarm Control app.
    • Generates telemetry packets about the state of each drone, which are sent to the Swarm Control app.
    • Listens to command packets from the ground station, which set a future trigger time for coordinated show starts.
  • Debug_gcs_test.py: This Python script provides the interface for ground control, with the following responsibilities:

    • Listens to telemetry from all drones, decoding and displaying the packets in real time.
    • Can initiate a "trigger" command, setting a future timestamp for each drone and altering their states for coordinated maneuvers.
    • While currently a command-line app, it is designed with a future graphical user interface (GUI) in mind.
  • Multi-Drone Testing: To demonstrate the system's capabilities, we've configured a four-drone test. Each drone operates on its own VMware node with individual PX4 SITL instances running in JMAVSim. Meanwhile, the ground station (Swarm Control app) runs on a Windows system, receiving telemetry from all drones and issuing commands.

  • Bug Fixes and Documentation: Various bugs identified in previous versions have been fixed, and we've added substantial documentation to help users understand the functionality better and resolve potential issues.

    Version 0.3: Enhanced Drone Show Control and Optimizations

    With the new v0.3 update, we have made significant improvements and added several new features:

    • Skybrush CSV Processing: We've added the ability to process Skybrush CSV files and convert them into our template. This feature also includes creating acceleration and velocities for improved path following. A detailed video tutorial for this is available on our YouTube channel .
    • YouTube Tutorial on "Using Sky Brush and Blender for PX4 MAVSDK Drone Shows: Improving our Drone Show Project"
    • Coordinator.py: This new script manages and times the mission and state telemetry, enhancing the control of the drone show.
    • Merged Control Files: We have merged the multiple and single, as well as real and simulation mode control files for a more streamlined user experience.
    • Code Optimization: The code has been optimized for better performance and readability.
    • Bug Fixes: Various bugs have been identified and resolved in this update.

    As always, exercise caution and ensure you have the necessary expertise before using offboard mode in a real-world setting. Happy drone programming!

    Introduction:

    MAVSDK (MAVLink SDK) is a powerful tool for interacting with drones using the MAVLink communication protocol. This tutorial focuses on the offboard mode in PX4, which enables external systems to directly control a drone's position and velocity. Offboard mode allows for autonomous flight and finds applications in research, development, and testing scenarios.

MAVSDK Documentation

Prerequisites:

To run the code and follow along with the tutorial, ensure that you have the following prerequisites in place:

  • Python: Install Python and the required dependencies for running the scripts.
  • PX4 Development Environment for SITL: Set up a PX4 Software-in-the-Loop simulation environment on either Ubuntu or WSL-2. For detailed instructions, refer to the tutorial available on our YouTube channel.
  • MAVSDK: Install MAVSDK, which provides the necessary libraries for communication with the drone. Detailed installation and setup instructions can be found in our MAVSDK tutorial video on YouTube.
  • MAVLink-router (please ensure to download and install it separately from here .

Note: When using offboard mode with a real drone, it is essential to have a companion computer (such as a Raspberry Pi) onboard the drone or a reliable telemetry system. Please exercise caution and ensure you have the necessary expertise and understanding of offboard mode before attempting to use it with a real drone. Consider safety measures and be prepared for failsafe scenarios.

Tutorial Highlights:

In this tutorial, we will guide you through a simulated environment using SITL PX4 in Gazebo. The demonstration includes a single drone performing captivating shapes such as circles, squares, hearts, and even a helix. While the current implementation in MAVSDK may not provide the same level of performance as using MAVROS with feedforwarded accelerations, this tutorial serves as an educational starting point for understanding offboard control.

Make sure to check out the complete code, resources, and sample CSV files in our GitHub repository. Additionally, we invite you to subscribe to our YouTube channel for more exciting tutorials and drone-related content.

Useful Tutorials:

Usage:

Follow the YouTube Tutorial for this project:

You can use csvCreator.py to create different shape setpoints. active.csv and a screenshot of the drone's 3D trajectory will be saved to the shapes folder. The next step is to run offboard_from_csv.py and see the drone following the actions.

Disclaimer:

Using offboard mode with a real drone involves risks and should be approached with caution. Understand the safety implications, consider failsafe scenarios, and ensure you have the necessary expertise before using offboard mode in a real-world setting.