lemmingapex / trilateration

Solves a formulation of n-D space trilateration problem using a nonlinear least squares optimizer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about distances

boringow opened this issue · comments

Are the input distances computed from the TDOA? if so, why do we need same number of distances than receiver positions, as in reality we would need 1 distance less? Could you help me out please?

This library does not define how to measure the input distances. It only solves a trilateration problem with given positions and distances. The applied algorithm for finding a best match is the levenberg-marquardt algorithm. It needs the distance to each point in order to calculate.
For example I used this library with bluetooth beacon measurements. The distances were estimates of each beacon to the device (+-50% error).

Sorry I did not express myself so well. I mean, when you say 'It needs the distance to each point in order to calculate. ' You mean the euclidean distance from the object to the receiver? I am trying to use this algorithm in the way that I have a set of passive receivers receiving a message from an aircraft so that I can predict its position.

The euclidean distance would be the ideal (and exact) distance between object and receiver. In general we never have measurements which are that accurate. For your use case, you have an estimate for the distance from object to each receiver. Because estimates are inaccurate, you can use this library to find a solition for the position of the plane (=Multilateration).
Keep in mind - there is no perfect mathematical solution - this is a non linear system, because there can be several or no solutions to the problem.

Then, you are telling me that the input of distances are just pseudoranges? a range of a receiver can have 250km, so then it becomes useless for my application. I still do not understand what are the input "distances" of this algorithm.

The application you describe is to locate an aircraft by sending messages to multiple receivers. In a perfect mathematical world your distance from receiver to plane would be the euclidean distance. But because radio waves are subject to different physical phenomena such as refraction, reflection and so on, there are measurement errors.
In the perfect mathematical example there would be a perfect solution for the position of the plane (linear system). But because the distances are subject to error, the resulting system becomes nonlinear.
The levenberg-marquardt algorithm is a way to find a best possible solution (= estimated position of the plane) in this nonlinear system. As input it requires the measured distances from each receiver to the plane.

Your "one less distance" is only valid for a linear solution (which you do not have). For a nonlinear one, you need exactly the same number of distances, as you have receivers.

Coming back to the distances and coordinates - the only thing is that they need to be in the same measure. E. G. if one is in kilometers, then all of them need to be in kilometers.

Understood! Thanks a lot for your reply.
This code provides a position optimizer once we know all the distances from the receivers to the object, but I was trying to find a code that provides the distances, only with time of reception and Rx position. Do you know by any chance is there is something similar in github? I have been searching a lot and did not find anything. If not, I could create it. I found this interesting reference for that:
https://stackoverflow.com/questions/36176167/trilateration-of-a-signal-using-time-differencetdoa
Enormous thanks and have a nice day!

This is an issue tracker for this specific library. Your question is out of scope for this.
Though already the first google result for "TDOA to distance" will help you.
d = c * ( ta - ts)
where
ta = time of arrival
ts = time sent