how to classify the uris of crazyflies when they are doing swarm

Discussions about quadcopters/multi-rotors
Post Reply
dyang
Beginner
Posts: 3
Joined: Wed Aug 15, 2018 4:48 pm

how to classify the uris of crazyflies when they are doing swarm

Post by dyang »

I am flying a few crazyflies in parallel and want to save the log for each of them. However, when i am fetching the logs, I just fetched the log data of those three together and can not classify them. Any idea to solve this problem?
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: how to classify the uris of crazyflies when they are doing swarm

Post by whoenig »

Could you provide some more details on how you fly your CFs? Are you using ROS or the python SDK?
dyang
Beginner
Posts: 3
Joined: Wed Aug 15, 2018 4:48 pm

Re: how to classify the uris of crazyflies when they are doing swarm

Post by dyang »

whoenig wrote: Thu Aug 16, 2018 2:30 am Could you provide some more details on how you fly your CFs? Are you using ROS or the python SDK?
Hi, I am using python to run the crazyflie. And I was using those code to get the position information of the crazyflie. And the data I got were the data from all of the crazyflies together and I could not classify them, so I just want to know how get the uri information for each data I got.

position printing.png
call back.png
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to classify the uris of crazyflies when they are doing swarm

Post by arnaud »

you need to setup a different log callback for each Crazyflies or to add a parameter to the callback with the ID of the drone. One way to do that is for you to create one logger object per Crazyflie, this way the object state can contain the ID. Another way would be to have a lambda function that adds the ID to the callback call. We have used the lambda strategy in many places in the client if you need some examples.
Post Reply