Swarm script runs but no takeoff using LPS

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
munusamy
Beginner
Posts: 6
Joined: Wed Dec 23, 2020 5:36 am

Swarm script runs but no takeoff using LPS

Post by munusamy »

Objective : To get multiple crazyflies flying at the same time using LPS

What works : I've been able to get individual crazyflies working properly using https://github.com/bitcraze/crazyflie-l ... equence.py
Takes off, follows setpoints, lands properly, all good! This was using the TWR mode

Problem: When I switch to TDoA2 mode and try out the swarm scripts(shown below) using two crazyflies (cf position in cfclient after switching to TDoA mode looks fine)
1. https://github.com/bitcraze/crazyflie-l ... r-swarm.py
2. https://github.com/bitcraze/crazyflie-l ... equence.py

the script runs fine without throwing any errors, both cfs get connected (as observed using the LED on board the cf), but both don't take off.
I also tried running the script (1) with one cf, while the other is switched on and placed nearby, even then the single cf does not take off! Also I've deactivated the mellinger controller and set a different box size using

Code: Select all

activate_mellinger_controller(scf, False)
box_size = 0.5
These were the only changes I made to the script (1)

Observation: Using the script (2), I was able to control the state of the LED deck successfully, but the cfs just don't fly.

The URIs I'm using:
'radio://0/80/2M/E7E7E7E7E3',
'radio://0/80/2M/E7E7E7E7E5'

OS : ubuntu 16.04 LTS

Please guide me on how to proceed, thank you

Output when I run script (1)
Attachments
cf_error.png
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Swarm script runs but no takeoff using LPS

Post by kimberly »

Hi!

So it seems that they are waiting until they both have a good position estimate, for which TWR is better at then the TDOAs. Also I think these scripts were written for Mocap or Lighthouse systems so maybe the threshold for a good variance is a bit too strict for LPS systems.

You can try to increase this threshold a bit? Removing might also be an option but then if one of them does not have a good position estimate they might crash.
munusamy
Beginner
Posts: 6
Joined: Wed Dec 23, 2020 5:36 am

Re: Swarm script runs but no takeoff using LPS

Post by munusamy »

The (max-min) estimates do converge below the default threshold value (refer to the image below which prints out the values) and then it breaks out of the loop (second attachment)

That being said, I increased the threshold to as much as 0.01 from the default value of 0.001, but still nothing different happens (refer to the first attachment)
Attachments
thresh_conv2.png
thresh_converge.png
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Swarm script runs but no takeoff using LPS

Post by kimberly »

Ah thanks for the prints. Then indeed it shouldn't block there. It seems also that the script stops itself.

Could you let us know your cflib version? If you installed it with pip3 then this is the command for that.

Code: Select all

pip3 freeze | grep cflib
munusamy
Beginner
Posts: 6
Joined: Wed Dec 23, 2020 5:36 am

Re: Swarm script runs but no takeoff using LPS

Post by munusamy »

Thanks for providing that command,

cflib==0.1.12.1
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Swarm script runs but no takeoff using LPS

Post by kimberly »

This is the newest version already so that can't be it... I can hardly imagine that maybe the 16.04 OS has anything to do with it.

Alright, I will try it out here with the LPS system and see if I observe the same. I'll update you in a minute.
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Swarm script runs but no takeoff using LPS

Post by kimberly »

Alright. I've used a simpler script of the high-level commander and they were able to take off in TDOA3 (see this video)

Also this is the latest master uploaded to the STM.

Have you flashed the latest firmware release to the crazyflies ? It is in the cfclient (latest release) and the tab connect/bootloader. You can then select the latest release of the firmware of both the STM and NRF chip and flash them both at once. Then it would be good to try the script again.
munusamy
Beginner
Posts: 6
Joined: Wed Dec 23, 2020 5:36 am

Re: Swarm script runs but no takeoff using LPS

Post by munusamy »

Yes, I've flashed the latest firmware to the crazyflies. But, let me do that again and try the script.

I shall let you know how it goes
munusamy
Beginner
Posts: 6
Joined: Wed Dec 23, 2020 5:36 am

Re: Swarm script runs but no takeoff using LPS

Post by munusamy »

Thanks, it works fine now!! :)
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Swarm script runs but no takeoff using LPS

Post by kimberly »

Ah great! So that was the problem then. Happy it works for you now!

Happy holidays! :D
Post Reply