Hi,

> If I can't use setRoute(), and setStop() by itself also fails, how do
> I make a vehicle just stop where it is?

a stop has a position as well and the default for the setStop method is
to place the stop at position 1. The vehicle is most likely already
behind that position, thus the error. If your edge is long enough you
could simply place the stop at the end of the edge. The stop position
must also take into account the braking distance. If you really need to
stop the vehicle in place, you run into trouble because you might be
violating assumptions of the car following model which leads to
collisions. If you still want to do so, have a look at setSpeed and
setSpeedMode to brake the vehicle down immediately.

So basically something like

traci.vehicle.setSpeedMode(vehID, 0)
traci.vehicle.setSpeed(vehID, 0)
traci.simulationStep() # to apply the modifications
traci.vehicle.setStop(
    vehID, traci.vehicle.getRoadID(vehID),
pos=traci.vehicle.getLanePosition(vehID),
laneIndex=traci.vehicle.getLaneIndex(vehID))

could work.

Best regards,
Michael

------------------------------------------------------------------------------
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to