如何使用 SimuLTE 和 Veins 启用 SUMO TraCI?

How to enable SUMO TraCI using SimuLTE and Veins?

我正在使用 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,我们可以在 vehicle/node 更新位置后立即采取一些行动。谁能帮助解释我如何使用 SimuLTE 和 Veins 实现以下功能:

  1. 为了使用 TraCI 监控 vehicle/node 值,我应该修改哪个 class 以使用 TraCI? VeinsInetMobility、VeinsInetManager 还是其他?
  2. 如何仅在 vehicle/node 有位置更新时才在应用程序中执行操作?
  3. VeinsInetMobility 和TraCIMobility 的本质区别是什么?我可以将后者用于 LTE 场景吗?

在 Veins 4.6 中,TraCIMobility 模块用于在每次节点位置发生变化时更新 Veins 通道模型。非常相似,在 Veins 4.6 的 Veins_INET 中,每次节点位置发生变化时,都会使用 VeinsInetMobility 模块更新 INET Framework 通道模型。因为 SimuLTE 使用 INET Framework 信道模型,所以这是必须在这里使用的 class(否则 INET 信道模型将不知道,例如,两个节点是否距离太远而无法通信)。

如果您想在每次 SUMO 时间步完成时采取行动,您可以将其添加到 executeOneTimestep method of TraCIScenarioManager

请注意,如果您想通过 VeinsInetMobility 模块与 SUMO 车辆进行交互(例如,更改车辆路线),则需要进行一些更改:Veins_INET Veins 4.6 没有跟踪节点的外部 ID(SUMO 用来指代相应车辆的 ID),因此需要将其添加到 VeinsInetMobility (line 54) along with code to use it, similar to TraCIMobility (line 127).