Commit dbd1ff69 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

meters -> long lat

parent b4ef2705
Pipeline #191664 failed with stages
in 2 minutes and 43 seconds
......@@ -77,10 +77,10 @@ public class WorldBuilderService {
result.add(new MapModel.Node(
node.getOsmId(),
x, y,
// x, y,
// uncomment blowing code to get longitude/latitude coordinate
// converter.convertXToLong(x, y),
// converter.convertYToLat(y),
converter.convertXToLong(x, y),
converter.convertYToLat(y),
node.getZ().floatValue(),
sign == null ? null : new MapModel.StreetSign(
sign.getId(), sign.getType().toString(), sign.isOne(), sign.isTwo(),
......@@ -98,14 +98,14 @@ public class WorldBuilderService {
double minX = bound.getMinX(), minY = bound.getMinY(),
maxX = bound.getMaxX(), maxY = bound.getMaxY();
mapModel.setBounds(new MapModel.Bound(
minX, minY, bound.getMinZ(), maxX, maxY, bound.getMaxZ()
// minX, minY, bound.getMinZ(), maxX, maxY, bound.getMaxZ()
// uncomment blowing code to get longitude/latitude coordinate
// converter.convertXToLong(minX, minY),
// converter.convertYToLat(minY),
// bound.getMinZ(),
// converter.convertXToLong(maxX, maxY),
// converter.convertYToLat(maxY),
// bound.getMaxZ()
converter.convertXToLong(minX, minY),
converter.convertYToLat(minY),
bound.getMinZ(),
converter.convertXToLong(maxX, maxY),
converter.convertYToLat(maxY),
bound.getMaxZ()
));
}
......
......@@ -23,6 +23,8 @@ import server.errorflags.ErrorDeterminatorProcessor;
import server.errorflags.ErrorFlag;
import server.errorflags.SimFrameInfo;
import simulation.environment.util.IBattery;
import simulation.environment.osm.ApproximateConverter;
import simulation.environment.WorldModel;
import simulation.vehicle.PhysicalVehicle;
import simulation.vehicle.Vehicle;
import simulation.vehicle.VehicleActuatorType;
......@@ -35,6 +37,7 @@ import java.time.Duration;
import java.time.Instant;
import java.util.*;
/**
* SimulationObserver collects simulation result from simulators
*/
......@@ -94,17 +97,17 @@ public class SimulationObserver extends SimulationLoopNotifiable {
String id = String.valueOf((int) physical_vehicle.getId());
// uncomment the lines below to use longitude/latitude coordinate
// ApproximateConverter cvt = null;
// try {
// cvt = WorldModel.getInstance().getParser().getConverter().getApproximateConverter();
// } catch (Exception e) {
// e.printStackTrace();
// }
// double longitude = cvt.convertXToLong(position[0], position[1]);
// double latitude = cvt.convertYToLat(position[1]);
double longitude = position[0];
double latitude = position[1];
ApproximateConverter cvt = null;
try {
cvt = WorldModel.getInstance().getParser().getConverter().getApproximateConverter();
} catch (Exception e) {
e.printStackTrace();
}
double longitude = cvt.convertXToLong(position[0], position[1]);
double latitude = cvt.convertYToLat(position[1]);
// double longitude = position[0];
// double latitude = position[1];
SimulationDataframe frame = new SimulationDataframe();
frame.setId(vehicle.getGlobalId());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment