get TraCI vehicle command interface in Artery

193 views
Skip to first unread message

Tibor Petrov

unread,
May 29, 2017, 5:07:46 AM5/29/17
to OMNeT++ Users
Hi,

may I ask you, advanced users of Veins and Artery simulation frameworks for help?
I would like to know how it is possible to get the vehicle' s TraCI command interface in Artery? I'm trying to make a very simple change in the Artery example simulation in order to re-route the vehicles. But when I use the code from Veins:

    mobility = TraCIMobilityAccess().get(getParentModule());
    traci = mobility->getCommandInterface();
    traciVehicle = mobility->getVehicleCommandInterface();

the Omnet++ terminates with "Segmentation fault (core dumped)" error message. The message occurs when executing the second line of the abovementioned code. In Veins, the code works with no problem. Am I doing something wrong? The simulation with the Omnet++ and the 64-bit Ubuntu 16.04 LTS run in a VirtualBox. May this be the source of the problem?

Thank you very much.

Raphael Riebl

unread,
May 30, 2017, 4:58:01 AM5/30/17
to OMNeT++ Users
Hi Tibor,

you seem to use an older version of Artery, are you? You can access the traci::VehicleController instance from any Artery service classes via getFacilities().get_mutable<traci::VehicleController>() in recent versions.

Best regards,
Raphael

Tibor Petrov

unread,
Jun 5, 2017, 3:33:01 AM6/5/17
to OMNeT++ Users
Hi Raphael,

thank you very much for your kind reply. I am now using the current version of Artery and I am able to access traci:VehicleController now (thank you again). But does the traci::VehicleController provide a functionality to reroute vehicle in a similar way in which it was possible in original Veins? for example:


traciVehicle->changeRoute(x,y);

thank you very much.

Kindest regards,
Tibor

Raphael Riebl

unread,
Jun 6, 2017, 2:36:01 AM6/6/17
to OMNeT++ Users
Hi Tibor,

this particular function is not yet available in VehicleController, however, any TraCI vehicle command can be easily added to it. Have a look at http://sumo.dlr.de/wiki/TraCI/Change_Vehicle_State for a full list of available commands. Veins uses "change edge travel time information" for its changeRoute method. Depending on your use case other commands might be more suitable.
When you know which particular features you are missing I kindly ask you to open a feature request at https://github.com/riebl/artery/issues/new.

Best regards,
Raphael
Reply all
Reply to author
Forward
0 new messages