CrazySwarm

What’s better than a single Crazyflie? A swarm of them! Over a year ago our research group at the University of Southern California posted a blog post with the title “Towards CrazySwarms“, explaining how to fly six Crazyflies at the same time. Since then, we’ve expanded our fleet to 49 Crazyflies. It turns out that flying 49 requires a completely different approach. We will outline the additional challenges, and of course show a fun video!

Why is flying many Crazyflies hard? It comes down to two different categories:

  1. Communication Limitations: The standard Crazyflie software does not support controlling more than one crazyflie per radio. Putting 49 radios on a PC is possible, but would cause very high latencies because the Universal Serial Bus (USB) operates, as the name suggests, serially in 1 ms intervals. Earlier, we showed that we can share a radio for two Crazyflies by using different addresses, but 25 radios are still too much to be handled on one PC reasonably. We can overcome this issue by reducing the amount of data to be transferred. However, this forces us to increase the autonomy of the Crazyflie. Instead of sending attitude control input for each Crazyflie at a high rate, we move the controller on-board and send high-level trajectory descriptions and external position information at a low-rate. In particular, we need to:
    1. Move the position controller on-board, and
    2. Be able to handle packet losses more gracefully.

    i) is relatively easy, apart from the testing and tuning. For ii) we use an Extended Kalman Filter to estimate the state on-board. This state, consisting of the position, angle, and the translational velocities, is estimated by combining the on-board sensors (gyroscope, accelerometer) with external position information. Even if we are not able to send the external position for a while due to packet drops, the on-board sensors will keep the estimated state correct for a while.
    Finally, we implemented broadcasts (rather than 1-to-1 communication between PC and each Crazyflie) and used a number of compression tricks in order to limit the required bandwidth further. We are able to broadcast the pose (position and rotation) for all 49 Crazyflies using just three Crazyradios 100 times per second. Each Crazyflie can handle several packet drops in a row before the state estimate becomes too unreliable to fly.

  2. External Position Feedback: The on-board sensors of the Crazyflie are not sufficient to determine its position, so we need some external position feedback. In academia, optical motion capture systems are frequently used. They consist of a number of specialized, synchronized, high-speed infrared cameras. Each object to track is equipped with at least three retroreflective spheres (so-called markers), which reflect infrared light sent out by the IR light sources next to the cameras. If we know the pose of all cameras, we can use triangulation to determine the 3D positions of all retroreflective markers.Traditionally, motion capture systems require that each object has a unique arrangement of markers; this allows to determine each object’s position from a single frame of marker data by searching for its unique pattern. Unfortunately,  the Crazyflie is too small to have 49 unique marker arrangements that can be reliably distinguished. To solve that issue, we put the Crazyflies at known positions initially and use their marker arrangement to track their position and pose over time, at 100 Hz. This allows us to use the same marker arrangement for each Crazyflie.

 

Putting that together (combined with an improved controller), allows us to create nice formations:

So what is next? Eventually, we will integrate our changes into the various projects (including the firmwares and the ROS driver), allowing everyone to work on and with CrazySwarms.

Have fun flieing!

Wolfgang Hönig
PhD Student
Automatic Coordination of Teams Laboratory
University of Southern California
James Preiss
PhD Student
Robotics Embedded Systems Laboratory
University of Southern California

6 comments on “CrazySwarm

  • HI Wolfgang,

    I was reading your first blog and realized you have made some advancements. Congrats! Wondering, if this can be done by a hobbyist? I’m not an engineer, but very impressed with your swarm project. Is there a tutorial or a simpler setup you can share? I have two crazy flies I would like to use in swarm formation. Any help would be appreciated :)

    • Hi,
      The first major step is to get position feedback – without that you can’t even fly a single one autonomously. As hobbyist, you could use Bitcraze loco system (which is still in alpha stage), a Kinect, or a plain camera. For all of those, there has been successful reports of at least hovering a single Crazyflie. Once you actually want to follow waypoints, the camera based solutions typically don’t cover a wide enough area to execute interesting trajectories. Bitcrazes loco system is currently limited to a single CF, but could support a swarm with a software update.
      Unfortunately, I am not aware of any step-by-step tutorial; the closest you can get is a single Kinect-controlled Crazyflie, documented here in the blog and the wiki.
      Best,
      Wolfgang

  • Hi Wolfgang,

    This configuration is very impressive, I am currently working on making 2 drones be able to move with relative position to each other. I was wondering how you altered the controller to have the drones move with such precision. Also, do you have any suggestions in creating a demo to allow one drone to move by changing waypoints while the other simply follows by keeping the same original relative distance? Thanks in advance!

  • Hi Emily,
    You can find a paper with details in J. A. Preiss, W. Hönig, G. S. Sukhatme, and N. Ayanian. “Crazyswarm: A Large Nano-Quadcopter Swarm”, in Proc. IEEE International Conference on Robotics and Automation, 2017. A pre-print is available on my labs webpage (act.usc.edu). The code and documentation is on github: https://github.com/USC-ACTLab/crazyswarm.

    For your question: The code comes with an example for waypoint following, but assuming you have waypoints for both drones. The waypoints are “timed”, so you can make sure they stay synchronized.

    Best,
    Wolfgang

Leave a Reply to alden p. wong Cancel reply

Your email address will not be published. Required fields are marked *