0

In my Veins simulation, I want to use SUMO vehicle ID as the ID of the vehicle (instead of using Veins module id). I tried different method but was not successful. I tried to obtain sumo id using mobility -> getExternalId() in DemoBaseApplLayer.cc file. Build was successful but it does not run. If i do, getParentModule->getId() - it works fine. But I need SUMO Id not module id for my work,

Is there a way to use SUMO vehicle Id as the id of the vehicle in Veins?

Sohan
  • 1
  • 1
  • Possible duplicate of https://stackoverflow.com/questions/34781359/how-to-get-vehicle-id-and-type-as-unique-identifier-from-sumo-vehicle-id#:~:text=1%20Answer&text=The%20class%20TraCIMobility%20provides%20a,the%20id%20as%20a%20string. – Pasha M. Feb 19 '22 at 17:08

1 Answers1

0

If you mean that the wireless node with node vector index 1 in OMNeT++ should correspond to a vehicle named vehicle_1 in SUMO this will not easily be possible. If all you want to do is inquire about which name SUMO uses to refer to a wireless node managed via TraCIMobility in OMNeT++ then its getExternalId method is exactly the right one to call. If using the method gives you a runtime error, please post the precise output and messages you are seeing, the precise software versions you are using, and the steps needed to reproduce your error on another machine.

Christoph Sommer
  • 6,893
  • 1
  • 17
  • 35