Inspiration
I am really interested in drone-tech so when I heard that some of the challenges this year could be tackled with a swarm of them I knew what I had to do.
What it does
We create a swarm of simulated drones using ArduPilot as our autopilot and MAVProxy to run the simulation in order to draw images. Using Lua scripts we get the drones to communicate to each other so that they can send and receive local data such as position or what the drone is up to. This allows us to define collision avoidance techniques, task distribution algorithms, and tackle unreliable networking to produce a capable, decentralised swarm. We can pass in any image and Python scripts will convert these into black and white images for which the swarm will draw the dark lines in a "real" world environment. We can monitor the drone behaviour through a visualisation script tracking task completion and where the swarm are performing there job.
How we built it
ArduPilot allows for Lua scripts to run as low priority on top of the autopilot functionality. This allows us to define behaviour and communication in a very lightweight manner. These scripts would sit and run only on the main flight controller should we adapt this to real hardware and so they need to be very resource aware. Python scripts were used for initial image handling and processing into black and white versions. They were also used for the behaviour analysis by accepting drone updates via UDP from the simulation. Drones messages were packaged through the MAVLink protocol which were also passed to one another by UDP broadcast.
Challenges we ran into
Trying to simulate real world communication for which there is usually specialised hardware can be quite a challenge. Certain liberties had to be made to replicate real scenarios in order to test both reliable and unreliable communication (such as a drone losing connection to the swarm temporarily). Further, I had not used this kind of simulation before and so tackling the setup and troubleshooting bugs took longer than I would've liked!
What we learned
I've learned a lot more about Lua and continue my learning in networking. Lots of this information will prove useful in my studies and dissertation project.
What's next for PicasSwarm
With the swarm reliably communicating, there is no shortage of tasks we could assign to the drones. So really, the sky's the limit!
...(pun intended)