Fix: replaced borked location prediction
commit83517b58a319c733a6cbb65d0d2236695663e33a
authorGergely Imreh <imrehg@gmail.com>
Fri, 26 Sep 2008 22:27:02 +0000 (26 23:27 +0100)
committerGergely Imreh <imrehg@gmail.com>
Fri, 26 Sep 2008 22:27:02 +0000 (26 23:27 +0100)
tree280f9966648f55113123c2e46f05becc5859ef99
parentf98710d7aea061a53d3513c71fc648dcb62d78e8
Fix: replaced borked location prediction

The location prediction fails bigtime in previous versions,
because of wrong geometrical assumptions. Tried to correct
this in this commit. Prediction now depends on the number of
towers that are known at the given moment:

0: no prediction
1: location is that of the known tower
2: between the two known towers, closer to the higher signal
3: triangulate for three towers
>3: triangulate for all possible triads, with the restriction
    that the connected tower has to be among the three (the
    other two changes). Check distance of predictions from
    connected tower, throw away the far half, average the
    positions of the rest.
    if the connected tower is not among the known towers,
    find the one with the highest signal and pretend that
    is the connected tower. Do triangulations as otherwise.

Tested at a stationary position position (at my desk;) and
seemed to work but going to try in motion. This algorithm
needs to be tested a lot....
gsmpos/gsmpos.py