Page 1 of 1

Running the swarm script

Posted: Fri Jun 22, 2018 8:59 am
by PO1
hI, I would like to run the script in the Crazyflie lib python directory on Github, Its importing CachedCFFactory and Swarm.
I will run it from a python script but get a not found error. This particular code is not in the current release I have downloaded.
I've seen this instruction from another post

Until then just clone the repo and pip install -e path/to/your/cloned/cflib to run from the source in the repos instead.

Not sure about the pip install -e instruction, could somebody elaborate on this a little more please.

Re: Running the swarm script

Posted: Fri Jun 22, 2018 1:59 pm
by aesreal
You would have to first install the crazyflie-lib package to your computer. should have been downloaded from the examples of crazyflie-lib here: ...

In order for that to run, you first have to use your terminal to install the package itself.

Assuming you are using Linux,

pip is a Python package manager that searches for packages from their PyPI

The -e is an editable mode, which has already been described here: It means that the package would be installed in a way that any changes made to the package would be directly reflected in your use environment: ... ip-install

To install, run the package "pip install path/directory", where path/directory is the full path to your cflib's file. ... r/

Re: Running the swarm script

Posted: Fri Jun 22, 2018 2:44 pm
by PO1
1. I would like to stick to Windows 10 if thats possible?

2. I've installed cflib as per ... ne-bundle/

3. I guess I would like to run in the same way as other scripts i.e. from the python editor 'Idle' in Windows 10

Will this work with just the flow decks or does it need the Loco positioning system?

4. I would also like to run which uses math,time, cflib.crtp, cflib.crazyflie.swarm libraries

5. I'm using flow Decks on the Crazyflies

Thanks for your help

Re: Running the swarm script

Posted: Sat Jun 23, 2018 8:50 am
by aesreal
It is possible to stick with WIndows 10. the command line has pip support.

To run, Just type in python parth/to/swarmsequence. And it should work.

I haven't use flow decks before, but flow decks are just extensions to the crazyflies. You don't need it for the script to actually work.

Remember to first configure and setup your crazyflies to have the correct addresses, and update accordingly in the swarmsequence script.

Re: Running the swarm script

Posted: Sat Jun 23, 2018 10:56 am
by PO1
When I run the script I get

Traceback (most recent call last):
File "", line 45, in <module>
from cflib.crazyflie.swarm import CachedCfFactory
ImportError: cannot import name 'CachedCfFactory'

I'm guessing this is because the cflib i have on my laptop is not quite up to date and doesent contain the additional CachedCfFactory class or the

Within Windows, how do i update the cflib on my machine, very little experience with this so a quick 'step by step' would be a great help, would be great to run it this weekend in time for next weeks work

big thanks

Re: Running the swarm script

Posted: Mon Jul 02, 2018 7:41 am
by arnaud
If you cloned the crazyflie-lib project from source you should be able to use it instead of the pip-installed version. Open a command line window, navigate in the crazyflie-python-lib folder and type:

Code: Select all

pip uninstall cflib
pip install -e .
This will install the current folder for the cflib library in your system.

Re: Running the swarm script

Posted: Wed Jul 04, 2018 4:38 pm
by PO1
Thank you Arnaud, all updated and working