简体   繁体   中英

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. Here is my updated scenario (with 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

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

and the RSU application is barebones with minor implementation:

*.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. Here is the ned file associated with the manager. The source file has 2 functions, pre-initialize module and update module 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). 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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