简体   繁体   English

将自定义模块添加到 Veins_Inet 示例 (Omnet++) 时出现 TraciMobility::getExternalId 错误

[英]TraciMobility::getExternalId error when adding custom module into Veins_Inet example (Omnet++)

I am attempting to add a new custom RSU module (extending AdHocHost) into the Veins_Inet example.我正在尝试将新的自定义 RSU 模块(扩展 AdHocHost)添加到 Veins_Inet 示例中。 Here is my updated scenario (with 1 RSU).这是我更新的场景(带有 1 个 RSU)。

network TestScenario {
submodules:
    radioMedium: Ieee80211ScalarRadioMedium;
    manager: VeinsInetManager;
    node[0]: VeinsInetCar;

    // added rsu
    rsu: VeinsInetRSU;
connections allowunconnected:}

I also updated the ini file so that the RSU mobility is我还更新了 ini 文件,以便 RSU 移动性

*.rsu.mobility.typename = "inet.mobility.static.StationaryMobility" 

and the RSU application is barebones with minor implementation:并且 RSU 应用程序是具有少量实现的准系统:

*.rsu.app[0].typename = "practice.veins_inet.VeinsInetRSUSampleApplication".

However, I get the following error:但是,我收到以下错误:

TraCIMobility::getExternalId called with no external id set yet.

In the example, the VeinsInetManager is managing the cars with TRACI.在示例中,VeinsInetManager 正在使用 TRACI 管理汽车。 Here is the ned file associated with the manager.这是与管理器关联的 ned 文件。 The source file has 2 functions, pre-initialize module and update module position.源文件有2个功能,预初始化模块和更新模块position。

simple VeinsInetManager extends TraCIScenarioManagerLaunchd {
parameters:
    @class(veins::VeinsInetManager);}

How can I add a custom module into the scenario without raising any errors?如何在不引发任何错误的情况下将自定义模块添加到场景中?

Your application might be inheriting from VeinsInetApplicationBase , which calls TraCI methods (that fail for nodes that are not a TraCI-managed vehicle).您的应用程序可能继承自VeinsInetApplicationBase ,它调用 TraCI 方法(对于不是 TraCI 管理的车辆的节点会失败)。 See also its source code .另请参阅其源代码

To be doubly-sure, run your simulation in debug mode, turn on debug-on-errors , and check the stack trace to see where the call is coming from.为了更加确定,请在调试模式下运行您的模拟,打开debug-on-errors并检查堆栈跟踪以查看调用来自何处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM