4

I have created a SUMO simulation including a small map of a city and some vehicles driving around that map.

Further on I have an empty Android Project with Google Maps initialized in it. On app start, it just shows Google Maps centered on that city.

Now, I would like to forward each vehicle's telemetry data to my Android Application. What would be the easiest way? I would like to see some floating markers on my Map there...

I've read about TraCI to interact during a simulation, but I was not successful to make it run.

Ramana V V K
  • 1,245
  • 15
  • 24
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
  • Would like to help, need some additional information though. How are you handling the 'timestep' for each of the model objects? Are you simply pausing the entire model and dumping the current positions? Are you running the simulation, then trying to correlate the individual trajectories via the timestep objects? In the first pattern, the steps are already synchronized, so have the client make a REST call to obtain the 'current' positions for all model objects, parse on the client side, and display on a Transparent View layer above the GoogleMap View. – Dan Devine Jun 02 '17 at 20:57

1 Answers1

1

By reading the SUMO page it says that it generates output files in xml format, and that using python you can convert those files into csv files.

Those two formats can be parsed by mostly any programing language to extract the values you want to show or serve as input to what you would want to process and show.

You can make available the information to the mobile App through a web server as webservice that could be done in php, java, or asp for example.

For the webserver to be able to hand off the information, it has to have the data to deliver. This can be done by:

  • Preprocesing the files SUMO generated and upload to the web server a new file with the data to show already prepared. In this case you could opt to generate files in JSON format which is much easier to work with, or keep the XML/CSV format.

  • Or directly upload the raw files (XML/CSV) and have a web application on the server processe the information and deliver the results. The processing can be automated with some cron job on the server, or it can be triggered manual as part of the webservice api you will have to build.

In both cases, you could use a database on the server to store the data and perhaps provide some history functionality. Here you should take a look at how the data will be used, if it is just to download cooked information perhaps a No SQL database like mongo db would be a better option than a traditional relational db like mysql to mention two options.

The uploading of the file could be manual or automated with some secure ftp tool.

For the markers on the map, that is on the mobile app side. That is easily implemented with the Google Maps API. The information that is needed from the webserver is just the latitude and longitude for the marker. It can also be done from an address, but in that case there is an extra step to decode that into lat and long.

Juan
  • 5,525
  • 2
  • 15
  • 26