Emission of Gases by Vehicles using SUMO
In this post, we will be discussing how floating cars can emit gases namelyCarbon Monoxide (CO)
Carbon Dioxide (CO2)
Hydro Carbons (HC)
Particle Matter (PMx)
Nitrous Oxide (NOx)
SUMO generates this emission of gases based on the EU4 norms. How to capture these gases in our simulation?
The following video contains complete information
Prerequisites
1. SUMO to be installed in Ubuntu (SUMO installation)
2. Python3 to be installed
3. Knowledge of XML files
The following is the image of the road design I have created,
there are a totally of 6 junctions ( 0 to 5) and two edges from one junction to another intersection (each edge has two lanes). All the junctions are priority junctions except 2 and 5. These junctions are traffic light junctions.
Custom road design in SUMO |
We are going to design a custom road.
In our machine, I will store all the files in a folder called
/home/pradeepkumar/customroad
Step 1: Creation of a node file that contains the information about the junctions
Extension of the file would be .nod.xml
<nodes> <!-- The opening tag -->
<node id="0" x="400.0" y="700.0" type="priority"/> <!-- def. of node "0" -->
<node id="1" x="700.0" y="700.0" type="priority"/> <!-- def. of node "1" -->
<node id="2" x="900.0" y="500.0" type="traffic_light"/>
<node id="3" x="700.0" y="300.0" type="priority"/>
<node id="4" x="400.0" y="300.0" type="priority"/> <!-- def. of node "4" -->
<node id="5" x="200.0" y="500.0" type="traffic_light"/>
</nodes> <!-- The closing tag -->
Step 2: Creation of edges (roads connecting the junction).
Extn: .edg.xml
<edges>
<edge id="l01" from="0" to="1" priority="2" numLanes="2" speed="11.11"/>
<edge id="r01" from="1" to="0" priority="3" numLanes="2" speed="13.89"/>
<edge id="u12" from="1" to="2" priority="1" numLanes="2" speed="11.11"/>
<edge id="d12" from="2" to="1" priority="2" numLanes="2" speed="11.11"/>
<edge id="d23" from="2" to="3" priority="3" numLanes="2" speed="13.89"/>
<edge id="u23" from="3" to="2" priority="1" numLanes="2" speed="11.11"/>
<edge id="l43" from="3" to="4" priority="2" numLanes="2" speed="11.11"/>
<edge id="r43" from="4" to="3" priority="3" numLanes="2" speed="13.89"/>
<edge id="d54" from="5" to="4" priority="1" numLanes="2" speed="11.11"/>
<edge id="u54" from="4" to="5" priority="2" numLanes="2" speed="11.11"/>
<edge id="d05" from="0" to="5" priority="3" numLanes="2" speed="13.89"/>
<edge id="u05" from="5" to="0" priority="1" numLanes="2" speed="11.11"/>
<edge id="l52" from="5" to="2" priority="3" numLanes="2" speed="13.89"/>
<edge id="r52" from="2" to="5" priority="1" numLanes="2" speed="11.11"/>
</edges>
Step 3: create a net.xml file using the node and edge files.
$ netconvert -n file.nod.xml -e file.edg.xml -o file.net.xml
$ The location of the file in my machine is /home/pradeepkumar/customroad/
Step 4: Creation of random trips
There is a file called
tools/randomTrips.py that can generate vehicles on the network
$ python3 ../sumo/tools/randomTrips.py -n file.net.xml -r file.rou.xml -b 0 -e 1000 -l
Step 5: Create a file called file.sumo.cfg (to run with sumo for air pollution)
<configuration>
<input>
<net-file value="file.net.xml"/>
<route-files value="file.rou.xml"/>
</input>
<time>
<begin value="0"/>
<end value="1000"/>
<step-length value="0.5"/>
</time>
</configuration>
$ sumo-gui file.sumo.cfg
Here is the screenshot of the roads and the traffic light junctions
$ sumo -c file.sumo.cfg --emission-output emission.xml --emission-output.geo --battery-output battery.xml --fcd-output car.xml --summary-output summary.xml --collision-output collision.xml --statistic-output stats.xml
To convert the XML files into CSV files, here is the step
Convert the emission.xml to emission.csv file
$ python3 ../sumo/tools/xml/xml2csv.py emission.xml -o emission.csv
Here is the file content of the emission.csv file. Using these data, we can predict or analyze various results of the emission of gases to counter air pollution. These kinds of systems can be demonstrated as Automotive cyber-physical systems
This example shows the emission data of floating cars in SUMO simulation.
The roads are user-designed roads.
Thanks for watching
https://github.com/tspradeepkumar
https://www.nsnam.com
Comments
Post a Comment