Get distance tag to anchor in TDoA mode

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

Get distance tag to anchor in TDoA mode

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: 176
Joined: Tue Jun 30, 2015 7:47 am

Re: Get distance tag to anchor in TDoA mode

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

``crazyflie-firmware/src/modules/src/stabilizer.c``