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 » Wed Aug 15, 2018 4:53 pm

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: 283
Joined: Mon Oct 27, 2014 2:55 am

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

Post by whoenig » 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?

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 » Wed Sep 12, 2018 5:14 pm

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: 1779
Joined: Tue Feb 06, 2007 12:36 pm

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

Post by arnaud » Mon Oct 08, 2018 9:42 am

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