Final project of the class "EELT7002 - Data Communication Networks"
Simulate a V2V (vehicle-to-vechicle) communication scenario using the framework Veins
- Collision avoidance simulation
- Involves many connected vehicles in a line
- The first vehicle detects an accident in the road, brakes and alerts the other cars to do the same
- The scenario is modeled using the UFPR's campus "Centro Politécnico", with the route starting in one of the entrances and the braking will take place in front of the parking lot of the Electrical Engineering Department
- The framework Veins is utilized to manage the traffic and network simulations
The base map for the simulations was obtained in https://www.openstreetmap.org as an .osm
file:
And after that, the file was visualized and unecessary elements were removed using the program Java OpenStreetMap editor (JOSM):
The politecnico.osm
file was then converted to a politecnico.net.xml
file using the SUMO tool called netconvert with the following command:
netconvert --osm-files politecnico.osm --output-file politecnico.net.xml --geometry.remove --roundabouts.guess --ramps.guess --junctions.join --tls.guess-signals --tls.discard-simple --tls.join
That uses many optional parameters, such as --geometry.remove
to simplify the model.
The generated net file is then visualized and further adjusted using the netedit tool from SUMO:
That is also used to identify the ID of each road that will be used in the traffic simulation. In this particular case, the selected roads had to also be configured to allow cars to circulate on them, because the original osm file only permitted pedestrians and bicycles on the campus, which is not true to the real-life traffic on the area. Using these road IDs, a politecnico.route.xml
was created, where a flow of 5 identical cars was defined for the SUMO simulation.
Finally, a SUMO configuration politecnico.sumo.cfg
was created, pointing to the politecnico.net.xml
and politecnico.route.xml
files and defining a total simulation of 100 seconds. Opening this file in the SUMO GUI, the simulation can ben run and visualized:
The network is modeled through the use of NED, ini and C++ source files that have been created or modified in order to generate a OMNeT++ simulation. Various existing modules are contained in the Veins framework, which is responsible for providing the connection of the traffic and wireless simulations through the TraCI API.
The implemented simulation scenario can be observed with the use of the canvas feature of Veins:
In this window, the network nodes can be seen moving through the map, change color depending on events and the transmitted package are also presented through animations. In the scenario for this project the car 0 detects a risky environment (e.g. a temporary road blockage) at 80 seconds, changes its color to red and then brakes:
This node then sends a message to notify the other cars that it did detect a potential accident. At this point, the car 0 turns green and all other cars that have been successfully alerted also change color:
The other vehicles will approach the leader vehicle and brake, waiting for it to start moving again.
After 10 seconds, car 0 considers that the road is clear again and the convoy resume its driving towards the final coordinate of the route. The simulation then ends shortly after the cars finished their trajectory, at 100 seconds.