Log from several drones

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
abrahamvee
Beginner
Posts: 19
Joined: Tue Oct 08, 2019 4:27 pm

Log from several drones

Post by abrahamvee » Wed Nov 13, 2019 2:13 pm

I'm trying to log data from two crazyflies, I took as an example (not sending sequence) swarmSequence and started the log and configuration for position printing. However when I print the position there are two issues: the data received does changes but only decimals (picture attached) even though the drone is changing position (does this has something to do with the fact that I didn't use SyncLogger? if not, is SyncLogger just to synchronize the data received data), second issue is that one of the drones does not return the right position (they were near each other could that affect it?)
Thanks a lot,
Abraham
Attachments
capture3.png



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

Re: Log from several drones

Post by arnaud » Thu Nov 14, 2019 1:09 pm

SyncLogger is about using the Log API in a synchronous way (ie. in a loop) while the standard async API is using callbacks.

What you are trying to achieve is possible and should work with the async api. It is very hard to understand what could be happening without further details, can you maybe share some kind of minimal code that exhibit the problem?

It is a little bit of a long example, but thinking about it our fair demo control tower script is actually achieving what you are after: we connect all the Crazyflies and we get and use logs from all of them: https://github.com/bitcraze/crazyflie-f ... l_tower.py.

abrahamvee
Beginner
Posts: 19
Joined: Tue Oct 08, 2019 4:27 pm

Re: Log from several drones

Post by abrahamvee » Mon Nov 18, 2019 3:46 pm

I used viewtopic.php?t=3325 as a guide for my code, and know I am able to connect with both drones, but one keeps giving incorrect data, I checked with the Crazyflie Client and it seem it is a problem of the tag. Thanks a lot.

abrahamvee
Beginner
Posts: 19
Joined: Tue Oct 08, 2019 4:27 pm

Re: Log from several drones

Post by abrahamvee » Tue Nov 19, 2019 1:39 pm

When trying to connect with the two drones I've discovered that one gives the accurate data, and the other one doesn't. I thought setting the addresses as follows would avoid interference with each other:
"
The key is in the connection URI. The URI to connect a Crazyflie looks something like this: 'radio://0/10/2M/E7E7E7E701'. The first '0' is the ID of the radio, if you connect multiple Crazyflie with radio ID 0, the same radio will be used for them. Then '10/2M' means channel 10 with 2Mbit/s datarate and finally there is the address."

The URIs that I'm using are the following:
uri2 = 'radio://0/110/2M/E7E7E7E706'
uri3 = 'radio://0/110/2M/E7E7E7E703'

Is it probably happening because this particular channel is crowded in the space I'm working, should I change both Uris to another channel or change them individually? Or is this a problem because I'm using to Loco Positioning Decks.

Thanks a lot,
Ab

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

Re: Log from several drones

Post by arnaud » Wed Nov 20, 2019 12:34 pm

If you use different addresses there should not be any interference between the drones.

Are you sure this problem comes from the script or connection and not from the positioning itself? This can be verified by logging the Crazyflies one by one with either a script or the client while both Crazyflies are switched off. For example if you use the LPS in TWR mode, only one Crazyflie can range at a time and switching another ON will generate unpredictable result. With LPS, TDoA is the mode to use for locating multiple drones.

abrahamvee
Beginner
Posts: 19
Joined: Tue Oct 08, 2019 4:27 pm

Re: Log from several drones

Post by abrahamvee » Fri Nov 22, 2019 4:47 pm

You were right, it is a problem of the positioning system itself.
Thanks,

Post Reply