Skip to content

barbosaleo98/V2X-Politecnico

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

V2X-Politecnico

Simulation of a wireless communication in a V2X network using the framework Veins

Final project of the class "EELT7002 - Data Communication Networks"

Objective:

Simulate a V2V (vehicle-to-vechicle) communication scenario using the framework Veins

Project characteristics:

  • 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

proposed route

Map modeling and traffic simulation

The base map for the simulations was obtained in https://www.openstreetmap.org as an .osm file:

OpenStreetMap

And after that, the file was visualized and unecessary elements were removed using the program Java OpenStreetMap editor (JOSM):

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:

Netedit map

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:

SUMO simulation

Network Simulation

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:

Canvas view OMNeTpp

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:

accident_detection

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:

accident_signal

accident_alert

The other vehicles will approach the leader vehicle and brake, waiting for it to start moving again.

approach

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.

About

V2X simulation on UFPR Campus "Centro Politecnico" using Veins and based on the "veins_inet" example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published