Commit 6277038d authored by nikaeinn's avatar nikaeinn

remove the OMG SUMO related files and update te top-level OMG and cmakefiles

parent 4787c975
......@@ -870,21 +870,16 @@ set(UTIL_SRC
${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_filename.c
${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_XML.c
${OPENAIR2_DIR}/UTIL/OCG/OCG_save_XML.c
${OPENAIR2_DIR}/UTIL/OMG/client_traci_OMG.c
${OPENAIR2_DIR}/UTIL/OMG/common.c
${OPENAIR2_DIR}/UTIL/OMG/grid.c
${OPENAIR2_DIR}/UTIL/OMG/id_manager.c
${OPENAIR2_DIR}/UTIL/OMG/job.c
${OPENAIR2_DIR}/UTIL/OMG/mobility_parser.c
${OPENAIR2_DIR}/UTIL/OMG/omg.c
${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c
${OPENAIR2_DIR}/UTIL/OMG/rwalk.c
${OPENAIR2_DIR}/UTIL/OMG/rwp.c
${OPENAIR2_DIR}/UTIL/OMG/sumo.c
${OPENAIR2_DIR}/UTIL/OMG/socket_traci_OMG.c
${OPENAIR2_DIR}/UTIL/OMG/static.c
${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c
${OPENAIR2_DIR}/UTIL/OMG/storage_traci_OMG.c
${OPENAIR2_DIR}/UTIL/OMG/trace.c
${OPENAIR2_DIR}/UTIL/OMG/trace_hashtable.c
${OPENAIR2_DIR}/UTIL/OPT/probe.c
......@@ -897,6 +892,15 @@ set(UTIL_SRC
)
add_library(UTIL ${UTIL_SRC})
#set(OMG_SUMO_SRC
# ${OPENAIR2_DIR}/UTIL/OMG/client_traci_OMG.c
# ${OPENAIR2_DIR}/UTIL/OMG/id_manager.c
# ${OPENAIR2_DIR}/UTIL/OMG/sumo.c
# ${OPENAIR2_DIR}/UTIL/OMG/socket_traci_OMG.c
# ${OPENAIR2_DIR}/UTIL/OMG/storage_traci_OMG.c
# )
#add_library(OMG_SUMO ${OMG_SUMO_SRC})
set(SECU_OSA_SRC
${OPENAIR2_DIR}/UTIL/OSA/osa_key_deriver.c
${OPENAIR2_DIR}/UTIL/OSA/osa_rijndael.c
......@@ -1752,7 +1756,6 @@ add_executable(oaisim
${OPENAIR_TARGETS}/SIMU/USER/oaisim.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR2_DIR}/UTIL/OMG/sumo.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${GTPU_need_ITTI}
${OPENAIR_TARGETS}/COMMON/create_tasks.c
......
----------------------------------------------------------------------------------
OpenAir Mobility Generator (OMG) - Mobility provided by the SUMO simulator
----------------------------------------------------------------------------------
Notes:
- The Simulation of Urban Mobility (SUMO) needs to be downloaded, configured and compiled. Please download the sources from this address
http://sumo.sourceforge.net/
or alternatively chechout from the following SUMO svn
svn co https://sumo.svn.sourceforge.net/svnroot/sumo/trunk/sumo sumo
(among the other required packages for SUMO, you also need the following tools for SUMO compilation. Please use the following command to install:
sudo apt-get install build-essential autoconf buildtool)
and follow the installation instructions at http://sumo.sourceforge.net/doc/current/docs/userdoc/Installing.html
- OMG will look for the SUMO and SUMO-GUI exectuable from this SUMO folder.
- SUMO/SCENARIOS is the default folder for SUMO scenarios. Please add all required scenario on that folder.
- OMG will launch SUMO with one single SUMO config file. Please regoup all your SUMO XML files (network, route et others) in one .cfg file. More details on the SUMO website.
- SUMO will be lauched using the following command
sumo -c scen.sumo.cfg -b 0 -e 1000 -v
or, if you want to enable TraCI server (here as example listening on port 8883). Please bear in mind that this launch will be blocking upon a TraCI client
sumo -c scen.sumo.cfg -b 0 -e 1000 -remote-port 8883 -v
or, if you prefer the SUMO GUI and select manually the scenario file on the GUI window
sumo-gui
- Once installation completed, please check that SUMO is working properly by following the STANDALONE scenario
- GUI: lauch: sumo-gui
load: scen.sumo.cfg
- CommandLine: sumo -c scen.sumo.cfg -b 0 -e 1000 -v
----------------------------------------------------------------------------------
The OpenAirInterface Team
openair_tech@eurecom.fr
----------------------------------------------------------------------------------
<configuration>
<input>
<net-file value="traci_ex_Map.net.xml"/>
<route-files value="traci_ex_ROU.rou.xml"/>
<!-- <additional-files value="test.add.xml"/> -->
</input>
</configuration>
Sumo version used 0.12.3:
to start sumo with the existing route and network files below command was used.
sumo -n traci_ex_Map.net.xml -r traci_ex_ROU.rou.xml -b 0 -e 1000 --remote-port 8883 -v
\ No newline at end of file
<configuration>
<input>
<net-file value="traci_ex_Map.net.xml"/>
<route-files value="traci_ex_ROU.rou.xml"/>
<!-- <additional-files value="test.add.xml"/> -->
</input>
<simulation>
<begin>0</begin>
<end>200</end>
</simulation>
<traci_server>
<remote-port>8890</remote-port>
</traci_server>
</configuration>
This diff is collapsed.
<?xml version="1.0"?>
<!-- generated on 08/19/09 15:48:50 by SUMO duarouter Version 0.11.0
<configuration>
<input
net-file="C:\For_MOVE\MOVE_example\ex_Map.net.xml"
flow-definition="C:\For_MOVE\MOVE_example\ex_FLOW.flow.xml"
/>
<output
output-file="C:\For_MOVE\MOVE_example\ex_ROU.rou.xml"
/>
<processing
continue-on-unbuild="true"
/>
<time
begin="0"
end="1000"
/>
<report
verbose="true"
suppress-warnings="true"
/>
</configuration>
-->
<routes>
<vehicle id="0" depart="0">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="1" depart="10">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="2" depart="20">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="3" depart="30">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="4" depart="40">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="5" depart="50">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="6" depart="60">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="7" depart="70">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="8" depart="80">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="9" depart="90">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="10" depart="100">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="11" depart="110">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="12" depart="120">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="13" depart="130">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="14" depart="140">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="15" depart="150">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="16" depart="160">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="17" depart="170">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="18" depart="180">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="19" depart="190">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="20" depart="200">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="21" depart="210">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="22" depart="220">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="23" depart="230">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="24" depart="240">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="25" depart="250">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="26" depart="260">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="27" depart="270">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="28" depart="280">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="29" depart="290">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="30" depart="300">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="31" depart="310">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="32" depart="320">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="33" depart="330">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="34" depart="340">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="35" depart="350">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="36" depart="360">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="37" depart="370">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="38" depart="380">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="39" depart="390">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="40" depart="400">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="41" depart="410">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="42" depart="420">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="43" depart="430">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="44" depart="440">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="45" depart="450">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="46" depart="460">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="47" depart="470">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="48" depart="480">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="49" depart="490">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="50" depart="500">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="51" depart="510">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="52" depart="520">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="53" depart="530">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="54" depart="540">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="55" depart="550">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="56" depart="560">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="57" depart="570">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="58" depart="580">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="59" depart="590">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="60" depart="600">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="61" depart="610">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="62" depart="620">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="63" depart="630">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="64" depart="640">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="65" depart="650">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="66" depart="660">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="67" depart="670">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="68" depart="680">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="69" depart="690">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="70" depart="700">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="71" depart="710">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="72" depart="720">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="73" depart="730">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="74" depart="740">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="75" depart="750">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="76" depart="760">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="77" depart="770">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="78" depart="780">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="79" depart="790">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="80" depart="800">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="81" depart="810">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="82" depart="820">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="83" depart="830">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="84" depart="840">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="85" depart="850">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="86" depart="860">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="87" depart="870">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="88" depart="880">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="89" depart="890">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="90" depart="900">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="91" depart="910">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="92" depart="920">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="93" depart="930">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="94" depart="940">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="95" depart="950">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="96" depart="960">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="97" depart="970">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="98" depart="980">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
<vehicle id="99" depart="990">
<route edges="edgeD-2-0 edgeR-2-0 edgeD-1-1 edgeR-1-1 edgeD-0-2"/>
</vehicle>
</routes>
#ifndef TRACICONSTANTS_H
#define TRACICONSTANTS_H
// command: subscribe simulation variable
#define CMD_SUBSCRIBE_SIM_VARIABLE 0xdb
// departed vehicle ids (get: simulation)
#define VAR_DEPARTED_VEHICLES_IDS 0x74
// command: simulation step (new version)
#define CMD_SIMSTEP2 0x02
// command: close sumo
#define CMD_CLOSE 0x7F
// command: get vehicle variable
#define CMD_GET_VEHICLE_VARIABLE 0xa4
// command: Scenario
#define CMD_SCENARIO 0x73
// max count of vehicles
#define DOMVAR_MAXCOUNT 0x0A
// 32 bit integer
#define TYPE_INTEGER 0x09
// speed of a node
#define DOMVAR_SPEED 0x04
// position of a domain object
#define DOMVAR_POSITION 0x02
// position (2D) (get: vehicle, poi, set: poi)
#define VAR_POSITION 0x42
// speed (get: vehicle)
#define VAR_SPEED 0x40
// position of a domain object
#define DOMVAR_POSITION 0x02
// ids of arrived vehicles (get: simulation)
#define VAR_ARRIVED_VEHICLES_IDS 0x7a
// ****************************************
// RESULT TYPES
// ****************************************
// result type: Ok
#define RTYPE_OK 0x00
#endif
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file client_traci_OMG.c
* \brief The OMG TraCI to send/receive commands from/to SUMO via socket interfaces.
* \author S. Uppoor, J. Harri
* \date 2012
* \version 0.1
* \company INRIA, Eurecom
* \email: sandesh.uppor@inria.fr, haerri@eurecom.fr
* \note
* \warning
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
#include <string.h>
#include "client_traci_OMG.h"
#include "TraCIConstants.h"
#define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE)
int handshake(char *hoststr,int portno)
{
check_endianness(); // check endianness
int i;
for(i = 0; i< 10; i++) {
if ( connection_(hoststr,portno) <0 ) {
#ifdef STANDALONE
printf("connection error...trying again in 3 seconds\n");
#else
LOG_E(OMG, " Could not connect to TraCIServer - sleeping before trying again...\n");
#endif
sleep(5);
} else {
#ifdef STANDALONE
printf(" SUMO now connected to OMG on host address\n");
#else
LOG_N(OMG, " SUMO now connected to OMG on host address %s and port %i .\n", hoststr, portno);
#endif
return 0;
}
}
#ifdef STANDALONE
printf(" SUMO unreachable...giving up...\n");
#else
LOG_E(OMG, " SUMO unreachable...giving up...\n");
#endif
return -1;
}
void init(int max_sim_time)
{
#ifdef STANDALONE
printf(" Initializing TraCI...\n");
#else
LOG_N(OMG, " Initializing TraCI...\n");
#endif
char *objID = " ";
// size_t size = strlen(objID);
int noSubscribedVars = 2;
writeUnsignedByte(0);
writeInt(1 + 4 + 1 + 4 + 4 + 4 + (int) strlen(objID) + 1 + noSubscribedVars);
writeUnsignedByte(CMD_SUBSCRIBE_SIM_VARIABLE); // command id
writeInt(0); // begin time
writeInt(max_sim_time*1000); // end time
writeString(objID); // object id