Search code examples
omnet++veinssumo

How to enable SUMO TraCI using SimuLTE and Veins?


I am using SimuLTE and Veins simulating sending safety message via LTE. The content of the message depends on the real-time values of the traffic, e.g., mean speed. In order to get such values, I plan to use TraCICommandInterface supported by Veins. However, I could not find out how and where I can do this. To be specific, in Veins without SimuLTE, I know the vehicle node is a module of TraCIMobility, which has an application layer, where we can customize the functions for receiving/sending messages, such as wsm, and managed by TraCIScenarioManager. However in the simulation example provided by SimuLTE, the vehicle/node is a module of VeinInetMobility, which is managed by VeinInetManager. Neither of them are using TraCICommandInterface or TraCIMobility. Besides, the lte applications are not using the same layer as BaseWaveApplLayer, where we can take some action as soon as the vehicle/node updates the position. Can anyone help explain how I could possibly implement the following using SimuLTE and Veins:

  1. In order to monitor the vehicle/node values using TraCI, which class should I modify to use TraCI? VeinsInetMobility, VeinsInetManager or else?
  2. How can I take action in the application only when there is a position update to the vehicle/node?
  3. What is the essential difference between VeinsInetMobility and TraCIMobility? Can I use the latter for LTE scenario?

Solution

  • In Veins 4.6, a TraCIMobility module is used to update the Veins channel models every time a node's position changes. Quite similarly, in Veins_INET of Veins 4.6, a VeinsInetMobility module is used to update the INET Framework channel models every time a node's position changes. Because SimuLTE uses INET Framework channel models, this is the class that must be used here (otherwise the INET channel models would not know, e.g, whether two nodes are too far away to communicate).

    If you want to take action every time a SUMO time step has completed, you can just add this to the executeOneTimestep method of TraCIScenarioManager.

    Note that if you ever want to interact with the SUMO vehicle via the VeinsInetMobility module (e.g., changing a vehicle's route) a few changes will be necessary: Veins_INET of Veins 4.6 does not track a node's external id (the ID that SUMO uses to refer to the corresponding vehicle), so this would need to be added to VeinsInetMobility (line 54) along with code to use it, similar to TraCIMobility (line 127).