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

Incorrect calculation of centroid.

abd-salam-shaikh opened this issue · comments

I tried using this project for a given set of co ordinates and rssi values(which is later transformed into distance in meters)

double[][] positions = new double[][]{ {49.8773045,8.654494}, {49.877183,8.6547037} {{49.8772021,8.6548117}}; double[] rssi = new double[]{-69.0, -61.0,-81.0}; // After transformation the rssi values equate to double[] distance = new double[]{14.0,10.0,15.0}

The calculated centroid co ordinates are 48.263028853759394, 12.457544241370318 which locates to some other country. Could you look into this issue ?

The trilateration algorithm requires all values to be of the same type of units. For example, they should all be in meters.

You will need to convert your lat/lng from decimal degrees to meters using some form of map projection (e.g. Mercator). You will also need to convert your RSSI into a distance of meters using a path loss algorithm.

Once you have done this, you can feed those values into the algorithm. Once calculated, you must then convert the result from the map projection back into decimal degrees.

Thanks. That worked out for me.

Just note that the projection can cause errors at certain locations on the Earth. You might be better off with WGS 84 or Web Mercator for example, depending on your application.