Cflib

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
santiagorg2401
Beginner
Posts: 14
Joined: Sun Sep 08, 2019 2:28 pm

Cflib

Post by santiagorg2401 » Sat Jul 25, 2020 4:15 pm

Hi,
I started devoloping with the cflib, but I have a doubt, what is the "guideline" to start typing code?, and, what class can I use in order to fly a swarm with Flow deck but sending individual orders to each crazyflie?
Thank you.



kimberly
Bitcraze
Posts: 459
Joined: Fri Jul 06, 2018 11:13 am

Re: Cflib

Post by kimberly » Mon Jul 27, 2020 9:47 am

Hi!

Actually we started to write tutorials for the cflib. This is the first one for the parameter and logging: https://www.bitcraze.io/documentation/r ... log_param/. But we are not at swarming yet.

You can look into the CFLIB example folder and the swarm folder. There are some examples in there that you can use like this one

But individual orders to each crazyflie might be a bit tough through this class though. You can give different parameters/settings to each crazyflie, but not on the fly give it completely different commands. You would need read their URIs in the function that is in the parallel which you can do like this:

Code: Select all

print(scf.cf.link_uri)  
and then write different instructions within a IF statement that checks which crazyflie is connected. Then within that IF statement you can write crazyflie specific commands.

santiagorg2401
Beginner
Posts: 14
Joined: Sun Sep 08, 2019 2:28 pm

Re: Cflib

Post by santiagorg2401 » Thu Jul 30, 2020 7:00 pm

Hi,
I tried to use that code as a reference, but it doesn't work well with Flow Deck, for example if I send
sequence1 = [
(0.0, 0.0, 1.0, 3.0)
]
The Crazyflie takes off but then it flies randomly to any direction, I've changed the propellers, the motor mounts and the battery is well balanced.
For example if I set the same position but with motion_commander or position_hl_commander the crazyfllie flies perfect.
Is it because swarmSequence is a version of AutonomousSequence and this one is designed for LPS System?
The surface is a ceramic white floor.

santiagorg2401
Beginner
Posts: 14
Joined: Sun Sep 08, 2019 2:28 pm

Re: Cflib

Post by santiagorg2401 » Thu Jul 30, 2020 7:09 pm

Here I attached the files
Attachments
pruebaEstadoCF.py
This one based on position_commander.demo.py
(700 Bytes) Downloaded 1 time
PruebaVueloSincronizado.py
This is the code based on swarmSequence.py
(4.93 KiB) Downloaded 1 time

kimberly
Bitcraze
Posts: 459
Joined: Fri Jul 06, 2018 11:13 am

Re: Cflib

Post by kimberly » Fri Jul 31, 2020 7:46 am

A Ceremic white floor sounds like something that has no texture on it, which the flowdeck will have very difficult time handling it. You can test this out on different surfaces using the assist mode described in this tutorial here

santiagorg2401
Beginner
Posts: 14
Joined: Sun Sep 08, 2019 2:28 pm

Re: Cflib

Post by santiagorg2401 » Tue Aug 04, 2020 1:43 am

What should be a good surface for the Flow Deck?

kimberly
Bitcraze
Posts: 459
Joined: Fri Jul 06, 2018 11:13 am

Re: Cflib

Post by kimberly » Tue Aug 04, 2020 7:02 am

Anything with good texture and vivid colors. Wood floors usually work well but the best are children play mats. You can also print some colorful posters and put them on the floor. Avoid big black areas though.

Post Reply