Having trouble flying 2 Crazyflies as a swarm with obstacle avoidance code #135
Replies: 2 comments 3 replies
-
Hi! Looking at the videos it seems as if they "drift away" when you're running two at the same time, or? Could you give us some more details on how you're controlling them (what class, how many radios etc) or some code? Also how are you positioning them? I see some Lighthouse base stations and maybe some LPS nodes, or are you using the flow deck? |
Beta Was this translation helpful? Give feedback.
-
Hi! Looking at your code it is a bit difficult to see why your code is behaving differently with 2 than with 1. The common explanation is that it is dealing with threads, and since your solution is very timing based, it means that probably the sleeps() are handled different, or the start_linear motion are dealt with differently, or the range measurements are read out at different times. It is unfortunately very difficult to say with python threads especially when they are receiving range measurements too. By definition, the crazyflies needs to share the packet limitation, and since you are using the motion commander, it's sending a lot of packages per second. I'm also not sure if the motion commander reacts with the swarm thread as we don't provide these in our examples So I have some alternative ways for you to proceed:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I was recently able to write a Python program with my friend which successfully allows a Crazyflie 2.0 to fly to a specific coordinate while avoiding obstacles placed in its away. It uses the multiranger deck. However, when I have two drones simultaneously following the code as a swarm, they manage to fly together but don't fly in sequence and always glitch up somehow. I have attached 4 videos below - 2 videos have each Crazyflie individually following the code successfully without any obstacles placed in the way. The other 2 show the failed flights when the 2 Crazyflies follow the code as a swarm.
Was wondering if anyone have ideas that could be causing these failures and if there's anything I can do to fix this problem. I tried placing them apart at least .3 meters both horizontally and vertically. Would be more than happy to provide more information if necessary. Thanks.
crazyflievid4.mp4
crazyflievid3.mp4
crazyflievid2.mp4
crazyflievid1.mp4
Beta Was this translation helpful? Give feedback.
All reactions