RoadId() from the BaseWaveApplLayer.cc (VEINS, OMNET++)

后端 未结 1 1327
遥遥无期
遥遥无期 2020-12-22 10:02

how can i get information such as roadid in order to use it as a new field for example in beacon messages from BaseWaveApplLayer.cc?

best, Pavlos

1条回答
  •  眼角桃花
    2020-12-22 10:29

    There is the class TraCICommandInterface which provides access methods for such data like getRoadId().

    In the class TraCIDemo11p you can find an example how to get this information. It basically boilds down to performing the following steps:

    TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule());
    TraCICommandInterface* traci = mobility->getCommandInterface();
    TraCICommandInterface::Vehicle* traciVehicle = mobility->getVehicleCommandInterface();
    traciVehicle->getRoadId();
    

    0 讨论(0)
提交回复
热议问题