2015-04-28 58 views

回答

1

有类TraCICommandInterface它提供了像这样getRoadId()数据访问方法。

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

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

非常感谢您的时间,我有一个老版本的VEINS,现在我使用最新的,所有工作正常。 最好, –