SWARM Formations

Discussions about autonomous flight in general, regardless of positioning method
Posts: 7
Joined: Sun Nov 23, 2014 6:17 pm

Re: SWARM Formations

Post by vivekrk44 » Wed Oct 07, 2015 1:41 pm

Hello Wolfgang

Thank you soo much for taking the time out to help me.

a. The logging was disabled. I did not know about the parameter, but i had commented out the section of the code that did the logging. When i enabled it i saw that the IMU data is received at around 95Hz. When i ran 2 crazyflies with the same radio i still got 95Hz on each instance. I kept the logging on and ran the system once, but the performance did not degrade, I ran 4 together and the performance was quite good.

b. I did notice a big improvement when i changed the channels to over 100. The channels im using are 112, 117 and 123.

Still the performance is not good enough to follow a trajectory.

Regarding the ACK, the red and green lights blink on the radio, and i get this message on the terminal
Dont know ack: Port: 15 Channel: 3 Len: 1

It seems like it is getting an ack but not the right one. I noticed this after upgrading the nrf51 fw on the cf2 to allow me to change the address.

Edit - I triple checked the mocap's performance and it is fine. I went through rosbag to see what was happening and could only conclude the problem was the radio. In one instance the cf was going towards a wall in front of it, i.e pitching forward, but the cmd vel had linear.x as -15 continuously and it did not affect the motion. The previous messages were -15 and the ones following it were -15. So this shows it did not receive the message.

Edit 2 - I noticed another weird behavior. I am running the system with 3 cfs now. Each one has its own dedicard crazyradio pa. Each with its own channel and address. When the multi hover program starts i give the takeoff command to cf# 2. That hovers in its place perfectly. Then when i give command to cf# 1 to start then the performance drops. If i start cf# 3 as well then its performance is still bad. One will occasionally drift off and then come back in place. So maybe it is not a radio issue. Could be something to do with the controller ? Checked the mocap data again with all 6 quads being tracked and it was perfect.


Posts: 327
Joined: Mon Oct 27, 2014 2:55 am

Re: SWARM Formations

Post by whoenig » Thu Oct 08, 2015 12:07 am

Hi Vivek,

You don't need to worry about the warning ("Dont know ack: Port: 15 Channel: 3 Len: 1"). I believe that is simply not implemented in the ROS driver (according to the documentation it has something to do with the link layer: https://wiki.bitcraze.io/projects:crazy ... m_protocol).

In your last experiment (edit2): How bad is the ratio between red and green of the radio? If you launch the second CF, does the ratio suddenly become worse (i.e. do you see more red)?

I don't think that the controller is an issue, if it works fine for a single CF? The controllers run independently from each other in their own thread. If a single CF is fine (also test with external disturbance by pushing the CF a little bit), then multiple ones should as well.

Another thing: Do you run ROS natively or do you use a Virtual Machine? I noticed that VMs introduce significant USB latency causing the performance to drop.
Furthermore try to have the different Crazyradios at different positions (e.g. using a USB extension cable).

How close are the different CFs to each other? You need at least 1m pairwise distance, otherwise the disturbance between each of them is too big.

If that doesn't help, we would need to look at packet statistics (i.e. how many packets are actually acknowledged, latency between en-queued and acknowledged, RSSI). There is no code for that yet, but it would be fairly easy to add.


Posts: 9
Joined: Tue Mar 03, 2015 3:34 am

Re: SWARM Formations

Post by quadsRfun » Thu Oct 15, 2015 11:31 am

vivekrk44 wrote:Hello All
I am working on a quadcopter based swarm project for my college thesis. I am running the crazyflie as a controller for a bigger quad. I need to run 6 in swarm. So far I have tuned the quadcopter pid's and am getting very good position hold with one quad.
As soon as i add multiple quads the performance degrades. My setup is as follows

CF1 - ID - e7e7e7e701, chan - 80, Data Rate - 2M, Radio# - 0
CF2 - ID - e7e7e7e702, chan - 80, Data Rate - 2M, Radio# - 0
CF3 - ID - e7e7e7e703, chan - 20, Data Rate - 2M, Radio# - 1
CF4 - ID - e7e7e7e704, chan - 20, Data Rate - 2M, Radio# - 1

Even running 2 degrades performance, whether it be using time slicing or multiple radio's. Running 3 makes the performance terrible.
Running 4 together always ends in a crash.

I am using ros as the base, running http://wiki.ros.org/crazyflie to communicate with the cf's

I am using optitrack flex 13 mocap system. There is no problem with the positioning. Confirmed with rosbag(data recording tool). I even reduced the frequency of the controller to 25Hz for each quad. Still the outcome is the same.

I checked all sources of data and the likely conclusion was that the system was not responding to commands. I was going through my rosbag and saw the command given to the cf was to pitch forward but it kept piching backward (concluded from the pose ) and crashed into the wall. So what i assume is that the crazyflie is not receiving the command. Either it is not being sent or it is not recieved.

Since the distance from the Cf Radio PA and the quads dont excede 4 meters, im leaning towards the idea of not sending pate due to some threading issue.

Could someone help me out with this issue ?

Hi Vivek,

Just wondering how did you get two radios to operate on the one computer?

Thank you


Posts: 7
Joined: Sun Nov 23, 2014 6:17 pm

Re: SWARM Formations

Post by vivekrk44 » Mon Nov 30, 2015 2:35 pm

To get multiple crazyradios working on the same desktop, I was using the crazyflie ros stack. If you are not using ros, then the other alternate was to use the radio multilink branch of the crazyflie python client. Then you can change the URI for the crazyflie to reflect which radio you want to use

If you need a detailed explaination, do let me know


Posts: 11
Joined: Mon Nov 23, 2015 7:10 am

Re: SWARM Formations

Post by geffaelden » Tue Feb 16, 2016 3:49 am

whoenig wrote:We have been using up to 6x Crazyflie 2.0 using a VICON motion capture system (see e.g. https://www.youtube.com/watch?v=gH1Fcf597So). There have been a bunch of issues which are mostly fixed in the master branches:
* different CFs need to have different addresses (that way you can reuse a radio without using different channels). This was recently made possible by changes in the client, nrf, and stm firmwares (originally developed in our lab, but now part of the official repository).
* You can still have only up to 3 CFs per radio (otherwise you get latency issues). Bitcraze is actually working on an improved firmware of the Crazyradio to address the issue. Different radios should operate on different channels.
* You can find a multi-CF enabled ROS driver here: http://wiki.ros.org/crazyflie. The driver was developed in our lab and is maintained by me. There is also a controller which allows you to go to given waypoints, as well as automatic take-off, landing, and safety-shutoff features using a joystick. There are more features (and documentation) planned for the summer months for our package. Please make sure to cite our work if you use it in any publication though.

If you have more questions feel free to ask here, by PM, or email.

Wolfgang Hoenig
Automatic Coordination of Teams Lab
University of Southern California

Good day! I see that you are using a motion capture system. May I ask how you place the markers on the quadrotor and how many markers per quad? Thanks

Posts: 327
Joined: Mon Oct 27, 2014 2:55 am

Re: SWARM Formations

Post by whoenig » Wed Feb 17, 2016 8:39 am

I use a 3D printed frame (similar to those protective frames) and place the markers on top of the frame. I use 5 small (6.4mm) markers per Crazyflie.

Posts: 5
Joined: Mon Mar 27, 2017 12:37 am

Re: SWARM Formations

Post by dinglei » Thu May 04, 2017 12:42 am

Now,I want to do collaborative research with my colleagues by the Crazyflie2.0. I am using the optitrack system and ros package mocap_optitrack.The problem is that it can not communicate with three or more Crazyflie2.0。Can you give me some advice and solutions? Also, you can tell me some collaborative control studies and cases by the Crazyflie2.0。Thank you very much!

Fazal Khan
Posts: 3
Joined: Tue Sep 19, 2017 7:59 am

Re: SWARM Formations

Post by Fazal Khan » Sun Oct 01, 2017 12:42 pm

Hi All,

I am working on my master studies project for 8 quadcopter swarm formation. I want to know, is it possible to develop swarm formations using loco positioning system [not using motion capture system like Vicon]. What would be the challenges to deal with in communication problem with this number of agents. Sorry, if you guys didn't understand my question as I have just pursued this area and don't know much about wireless communications.

I am thinking of broadcasting positions coords. of CFs through Crazyradio from host (computer/microcontroller)to all CFs in swarms. All CFs will compare its current coords. with desire received coords. and position themselves accordingly.

Also which IDE can we use for firmware development?



Posts: 2275
Joined: Tue Feb 06, 2007 12:36 pm

Re: SWARM Formations

Post by arnaud » Wed Oct 04, 2017 8:30 am

Hi Fazal,

For flying that many Crazyflie you will need to use the experimental TDoA mode of the LPS. With LPS the position of the Crazyflies is calculated withing the Crazyflie so the radio situation is better than for the Crazyswarm case (where the position of the Crazyflies have to be broadcasted in real time).

Your plan sounds good, you can broadcast position setpoints to all Crazyflies. For 8 quadcopters a single Crazyradio will be good enough to broadcast all the setpoints.

For firmware development you can use any IDE compatible with gcc/makefiles project. The Bitcraze VM has eclipse pre-configured. You can also just use your text editor of choice and run 'make' in a console (I am working with Atom).

Post Reply