How to control more than 50 crazyflies?

Discussions and questions about the Crazyradio
NicksonYap
Beginner
Posts: 11
Joined: Mon May 07, 2018 5:04 pm

How to control more than 50 crazyflies?

Post by NicksonYap »

HI Bitcraze Team,

I've purchased 8 crazyflies in total but have problem controlling more than 3 or 4 at the same time.

Adding 1 more drone will cause one of the drones fall/crash

I'm running a code that will control RGB and XYZ at 10Hz

I realize the swarm bundle has 10 drones and 3 Crazyradio PA, do I need more Crazyradios to control more drones?
https://store.bitcraze.io/collections/b ... arm-bundle

Regards

Nickson
Founder
Seamless Industries (seamlesshq.com)
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to control more than 50 crazyflies?

Post by arnaud »

Hi,

It depends how you control the drone and what client you are using.

The reason we are selling the swarm bundle with 3 radio is that when using the Python Crazyflie lib directly to control the drone, we have seen that we can control 3/4 Crazyflies per Crazyradio.

Using more efficient communication schemes, the Crazyswarm project is able to control about 15+ Crazyflies per Crazyradios, this allow to fly 49 Crazyflies with only 3 radios: https://crazyswarm.readthedocs.io/en/latest/.

In any way, communication problems should not crash a drone so there must be a bug there. Are you logging a lot of data from the Crazyflies? The radio in itself is limited to about 800 packets per seconds both way.

As a side note, to control the led-ring color, if you are using the fadeColorEffect you can set RGB packed in a uint32 as a single parameter write to ring.fadeColor and can automatically fade from one color to the next. This can save some packets.
Yoyasp
Beginner
Posts: 19
Joined: Mon Jan 14, 2019 2:41 am

Re: How to control more than 50 crazyflies?

Post by Yoyasp »

Hey Arnaud and Nickson,

Is it possible the Crazyflie crashes because of the watchdog timer?
As in: one of the drones is not receiving packets for 5 seconds because the radio queue is full with messages because it can only procces so many at a time.

Just wondering,
Kind regards,

Jasper
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to control more than 50 crazyflies?

Post by arnaud »

If you are using low level commander setpoint and there is no packet for more than 1/2 seconds it is indeed possible to get into trouble: after 1/2 seconds the Crazyflie will try to level its attitude and after 1 second it will cut the motors.

This is not related to the hardware watchdog that guard the software and would reset the micorocontroller, this is a protection mechanism in the commander implementation so the Crazyflie should not reset, but it can make it physically crash.
NicksonYap
Beginner
Posts: 11
Joined: Mon May 07, 2018 5:04 pm

Re: How to control more than 50 crazyflies?

Post by NicksonYap »

Thanks Arnaud!

I do not know why i wasn't receiving email notifications until i checked manually in bitcraze forum.

This explains why i could not control more than 4 crazyflies!

I'll try the crazyswarm one,wasn't aware they have an optimized Crazyradio firmware

Since Crazyswarm firmware is merged with master, i suppose the official latest firmware will work with the modified Crazyradio firmware?
However it's weird because the official Crazyswarm repo points back to official Bitcraze repo

I've actually read the Crazyswarm guide many times before looking for help, i really don't suppose i can find the link/repo for this

Mind pointing out the real repo/link for getting to control many crazyfies?
The closest thing i found was a twitter post: https://twitter.com/bitcraze_se/status/ ... 7489091585

Regards
NIckson
NicksonYap
Beginner
Posts: 11
Joined: Mon May 07, 2018 5:04 pm

Re: How to control more than 50 crazyflies?

Post by NicksonYap »

arnaud wrote: Mon Apr 29, 2019 9:23 am Hi,

It depends how you control the drone and what client you are using.

The reason we are selling the swarm bundle with 3 radio is that when using the Python Crazyflie lib directly to control the drone, we have seen that we can control 3/4 Crazyflies per Crazyradio.

Using more efficient communication schemes, the Crazyswarm project is able to control about 15+ Crazyflies per Crazyradios, this allow to fly 49 Crazyflies with only 3 radios: https://crazyswarm.readthedocs.io/en/latest/.

In any way, communication problems should not crash a drone so there must be a bug there. Are you logging a lot of data from the Crazyflies? The radio in itself is limited to about 800 packets per seconds both way.

As a side note, to control the led-ring color, if you are using the fadeColorEffect you can set RGB packed in a uint32 as a single parameter write to ring.fadeColor and can automatically fade from one color to the next. This can save some packets.
*bump*

trying to quote you to make sure ytou get notified
kinda in a dire situation from my end... project got postponed coz of this issue
NicksonYap
Beginner
Posts: 11
Joined: Mon May 07, 2018 5:04 pm

Re: How to control more than 50 crazyflies?

Post by NicksonYap »

I was actually using Crazyflie python lib to control, and I did get only up to a max of 3-4 crazyflies (depending on environment)

I was logging battery voltage at say 2-5 sec interval,

It seems that to solve communications issue i need to use pycrazyswarm lib instead?

Because firmware wise for Crazyradio and Crazyflie itself in the official repo should already be the same for Crazyswarm
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to control more than 50 crazyflies?

Post by arnaud »

What behavior are you experiencing when adding more than 3-4 Crazyflies, physical crash or software crash of the Crazyflie firmware?
If it is physical crash it would point towards being a problem sending the setpoint packet in a timely manner.

I am not sure what pycrazyswarm is exactly, then using Crazyswarm the main change is that you are using ROS and the Crazyflie ROS driver that is implemented in C++. This driver is suppose to have better performance than the Python-implemented Crazyflie lib, but I am not sure how much using C++ instead of Python is actually helping versus the more optimized communication.

Firmware wise, the Crazyflie is compatible out of the box with Crazyswarm and the radio needs to be updated to implement new broadcast capabilities (Crazyswarm can send 2 broadcast packet at once over USB). The changes for the radio have been merged in the radio firmware repos but it is not flashed in the radio in factory so that is why you need to update the radio firmware before using Crazyswarm (this update is documented by Crazyswarm and a precompiled firmware is part of there repos).

The twitter post is very old and nowadays controlling multiple Crazyflie with multiple radios is a standard functionality of the lib.

By the way, have you tried adding more radios, is that solving the problem?
NicksonYap
Beginner
Posts: 11
Joined: Mon May 07, 2018 5:04 pm

Re: How to control more than 50 crazyflies?

Post by NicksonYap »

Quite consistently, it's always going to be 1 of the crazyflie, kind of randomly (based on what i recall) just starts to fly quite badly, and then wobble, then drops (i'd describe it as more like a dying bird than dropping like a rock)

Before this post, and finding out that the Swarm Bundle had multiple crazyradios
I had no idea i had to use multiple radios for more than 3/4 crazyflies
Have just bumped in to this topic and understood the problem: viewtopic.php?f=5&t=3439

Pycrazyswarm is likely their Python Wrapper/client for the commands: https://crazyswarm.readthedocs.io/en/latest/api.html
Which is

If I understood what you meant to get it working, i have to:

1. Flash Crazyflie using CF Client using release from: https://github.com/bitcraze/crazyflie-f ... ag/2019.02
2. flash Crazyradio using 'prebuilt/cradio.bin' from: https://github.com/USC-ACTLab/crazyswar ... r/prebuilt (the binary is from 1 year ago)
3. Use Crazyswarm... but which, specifically? (note: i'm really new to ROS, I don't actually know what's the main purpose for ROS)


I had issues with Crazyswarm almost half a year ago, as I was using Loco node and it's newly implemented in Crazyswarm

My last attempt was that it doesn't fly around, just takes off and stays there indefinitely until i kill the ROS program.
Posted here: https://github.com/USC-ACTLab/crazyswarm/issues/108
At that point of time I could not get any Crazyswarm related thing to work, had tried reflashing firmwares again and again then gave up...

Now it seems I'm back to the same spot, but at least I'm more clear of the issue.
So once we clarify on the firmwares to use to-date, then i won't be doubting firmware issues again and may give Crazyswarm a try again


---

EDIT:

I actually have 2 Crazyradios with me, is there a sample where I can properly use official Python API to control say 6-8 drones using 2 radios??
Because I already have existing code that works very well, only that the number of drones supported is very limited (the 3-4 limit)

Regards

Nickson
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to control more than 50 crazyflies?

Post by arnaud »

The behavior you are describing looks very much like missing setoint packets. Depending of your usecase it could be interesting to use the high level commander: the high level commander allows to send high level commands to the Crazyflie like goto and trajectories and the Crazyflie is generating log level setpoints. This is used by Crazyswarm but also available in the lib (see position commander example) and relaxes greatly the need for real-time setpoint.

For Crazyswarm you understood well. ROS is a framework that allows to 'glue' together robotic projects and algorithms from multiple source, it is not always obvious to get started with it but there is good documentation and getting started guide on the ROS wiki. Crazyswarm uses ROS and the Crazyflie ROS driver, but there is only one Crazyswarm project I am aware of so I do not really understand your point number 3.

To use another radio from your code, simply use the other radio in the uri. For example "radio://0/80/2M" will use the first radio and "radio://1/80/2M" the second one.

For performance reason, it is important that all the Crazyflie on one radio have the same channel, and that each radio has a different channel. This is an example of proper configuration (in a case where 4 Crazyflies are used with 2 radios):
"radio://0/70/2M/E7E7E7E701"
"radio://0/70/2M/E7E7E7E702"
"radio://1/75/2M/E7E7E7E703"
"radio://1/75/2M/E7E7E7E704"
Post Reply