title: Handling traci in the RSU module
body: <p><strong>CONTEXT:</strong></p>
  
  <p>In my program I have an intersection with a traffic light that coordinates vehicles movement. </p>
  
  <p>On the vertical lane, not that frequently trams will cross. On the horizontal lane,  frequent cars. </p>
  
  <p>In my communication simulation experiment, tram has higher priority than cars. </p>
  
  <p>So when it approaches the intersection the idea is that tram crosses without stopping. </p>
  
  <p>Near the intersection there a RSU that monitors tram coordinates and when the tram is close enough</p>
  
  <p>It will send a message to this RSU. </p>
  
  <p>I could successfully control traffic lights from the vehicles (because they have access to traci).</p>
  
  <p>But my next goal is to make the RSU to coordinate the traffic lights after receiving the message.</p>
  
  <p><strong>QUESTION:</strong>  </p>
  
  <p>How can I make the RSU module to handle traci at the same time vehicles are using it?</p>
  
  <p><strong>ATTEMPT:</strong></p>
  
  <p>Following this <a href="https://stackoverflow.com/questions/35790944/how-to-access-traci-command-interface-from-tracidemorsu11p-in-veins-car2x-simula?rq=1">question</a> I tried to implement the code to handle traci in the RSU, but it didn't work</p>
  
  <p>The problem was this one: <a href="https://stackoverflow.com/questions/42687116/why-i-get-an-error-code-139-if-i-run-this-code">Why I get an error code 139 if I run this code?</a> </p>
  
  <pre><code>//written in the TraCIDemoRSU11p.h
  TraCIScenarioManager* manager;
  TraCICommandInterface* traci;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>//written in the TraCIDemoRSU11p.cc
  void TraCIDemoRSU11p::initialize(int stage) 
  {
      ...
      manager = TraCIScenarioManagerAccess().get();
      traci = manager-&gt;getCommandInterface();
      ...
  }
  </code></pre>
  
  <p><strong>SUMMARIZING:</strong></p>
  
  <p>Is there anyone that know how to use traci in RSU and could help me to use it as well? </p>
  
  <p>That would be very helpful to my project, thanks!</p>
  
  <p><strong>DETAIL:</strong></p>
  
  <p>The error doesn't occur exactly when I initialize and try to get TraCI command interface, </p>
  
  <p>But when I try to use it to change traffic light program and phases.</p>