0

如何获取诸如 roadid 之类的信息,以便将其用作新字段,例如在来自 BaseWaveApplLayer.cc 的信标消息中?

最好的,巴甫洛斯

4

1 回答 1

2

有一个类TraCICommandInterface为此类数据提供访问方法,例如getRoadId().

在课程TraCIDemo11p中,您可以找到如何获取此信息的示例。它基本上归结为执行以下步骤:

TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule());
TraCICommandInterface* traci = mobility->getCommandInterface();
TraCICommandInterface::Vehicle* traciVehicle = mobility->getVehicleCommandInterface();
traciVehicle->getRoadId();
于 2015-04-28T11:25:14.360 回答