I have N GPS coordinates with N distances given to an unknown position which I wish to determine.
My first approach was to use just three points and trilateration, exactly as described here. This approach was already quite accurate (best error~5km), but I would like to improve this and increase the robustness.
Because the given distances are not very accurate to begin with, I thought about using multiple measurements and multilateration.
However, it turned out that this approach is by far less accurate (best error~100km) although I provide more than 3 points/distances (tested with up to 6) and now I am asking, if someone has an idea what I could have done wrong.
In short, my approach for multilateration is as follows:
- Convert all coordinates into ECEF
- Build a matrix as described in Eq.7 at wikipedia
- Use SVD to find the minimizer
- As the solution is only up to scale, I use a root-finding approach to determine a normalization so that the coordinates converted back into LLA result in a height of 0 (my initial assumption is that all coordinates are at zero height)
- Convert back into LLA
LLA/ECEF conversion is double-checked and correct. Step 2 and 3 I’ve checked with euclidean coordinates (and exact distances) and appear correct. I came up with step 4 by myself, I have no clue if this is a good approach at all, so suggestions are welcome.
+++UPDATE
I’ve put together sample code in python to illustrate the problem
with some ground truth. Trilateration gets as close as 400m, while
Multilateration ranges at 10-130km here.
Because of length, I’ve put it at ideone
Eventually, I figured it out myself – or at least improve the accuracy significantly.
The approach described at wikipedia (Eq.7) is apparently not very suited for this application, but in this case it is already a lot easier.
Considering Eq. 6 from wikipedia, we can simplify it a lot:
R_0can be guessed as the earth radius, as the origin of ECEF coordinates lies in the center of earth. Therefore, there is no need to shift everything to make one Point the origin and we can use allNequations.In python, with
Pan array of ECEF coordinates anddiststhe distances to these points, it all boils down toWith this approach, what I described as Step 4 is no longer necessary. In fact, it even makes the solution worse.
Now, accuracy ranges between 2km and 275m — in most cases better than the “optimal” trilateration with an error of 464m.