omnet++ - Why does Veins crash when commandSetSpeedMode() is used? -


i trying simulate scenario in veins want disable right of way checks @ road junctions. looked @ sumo wiki , found bitset 23 purpose. lookup in tracimobility.h header bundled veins helped me know can done using function commandsetspeedmode() tracidemo11p node models vehicles in veins demo simulation. trying build model using demo bundled veins.

but trying so, sumo crashes. trying initialize nodes in initialize() function of tracidemo11p through following code:

void tracidemo11p::initialize(int stage) {     basewaveappllayer::initialize(stage);     if (stage == 0) {         traci = tracimobilityaccess().get(getparentmodule());         annotations = annotationmanageraccess().getifexists();         assert(annotations);          traci->commandsetspeedmode(23);  // point of modification          sentmessage = false;         lastdroveat = simtime();         findhost()->subscribe(parkingstatechangedsignal, this);         isparking = false;         sendwhileparking = par("sendwhileparking").boolvalue();     } } 

i tried set modes other standard values such 0 or 31, every time sumo crashed. unable figure out else should place command. tried set mode in other initialization stage adding else clause crashes still. what's more, eve nthe debugger on, no error being shown, either in omnet++ window or sumolaunchd.py output in omnet++ cmd. please understand error. thanks.


edit: adding error message info

to make things clear, not receiving error message exit code. searched code got no help. usual 'this app not responding' window pops , sim ends, suspect sumo crash.

the omnet++ environment shows following message:

simulation terminated exit code: -1073741819 working directory: c:/users/stes-2/veins-3.0/examples/cross roads command line: c:/users/stes-2/omnetpp-4.4/bin/opp_run.exe -r 0 -n ../veins;../../src --tkenv-image-path=../../images -l ../../src/veins omnetpp.ini  environment variables: omnetpp_root=c:/users/stes-2/omnetpp-4.4 path=;c:/users/stes-2/veins-3.0/src;c:\users\stes-2\omnetpp-4.4\bin;c:\users\stes-2\omnetpp-4.4\msys\bin;c:\users\stes-2\omnetpp-4.4\mingw\bin;c:/users/stes-2/omnetpp-4.4/ide/jre/bin/client;c:/users/stes-2/omnetpp-4.4/ide/jre/bin;c:/users/stes-2/omnetpp-4.4/ide/jre/lib/i386;.;c:\users\stes-2\omnetpp-4.4\msys\local\bin;c:\users\stes-2\omnetpp-4.4\mingw\bin;c:\users\stes-2\omnetpp-4.4\msys\bin;c:\users\stes-2\omnetpp-4.4\bin;c:\programdata\oracle\java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files (x86)\ati technologies\ati.ace\core-static;c:\python27;c:\users\stes-2\sumo-0.21.0;c:\users\stes-2\omnetpp-4.4; omnetpp_image_path=c:\users\stes-2\omnetpp-4.4\images 

since running sumo through sumolaunchd.py script, error message turns @ mingw cmd of omnet++ is:

starting sumo (c:/users/stes-2/sumo-0.21.0/bin/sumo-gui.exe -c cross.sumo.cfg) o n port 64161, seed 0 connecting sumo (c:/users/stes-2/sumo-0.21.0/bin/sumo-gui.exe -c cross.sumo.c fg) on port 64161 (try 1) releasing lock on port starting proxy mode done proxy mode done proxy mode, killing sumo sigterm done running sumo cleaning result: "<?xml version="1.0"?> <status>         <exit-code>15</exit-code>         <start>1433944271</start>         <end>1433944276</end>         <status>exited error code 15</status>         <stdout><![cdata[loading configuration... done. ]]></stdout>         <stderr><![cdata[]]></stderr> </status> " closing connection 127.0.0.1 on port 64160 

i think missing lines.

you have assigned tracimobility traci, , don't consider general commandinterface , vehiclecommandinterface

tracimobility* mobility = tracimobilityaccess().get(getparentmodule()); tracicommandinterface* traci = mobility->getcommandinterface(); /* missing command interface */ tracicommandinterface::vehicle* tracivehicle = mobility->getvehiclecommandinterface(); /* missing vehicle command interface */ tracivehicle->setspeedmode(somenumber); 

i tried compile code complains there no method available tracimobility called commandsetspeedmode(). due difference in veins versions.


multi-stage initialization

a module/variable trying access might not ready, i.e. still has not been created, time trying use it. in case multi-stage initialization feature of omnet++ can used.

this means "task" may delayed later stage of initialization of current module:

void somemodule::initialize(int stage) {     applicationbase::initialize(stage);  /* ignore if causes error */      if(stage == 0)     {         /* */      else if (stage == 3)     {         /* later */     } } 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -