0

SUMO simulator: is it possible to add cars to the simulation dynamically? I wanna do script for counting cars from video input in OpenCV+python

1 Answers1

0

Yes, it is. You can use the TraCI interface. When using the python client you can use the add function in the vehicle domain (but you must add a route beforehand or use a route already defined in the sumo inputs). In general it looks like this:

traci.route.add("myRoute", ["edge1", "edge2"])
traci.vehicle.add("myVehicle", "myRoute")

See also http://www.sumo.dlr.de/daily/pydoc/traci._vehicle.html#VehicleDomain-add

Michael
  • 3,510
  • 1
  • 11
  • 23