SWARM Formations

Discussions about autonomous flight in general, regardless of positioning method
quadsRfun
Beginner
Posts: 9
Joined: Tue Mar 03, 2015 3:34 am

SWARM Formations

Post by quadsRfun » Tue Apr 07, 2015 4:23 am

Hi,

has anyone tried controlling multiple quad copters autonomously for SWARM formations?

I'm currently undertaking a research project and I'll be using OptiTrak Flex13 Motion capture system.

Just wondering if anyone had advice or suggestions or just a general chat!



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

Re: SWARM Formations

Post by whoenig » Tue Apr 07, 2015 5:05 am

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

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

Re: SWARM Formations

Post by quadsRfun » Wed Apr 08, 2015 2:16 am

Thank you! I was hoping that there was someone out there similar. I am from Monash University in Melbourne, Australia.

I am starting from the very beginning and was after some pointers to get me started:
1. Did you modify the Cfclient to interact with the quads or you created a whole new GUI
2. Any experiences with the Crazyflie 1.0?
3. What are you main issues apart from what you've mentioned above that you have also faced?
4. What type of environment are you using for development?

Thank you

Jake

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

Re: SWARM Formations

Post by whoenig » Thu Apr 09, 2015 12:32 am

Hi Jake,

1. We are actually using the Robot Operating System (ROS) and wrote a custom driver for it. It uses the official Bitcraze cfclient (i.e. the library part without the GUI). There is no special GUI from our end, however it integrates well with the existing tools in ROS, such as rviz for visualization.
2. We do have one Crazyflie 1.0 and had it swarm with a Crazyflie 2.0. There are a few fallbacks though:
a) The device address fix was only implemented for CF 2.0. However it should be very easy to extend that to CF 1.0 (~4h of work). Might be even easier now since Bitcraze merged the firmware code together.
b) The high-level motion capture controller we published has gains set for CF 2.0. Nevertheless, we did use it for CF 1 as well and the gains are similar (but requires retuning). Our ROS driver supports CF 1 and CF 2, even in a mixed setting.
3. There are quite a few issues left:
a) Tracking is fairly complicated. In case of a VICON system you need to come up with different marker placements. We used custom 3D printed frames to improve the situation.
b) The multi_link branch of the cfclient has some bugs. You can find an improved (but not perfect) version here: https://github.com/whoenig/crazyflie-cl ... _multilink. I'll work with Bitcraze to merge the fixes in, but that might take a few months (because it does require some more testing and clean-up on my side).
c) Going with more than 4 CFs I do see that the stability decreases. There is also a high CPU load on the host PC, so there is definitely some software issue either in the ROS driver we wrote or in the client.
4. We use Ubuntu 14.04 running ROS Indigo. Firmware development etc. is done on the same machine.

Let me know if you have more questions!

Wolfgang

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

Re: SWARM Formations

Post by quadsRfun » Tue Apr 14, 2015 12:42 pm

This is some great insight! I am so glad to have this crucial information that you just can't read / anticipate especially in a project sense!

I am currently attempting to develop the architecture for the system and I am brand new to this and trying to understand how I can integrate control algorithms into the client with a motion capture system. I've never created anything like this before... or found out about this till this year.. (forgive me if im asking stupid questions as Im still trying to understand how this all works :roll: )

1. Should I develop control loop algorithms through the client ? or is that done through the firmware? I'm thinking of taking the Motion capture (X,Y,Z) values and passing it through ZMQ
2. Looking at the source code from the client I am not too sure how everything works together, is there a main file that calls all the sub files? Whats the purpose of bin and lib? Where could I integrate my own .py interface into the MUX?


Thank you in advance and I hope its not too much

swirusek
Beginner
Posts: 2
Joined: Fri May 01, 2015 6:41 pm

Re: SWARM Formations

Post by swirusek » Fri May 01, 2015 6:44 pm

Flying in formations is amazing, but for me very hard

aligak
Beginner
Posts: 6
Joined: Sat May 09, 2015 2:08 am

Re: SWARM Formations

Post by aligak » Sat May 09, 2015 2:14 am

Wolfgang,
I watched the video you posted and it is impressive. I would like to have a discussion with you regarding your Swarming project and if you can tell how we can communicate.

I would like to talk via email or phone if possible.

regards
N

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

Re: SWARM Formations

Post by whoenig » Sat May 09, 2015 4:05 am

Welcome to the forum aligak - I sent you a pm with contact details.

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

Re: SWARM Formations

Post by vivekrk44 » Mon Oct 05, 2015 10:46 am

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 ?

Regards
Vivek

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

Re: SWARM Formations

Post by whoenig » Tue Oct 06, 2015 8:08 pm

Hi Vivek,

I am the author of the ROS driver and had it running with 6 CFs using 3 radios in a similar fashion as you do. For now, I can only think of two reasons for the behavior:
a) extensive logging: It would be best if you disable the logging to reduce the number of packets (e.g. https://github.com/whoenig/crazyflie_ro ... launch#L30)
b) Issues with the channels. If you have WiFi in the same room there are sometimes congestions. WiFi changes channels dynamically, so it is hard to find a good channel. However you should try:
i) Disable WiFi access points (if you can)
ii) Use the RTTI logger to find good channels. It should work with the ROS-driver, but there is no example right now. Hence, it might be easiest to use the python client.
iii) You can try channels > 100. This is illegal in the US, but fine in European countries.

Another possibility is that your MoCap system does not handle multiple objects very well. You can simply test that by flying one quad, but having OpiTrack track 4 of them (3 of them static on the ground). If you see a degraded performance, OptiTrack is your issue. I had such an issue with Vicon at some point (and I believe upgrading the software helped in my case.) Furthermore, the uniqueness of the markers play an important role (e.g. if your system is not calibrated, you might get axis flips with multiple objects which causes bad controller performance.)

Finally, check the LEDs on your Crazyradios: Blinking green: commands are sent. Off: Nothing is sent. Green+Red: Commands are sent, but no Ack's come back. If it is Green+Red you need to change channels. If it is off than there is a problem with the ROS package.

Good luck,

Wolfgang

Post Reply