I'm currently working on a school project where we have to set up a traffic simulation. We decided to use TraaS.
TraaS has a method to retrieve the current X and Y coordinates of a given vehicle (see getPosition). However these X and Y coordinates are not the actual map coordinates, but they are relative to the SUMO net.
The question is: How to convert these relative coordinates to geo coordinates?
TraaS has a method named convertGeo to convert X and Y coordinates to geo coordinates, however the method throws an exception. As far as I can tell I'm passing the correct arguments to the method; two doubles and a string which indicates whether you are converting to or from geo coordinates. The method throws the following exception:
SUMO error for command 171: Source position type not supported
//Get a random vehicle from the list of current vehicles in the simulation.
String vehicle = getRandomVehicle(); //Retrieves a random ID of an existing vehicle in the simulatio, don't worry about it,
SumoPosition2D pos = (SumoPosition2D) conn.do_job_get(Vehicle.getPosition(vehicle)); //Retrieves the last X and Y coordinates of the vehicle (example -> X: 6997.111901690444, Y: 7564.062169389001)
Object obj = conn.do_job_get(Simulation.convertGeo(pos.x, pos.y, "False")); //Throws an exception -> SUMO error for command 171: Source position type not supported)