omnet sumo

310 views
Skip to first unread message

Ezdhar Shaleesh

unread,
May 24, 2019, 4:46:50 PM5/24/19
to OMNeT++ Users
Hello my friends
I apologize for my question here .... Can anyone help me
A network was created for the city of Cologne and I was able to create it using a copy  sumo -0.25.0 on Windows
But I want to run it on Linux(virtualbox) ... but it does not work
Try to create it again in Linux and follow the same steps but it does not work
Please help and thank you

Eduardo Cooper

unread,
May 26, 2019, 1:27:34 PM5/26/19
to OMNeT++ Users
Can you be more specific as to why it doesn't work? If you are running it in Linux virtual machine (I assume Ubuntu?) why not try it with a more recent version of SUMO?

Ezdhar Shaleesh

unread,
May 26, 2019, 2:53:34 PM5/26/19
to OMNeT++ Users
i am work on prext (omnet 5.0,sumo -0.25.0,veins 4.4)(linux,Ubuntu )(virtualBox)
 I creat of cologne  map on windows OS using SUMO 0.32.0, and I try to creat it on linux using SUMO-0.25.0 
SO, Could you help me to send the steps of creat map on SUMO -0.25-0 ON LINUX ....
image.png


--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/b747e235-a75b-476f-a37b-ac856e25690a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ezdhar Shaleesh

unread,
May 26, 2019, 3:10:33 PM5/26/19
to OMNeT++ Users
image.png
this is OS on virtualBOX 

Eduardo Cooper

unread,
May 26, 2019, 4:13:29 PM5/26/19
to omn...@googlegroups.com

This should work for your SUMO version. You can also install version 32.


Setting Up Veins

Packages needed for both SUMO and OmNet++

sudo apt-get install autoconf python python3 gcc g++ automake libtool

Package Install for SUMO

sudo apt-get install cmake libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev swig blt  

Package Install for OmNet++

sudo apt-get install bison flex perl tcl-dev tk-dev libxml2-dev zlib1g-dev default-jre doxygen graphviz libwebkitgtk-1.0 openmpi-bin libopenmpi-dev libpcap-dev openscenegraph-plugin-osgearth libosgearth-dev libcanberra-gtk-module libcanberra-gtk3-module nemiver qt5-default libqt5opengl5-dev qtdeclarative5-dev 

Must use java version 8 (Omnet++ version 5.4.1 will not work with java jdk-11)

sudo apt install openjdk-8-jdk
update-alternatives --list  java 
sudo update-alternatives --config java

Download SUMO version 0.32 (newer versions not yet compatible with Veins)

After moving sumo-src-0.32.0.tar.gz to home folder
tar xvfz sumo-src-0.32.0.tar.gz
Do the same for Omnet++ Version 5.4.1 (omnetpp-5.4.1-src.tgz) and Veins 4.7.1 (veins-4.7.1.zip)

Change path of SUMO and Omnet++

In home folder
gedit ~/.profile
Add these three lines in the end:
export SUMO_HOME="/home/<user>/sumo-<version>"
export PATH=$PATH:/home/<user>/omnetpp-<version>/bin
export PATH=$PATH:/home/<user>/sumo-<version>/bin
Example:
export SUMO_HOME="/home/username/sumo-0.32.0"

export PATH=$PATH:/home/username/omnetpp-5.4.1/bin

export PATH=$PATH:/home/username/sumo-0.32.0/bin
Restart session to confirm changes

Configure and Make SUMO

In home folder
cd sumo-0.32.0
./configure
make -j4

Configure and Make OmNet++

In home folder
cd omnetpp-5.4.1
./configure
make -j4
make install-menu-item
make install-desktop-icon

Build Veins Module Framework

In home folder
omnetpp
In Omnet IDE
File > Import > General:Existing Projects into Workspace > select veins-veins-4.7.1 directory
Project > Build All 

Test SUMO

In home folder
cd/home/username/veins-veins-4.7.1/examples/veins/
sumo -c erlangen.sumo.cfg
You should see the line "Loading configuration... done." You might or might not see a count from 0 to 1000
If you don't see it then type
sumo-gui -c erlangen.sumo.cfg
This should open a scenario with a count from 0 to 1000

Running a Veins scenario

Run this script
 python /home/username/veins-veins-4.7.1/sumo-launchd.py -vv -c /home/username/sumo-0.32.0/bin/sumo
This script will proxy TCP connections between OMNeT++ and SUMO, starting a new copy of the SUMO simulation for every OMNeT++ simulation connecting.
Leave terminal open and start Omnet++ IDE
File > Open File > Veins folder > examples > veins > omnetpp.ini > Ok 
Run > Run As > Omnet++ Simulation > Default configuration > Ok > Run Button (top Left)
Use Zoom-Out button to see all the scenario. The scenario is an RSU that communicates with vehicles after an accident
For ease of use
cd /home/username/omnetpp-5.4.1/ 
gedit .profile
Add this line
export PATH=$PATH:/home/username/sumo-0.32.0/bin
This will save the user from having to specify the full path to their sumo binary every time they have to start the launchd python script


On Sunday, May 26, 2019 at 3:10:33 PM UTC-4, Ezdhar Shaleesh wrote:
image.png
this is OS on virtualBOX 

On Sun, May 26, 2019 at 9:53 PM Ezdhar Shaleesh <eng.ezdh...@gmail.com> wrote:
i am work on prext (omnet 5.0,sumo -0.25.0,veins 4.4)(linux,Ubuntu )(virtualBox)
 I creat of cologne  map on windows OS using SUMO 0.32.0, and I try to creat it on linux using SUMO-0.25.0 
SO, Could you help me to send the steps of creat map on SUMO -0.25-0 ON LINUX ....
image.png


On Sun, May 26, 2019 at 8:27 PM Eduardo Cooper <ezav...@gmail.com> wrote:
Can you be more specific as to why it doesn't work? If you are running it in Linux virtual machine (I assume Ubuntu?) why not try it with a more recent version of SUMO?

On Friday, May 24, 2019 at 4:46:50 PM UTC-4, Ezdhar Shaleesh wrote:
Hello my friends
I apologize for my question here .... Can anyone help me
A network was created for the city of Cologne and I was able to create it using a copy  sumo -0.25.0 on Windows
But I want to run it on Linux(virtualbox) ... but it does not work
Try to create it again in Linux and follow the same steps but it does not work
Please help and thank you

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

Eduardo Cooper

unread,
May 26, 2019, 4:14:31 PM5/26/19
to omn...@googlegroups.com

Using SUMO

Real-World Scenario

The easiest way to quickly build up a real world scenario is through OsmWebWizard, explained in this osmWebWizard Tutorial. The files needed to create the simulation will be located in the sumo/tools/date-of-creation/ folder. Note that you can change the color of objects in the simulation by going to Visual Settings (color wheel, top left), such as Vehicles > Color > color by speed. If you follow the simulation long enough, you will notice that traffic jams appear as busy intersections get blocked. To remedy this, it is better to build a simulation from scratch.

Using OpenStreetMap

A map can be downloaded as an .osm file that will later be converted to a SUMO-readable file. This map can either be an area of a city or an entire city. Note that another way of obtaining a SUMO-readable file directly from a given area is to locate the osm.net.xml file created through the osmWebWizard method, located in the folder mentioned in the preceding section.

Download an area of a city

Simply go to OpenStreetMap, type in a location, adjust the zoom to acquire a desired area, click on "Export" tab, then on Export.

Download an entire city

This is a bit more complicated, as you need a couple of things before being able to download the area containing a city. You need to use the Overpass API Query Form and submit a query such as:

<query type="relation">
<has-kv k="boundary" v="administrative"/>
<has-kv k="name" v="Chattanooga"/>
</query>
<print mode="body"/>

Where "Chattanooga" can be replaced by any city you wish to search for. The output of the query is a list of possible cities with given "relation ids." The id obtained by the previous query was 197273. After making sure the id matches the city you are looking for, add 3,600,000,000 to the id. This integer will be used in another Overpass API Query with the following format:

<osm-script timeout="180" element-limit="20000000">
 <union>
   <area-query ref="3600197273"/>
   <recurse type="node-relation" into="rels"/>
   <recurse type="node-way"/>
   <recurse type="way-relation"/>
 </union>
 <union>
   <item/>
   <recurse type="way-node"/>
 </union>
 <print mode="body"/>
 </osm-script>

Where the field "area-query ref" matches the previously obtained integer. A query will generate the according .osm file of the area within the city's bounds.

Converting osm files

Now that we have obtained an .osm file, we can use the utility netconverter to convert the file in a SUMO-readable format. If you have set up the path and environment variables accordingly (see Set-up-Veins section), you can move to the folder where the .osm file is located, and issue the netconverter command, along with these options:

netconvert --osm-files map.osm --geometry.remove true --roundabouts.guess true --ramps.guess true --junctions.join true 
--tls.guess-signals true --tls.discard-simple true --tls.join true --output.street-names true --sidewalks.guess true 
--output.original-names true -o map.net.xml

Note that these are just general settings designed to polish the map created for the simulation. Many refinements can be added, including a Public Transportation System. Additionally, if one selects Import Public Transport in the osmWebWizard application before generating a scenario, public transportation files will be automatically generated for the given area selected.

Importing and Adding Polygons

Polygons refer to the color-coded forms that delineate things outside of the roads themselves within a simulation. These include: buildings, specific pedestrian areas, and bodies of water, among others. In order to assign a set of values to these, you need to create a typemap file. You can start by doing gedit typemap.xml within the folder where your map.osm and map.net.xml are located. You can create a custom file, or you can copy and paste this generic setup:

<polygonTypes>
    <polygonType id="waterway"                name="water"       color=".71,.82,.82" layer="-4"/>
    <polygonType id="natural"                 name="natural"     color=".55,.77,.42" layer="-4"/>
    <polygonType id="natural.water"           name="water"       color=".71,.82,.82" layer="-4"/>
    <polygonType id="natural.wetland"         name="water"       color=".71,.82,.82" layer="-4"/>
    <polygonType id="natural.wood"            name="forest"      color=".55,.77,.42" layer="-4"/>
    <polygonType id="natural.land"            name="land"        color=".98,.87,.46" layer="-4"/>

    <polygonType id="landuse"                 name="landuse"     color=".76,.76,.51" layer="-3"/>
    <polygonType id="landuse.forest"          name="forest"      color=".55,.77,.42" layer="-3"/>
    <polygonType id="landuse.park"            name="park"        color=".81,.96,.79" layer="-3"/>
    <polygonType id="landuse.residential"     name="residential" color=".92,.92,.89" layer="-3"/>
    <polygonType id="landuse.commercial"      name="commercial"  color=".82,.82,.80" layer="-3"/>
    <polygonType id="landuse.industrial"      name="industrial"  color=".82,.82,.80" layer="-3"/>
    <polygonType id="landuse.military"        name="military"    color=".60,.60,.36" layer="-3"/>
    <polygonType id="landuse.farm"            name="farm"        color=".95,.95,.80" layer="-3"/>
    <polygonType id="landuse.greenfield"      name="farm"        color=".95,.95,.80" layer="-3"/>
    <polygonType id="landuse.village_green"   name="farm"        color=".95,.95,.80" layer="-3"/>

    <polygonType id="tourism"                 name="tourism"     color=".81,.96,.79" layer="-2"/>
    <polygonType id="military"                name="military"    color=".60,.60,.36" layer="-2"/>
    <polygonType id="sport"                   name="sport"       color=".31,.90,.49" layer="-2"/>
    <polygonType id="leisure"                 name="leisure"     color=".81,.96,.79" layer="-2"/>
    <polygonType id="leisure.park"            name="tourism"     color=".81,.96,.79" layer="-2"/>
    <polygonType id="aeroway"                 name="aeroway"     color=".50,.50,.50" layer="-2"/>
    <polygonType id="aerialway"               name="aerialway"   color=".20,.20,.20" layer="-2"/>

    <polygonType id="shop"                    name="shop"        color=".93,.78,1.0" layer="-1"/>
    <polygonType id="historic"                name="historic"    color=".50,1.0,.50" layer="-1"/>
    <polygonType id="man_made"                name="building"    color="1.0,.90,.90" layer="-1"/>
    <polygonType id="building"                name="building"    color="1.0,.90,.90" layer="-1"/>
    <polygonType id="amenity"                 name="amenity"     color=".93,.78,.78" layer="-1"/>
    <polygonType id="amenity.parking"         name="parking"     color=".72,.72,.70" layer="-1"/>
    <polygonType id="power"                   name="power"       color=".10,.10,.30" layer="-1" discard="true"/>
    <polygonType id="highway"                 name="highway"     color=".10,.10,.10" layer="-1" discard="true"/>
    <polygonType id="railway"                 name="railway"     color=".10,.10,.10" layer="-1" discard="true"/>

    <polygonType id="boundary" name="boundary"    color="1.0,.33,.33" layer="0" fill="false" discard="true"/>
    <polygonType id="admin_level" name="admin_level"    color="1.0,.33,.33" layer="0" fill="false" discard="true"/>
</polygonTypes>

You can, of course, edit this file to suit your needs. Then, you can merge the polygons with your OSM data to create a polygon file using the utility Polyconvert:

polyconvert --net-file map.net.xml --osm-files map.osm --type-file typemap.xml -o map.poly.xml

Creating a Route File

Since the simulation must be populated by vehicles, we can create a route file using the script randomTrips.py, like this:

python /home/username/sumo-0.32.0/tools/randomTrips.py -n map.net.xml -r map.rou.xml -e 1500 --length

This script means that we are using the road network file created from OSM data -n, we are calling the utility Duarouter -r, which creates route files, to act on an intermediate file trips.trips.xml and outputing to the route file map.rou.xml. The end time -e option is used to define the total number of vehicle routes created. Since one route is created per second (one can change this default by using the -p option followed by an integer denoting the number of repetitions per second), and -e is the limit of the routing in seconds, then we have created a total of 1500 unique vehicle routes. The --length option is for weighting edge probability by edge (road) length.

Optional: Dynamic User Assignment

One of the reasons a user might see traffic jams occurring frequently when a high enough number of vehicles are included in the simulation is that, by default, the vehicles follow the random route assigned to them via the Djikstra (shortest-path) algorithm. Something that can alleviate this is using the script duaIterate, which accomplishes near approximation to dynamic user equilibrium. You can use it like this:

python /home/username/sumo-0.32.0/tools/assign/duaIterate.py -n map.net.xml -t trips.trips.xml -l X

Where -n denotes a net file and -t a trips file as input, and -l denotes the number of iterations (X) that the user decides are enough to reach an equilibrium. Note that if X is very large, the command may cause a lot of disk space to be occupied, because a route file for every iteration will be created. Typically, it is best to choose the very last output file, or the file with the largest iteration value. Note also that if a lot of edges are created using an area of a city, this command will output an error file explaining some of the vehicles did not have valid routes that could be iterated over. If this is the case, then another way to alleviate traffic jams is to include a different routing algorith in the the simulation's config file. The available algorithms include: 'dijkstra', 'astar' (A* algorithm), 'CH'(Contraction Hierarchies), and 'CHWrapper.'The user might also be interested in using a Macroscopic Approach at dynamic user assingment.

Creating a Configuration File

We have previously created several map, route, and trip files that can be included in the simulation. In order to do this, a sumo .config file must be created. This saves the user from having to type all options and configurations after a call to the sumo or sumo-gui executable files.

A configuration file has an XML format. To include an option, simply write the configuration option name, followed by value="value of option". For example, if you wish to include a given network file, the correct syntax is <net-file value="some-file.net.xml"/>. Note that there are many SUMO Options that can be included in the configuration file. The config file can be created in the home/username/ folder by doing gedit map.sumocfg Here is a simple configuration that will group the all the necessary roads/routes/trips files we have created in this section:

<?xml version="1.0" encoding="UTF-8"?>

<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">

    <input>
        <net-file value="map.net.xml"/>
        <route-files value="map.rou.xml"/>
        <additional-files value="map.poly.xml"/>
    </input>

    <time>
        <begin value="0"/>
        <end value="640"/>
    </time>
    
    <routing>
        <routing-algorithm value="astar"/>
    </routing>
   
   <report>
        <error-log value= "map-error.txt"/>
    </report>

</configuration>

You can then run with either sumo-gui -c map.sumocfg or sumo-gui map.sumocfg.

This basic simulation will run for 640 s, and will feature 1500 vehicles with random routes. Make sure to select "real world" from the dropdown menu (top left, next to the color wheel) to see all the different imported polygons, and a delay of 250 ms (top center) so that you can see all the vehicles going around the map. Make sure to zoom in; depending on how large the map area is, it might be difficult to see the vehicles at first. Note that this scenario does not contain the great amount of info that can be included in a SUMO simulation, evidenced by the amount of data that the simulation done with the osmWebWizard has. Many more routes, like bus, bycicles, and pedestrian routes, can be included, not just regular cars. Hopefully this section explains the basics of building a real world scenario in SUMO.

As a final note, it might be worthwhile to look at the Activity Based Demand Generation which is somewhat more organic way of populating your SUMO simulation.

Source: SUMO Documentation


On Friday, May 24, 2019 at 4:46:50 PM UTC-4, Ezdhar Shaleesh wrote:

Ezdhar Shaleesh

unread,
May 26, 2019, 4:44:57 PM5/26/19
to OMNeT++ Users

Can I perform these steps on sumo-0.25.0???
Because I work on the Prext ( For privacy in vanet ) applicable within omnet 5.0,sumo-0.25.0, veins 4.4 

To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

Eduardo Cooper

unread,
May 26, 2019, 4:56:08 PM5/26/19
to omn...@googlegroups.com
I believe you can, if not, you could tweak some instructions to suit your needs, but this should be generic enough for you to use. Keep in mind that you need to do everything to reflect your versions. But like I said, this is the generic way to create a SUMO scenario. There might be some features missing, like osmWebWizard, so just check first and if it doesn't work try to find info on your version's implementation.

Ezdhar Shaleesh

unread,
May 26, 2019, 6:48:00 PM5/26/19
to OMNeT++ Users
thank you very much ....
have you any way to convert the network in sumo-0.32.0  on Windows7 OS to work on sumo-0.25.0 ??? i mean the Instruction or program؟؟
i try a lot of to download sumo-0.25.0 , but the error is still  now which was , the could not open the sumo-0.25.0/data/typemap/osmnetconvert.typ.xml ???
any way to run the network on linux ???



Ezdhar Shaleesh

unread,
May 26, 2019, 7:12:59 PM5/26/19
to OMNeT++ Users
this is error when i move the network from sumo-0..32.0 on Windows OS to sumo-0.25.0 in Linux (virtualBox)

Ezdhar Shaleesh

unread,
May 26, 2019, 7:27:11 PM5/26/19
to OMNeT++ Users
thank you very much , the network is run now  on linux ......

Eduardo Cooper

unread,
May 26, 2019, 10:09:48 PM5/26/19
to OMNeT++ Users
Did you get it working then? 


On Sunday, May 26, 2019 at 7:27:11 PM UTC-4, Ezdhar Shaleesh wrote:
thank you very much , the network is run now  on linux ......


On Mon, May 27, 2019 at 2:12 AM Ezdhar Shaleesh <eng.ezdh...@gmail.com> wrote:
this is error when i move the network from sumo-0..32.0 on Windows OS to sumo-0.25.0 in Linux (virtualBox)

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.

Ezdhar Shaleesh

unread,
May 27, 2019, 3:48:28 AM5/27/19
to OMNeT++ Users
YES ...this is on sumo-0.25.0 om linux 

image.png
and yhis is run in omnetpp++
image.png

To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages