Reputation: 43
I'm building an ITS application using OMNET++, veins and SUMO and i'm trying to
update the vehicle's route with a different route. however both of the two commands (commandRouteChange
, commandNewRoute
) that I found in veins did not work.
I compute a new route, and the output is such like this: std::string newRoute = "AtoB BtoC CtoD DtoE";
then I tried to set this newRoute
to the vehicle:
traci->getManager()->commandNewRoute(vehicleID, newRoute);
then I got the following error: Error in module (ITS) VANET.host[0].appl (id=9) at event #127412, t=12: Model error: TraCI server reported error executing command 0xc4 ("Can not retrieve road with ID AtoB BtoC CtoD DtoE ").
I was search and I saw that the commandNewRoute
and commandChangeRoute
receives just a single edge as parameter. But I wanna set a full route to a vehicle. Does anyone knows how can I do this?
Upvotes: 2
Views: 138
Reputation: 6943
Veins 2.1 only implements commands for changing a vehicle's route by modifying its target road (Command 0xc4 0x31) or by modifying its perception of travel times (Command 0xc4 0x58).
Newer versions of Veins also implement a command for setting arbitrary routes (Command 0xc4 0x57), which is what you are asking for.
I recommend switching to Veins 4.3, which works with the most recent version of SUMO and gives you a number of improved and more feature-rich simulation models of other components as well. If you cannot upgrade Veins, implementing the desired command should be straightforward as well.
Upvotes: 2