Page 1 of 1

Following a Trajectory with a Swarm

Posted: Tue Dec 01, 2020 5:12 pm
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 148 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!

Re: Following a Trajectory with a Swarm

Posted: Wed Dec 02, 2020 10:53 am
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