Get distance tag to anchor in TDoA mode

All discussions related to the Loco Positioning system
Post Reply
song
Beginner
Posts: 15
Joined: Tue Jan 29, 2019 12:24 am

Get distance tag to anchor in TDoA mode

Post by song » Fri Mar 15, 2019 2:59 am

HI all

I'm trying to use 10 Cf2 with LPS deck to get position value.
I won't make Cf2 fly. I just want to extract and send position data using UART. I also made my own algorithm calculate its own position with distance and did experiments with single Cf in TWR mode. The result was perfect.

But the problem is in TDoA mode. At first, i didn't know i should use Cf2 in TDoA mode in case of using Cf2 more than 2.
As you know, TDoA mode is different from TWR mode. And i searched the forum and found 2 posts.
1) viewtopic.php?f=3&t=3229&p=15722&hilit= ... nce#p15722
2) viewtopic.php?f=16&t=3319&p=16024&hilit ... ion#p16024

In 2) post you said
'So if you are using TDoA and want the distance to an anchor you need to calculate it from the position estimate and the anchor position.'
so i searched the forum to get information in details about this topic. As a result, i found 1) post, but i don't understand clearly. I'm confused about calculations.

Is that calculation(in 1) post) about a distance between tag and anchor?
If it's not, how can i calculate the distance between tag and anchor? I really really want to make my own calculation, but i don't know how to handle values of tof, dist, d0-1, etc.

Thank you!

kristoffer
Bitcraze
Posts: 96
Joined: Tue Jun 30, 2015 7:47 am

Re: Get distance tag to anchor in TDoA mode

Post by kristoffer » Mon Mar 18, 2019 3:05 pm

Hi!

In TDoA (Time Difference of Arrival) the data you get is the difference in distance to two anchors.
An example:
See this image https://wiki.bitcraze.io/doc:lps:tdoa:p ... s#geometry on the wiki. This is 2D to simplify the graphics, but it can easily be extended to 3D.
The Tag is at (0.0, -0.5), Anchor 1 is at (2.0, 1.0) and Anchor 2 at (0.0, -2.0)
The distance from Tag to A1 is sqrt(2.0 * 2.0 + 1.5 * 1.5) = 2.5m
The distance from Tag to A2 is sqrt(1.5 * 1.5) = 1.5m
The value we would get in TDoA mode is 2.5 - 1.5 = 1.0 m, that is all we know is that the Tag is 1.0 m closer to A1 than A2. This is inherent in the algorithm, we do not know anything of the distance to each anchor, only the difference.

You can read more about how to calculate a position from the TDoA data on https://en.wikipedia.org/wiki/Multilateration for instance.

song
Beginner
Posts: 15
Joined: Tue Jan 29, 2019 12:24 am

Re: Get distance tag to anchor in TDoA mode

Post by song » Tue Mar 19, 2019 1:46 am

Thanks for your reply,

It's Pythagoras for calculating a distance from Tag to Anchor.
So, I have to extract the Tag position if i wanna get that distance. Then my next question is that How to get the Tag position!
After I've got your reply, i tried to find Tag position. But it's not easy.

I guess,i can't assure, that state.positionin struct state_s is the estimated Tag position. The followings are information about it.

Code: Select all

crazyflie-firmware/src/modules/src/stabilizer.c
이미지 5.png
I really hope that i can get Tag position and make my project to be succeeded.
Thank you!

Post Reply