Decentralize Collision avoidance system for swarm drones using ESP32

I have developed a simple collision avoidance system for swarm drones using only ESP32 as the required hardware. This project draws most of its inspiration from this research paper.

Overview

This avoidance system utilizes ESP-NOW in broadcast mode to communicate with other drones. The avoidance algorithm is based on the Velocity Obstacle method. When a neighboring drone is detected nearby, the drone’s response differs based on whether it is running PX4 or ArduPilot.

Ardupilot
Initially, the drone downloads the mission list uploaded to it. Using this mission list, the avoidance algorithm updates its target destination variable. If an avoidance action is triggered, the drone switches to GUIDED mode, allowing the algorithm to take control and send avoidance velocity commands based on stored information about other aircrafts’ locations and velocities.

If any waypoints are reached while in GUIDED mode, the system updates the mission sequence accordingly before switching back to AUTO mode.

PX4
For PX4-based drones, the algorithm utilizes the TRAJECTORY_REPRESENTATION_WAYPOINTS message to manipulate the vehicle’s velocity in any mode. Unlike ArduPilot, no mode switching is required. To enable this functionality, the parameter COM_OBS_AVOID must be set.

Concept Implementation

For this implementation, I used:

  • 2 CubeOrange controllers running Software-In-The-Loop (SIH)
  • 2 ESP32 modules for telemetry
  • 2 ESP32 modules running this project

Demo Videos
https://youtu.be/YQ1cisuaNSk
https://youtu.be/T8civhjS71A

you can also wirte your own algorithm in this function of the code

void computeTotalVelocity(const Agent& currentAgent, const std::vector<Agent>& neighbors, double& total_vx, double& total_vy, double& total_vz)

Note: This system has never been field tested. If you choose to use it, please proceed with caution. also this system need lot of work in ardupilot integration and avoidance algorithm part

GitHub: GitHub - WCjai/DCATS at DCAT-Ardupilot

4 Likes