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
Asked
Active
Viewed 125 times
0
-
and then I want to make simulation with the amount of cars counted in script – Jicchag Soltes Mar 01 '18 at 08:29
1 Answers
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