ranging between crazyflies

All discussions related to the Loco Positioning system
Post Reply
john5648
Beginner
Posts: 7
Joined: Sat Nov 28, 2020 7:03 am

ranging between crazyflies

Post by john5648 »

hello

i want crazyflie to range other crazyflie using TWR.
I found TWR code in crazyfile-firmwarehttps://github.com/bitcraze/crazyflie-f ... psTwrTag.c but still i have no idea how to start

It would be appreciated if somebody could give me a help

thanks!
john
arnaud
Bitcraze
Posts: 2391
Joined: Tue Feb 06, 2007 12:36 pm

Re: ranging between crazyflies

Post by arnaud »

If you want only 2 Crazyflies to range to each-other, TWR might be a good solution. The code you are linking is the tag part of TWR, the anchor part lives in the LPS node (https://github.com/bitcraze/lps-node-fi ... r_anchor.c) and can be ported to the Crazyflie so that Crazyflies can be used as anchor. This will range one to many Crazyflie, it will be hard to addapt it to range many to many Crazyflie.

For ranging many to many the best is to use asynchronous messaging, the way it is done in TDoA3. There has been some work in the comunity about addapring the TDoA3 protocol to work between Crazyflies, the fruit of this work is currently in a pull request: https://github.com/bitcraze/crazyflie-firmware/pull/656. TDoA3 does implement ranging between anchors, this pull request adds support for drone to range between each other as well.
Mathilda
Beginner
Posts: 6
Joined: Thu Jul 30, 2020 10:12 am

Re: ranging between crazyflies

Post by Mathilda »

Hi,John.
Our group already achieved this. Here is the code:https://github.com/twinhorse/crazyflie- ... bp2pdist.c.
There are still some codes need to be modified, which you can find in this Github Project. This code just came true ranging between two crazyflies.
By the way,I`m try to set a lpsnode as tag and anchor at the same time so that lpsnode can receive answer/report packets. However, I met some difficulities. The logic to solve this problem is the same as ranging between two crazyflies , so if you are interested in this problem. We can keep communicating.

Mathilda.
Last edited by Mathilda on Mon Dec 14, 2020 4:20 am, edited 2 times in total.
john5648
Beginner
Posts: 7
Joined: Sat Nov 28, 2020 7:03 am

Re: ranging between crazyflies

Post by john5648 »

Hi, Mathilda

Thanks for sharing the code.
I have read your reply the day you posted but I was already using inter-drone twr ranging code of this: https://github.com/bitcraze/crazyflie-firmware/pull/580

What i'm trying to do is opposite as yours, making drone working as tag and anchor. Also, using TDOA2 algorithm when tag and inter-drone twr algorithm when anchor.

Thanks for the code again, it helped me understanding how twr code works. :D
John
Post Reply