Skip to content
Snippets Groups Projects
Commit 7f68897c authored by Hailong Zhu's avatar Hailong Zhu
Browse files

-update Triangulation.java

parent c7cccb2d
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ public class Triangulation {
private static IPos_DatamodelFactory modelFactory = IPos_DatamodelFactory.eINSTANCE;
public static PositionEvent update(UWB uwbRawDataEvent) throws ParseException {
double[][] positions = new double[][]{{0, 0}, {0, 0}, {0, 0}, {0, 0}};
double[] distances = new double[]{0,0,0,0};
EMap uwbData = (EMap) uwbRawDataEvent.getDistances();
......@@ -35,7 +35,7 @@ public class Triangulation {
Point3D beaconPoint3D = modelFactory.createPoint3D();
beaconPoint3D = (Point3D) DataServices.getPoiByIdOrNull((String) key).getPlacing().getPosition();
positions[index] = new double[]{beaconPoint3D.getX(), beaconPoint3D.getY()};
distances[index] = Math.sqrt(Math.pow((Double) uwbData.get(key), 2) + Math.pow((beaconPoint3D.getZ() - 0.1), 2));
distances[index] = (Double) uwbData.get(key);
index ++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment