Following a Trajectory with a Swarm

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
crazyfordrones
Beginner
Posts: 6
Joined: Tue Dec 01, 2020 5:03 pm

Following a Trajectory with a Swarm

Post by crazyfordrones »

Hi,

I'm trying to create a script that uses the Figure8 trajectory used in crazyflie-lib-python/examples/autonomous_sequence_high_level.py and allows this trajectory to run on a Swarm. I want two drones to run the Figure8 trajectory at the same time next to each other. I'm new to coding, so could use some guidance on what is wrong with my code. I'm currently using the lighthouse deck and positioning system on both crazyflies.
fig8swarm.py
(8.07 KiB) Downloaded 11 times
I believe my main issue is with understanding how the Swarm class works, and how the swarm.parallel_safe() command is properly used. When I run my script currently, I get the following error:

Traceback (most recent call last):
File "fig8swarm.py", line 174, in <module>
swarm.parallel_safe(run_shared_sequence)
File "/home/bitcraze/.local/lib/python3.6/site-packages/cflib/crazyflie/swarm.py", line 183, in parallel_safe
raise Exception('One or more threads raised an exception when '
Exception: One or more threads raised an exception when executing parallel task

Any guidance would be greatly appreciated!
kristoffer
Bitcraze
Posts: 369
Joined: Tue Jun 30, 2015 7:47 am

Re: Following a Trajectory with a Swarm

Post by kristoffer »

Hi!

Yes, the Swarm class is not as easy to use as one would like...

I improved the error reporting a bit, https://github.com/bitcraze/crazyflie-l ... issues/179
Pull in the latest version of the lib and run your code again. Hopefully you will get the call stack of the original exception
Post Reply