I have a doubt that I have yet to find an answer. I need to change a traffic light's, of which I have an id, colour. However, I need to change only a specific part of the traffic light, for example, in an intersection I need to change to green the light that allows the cars to go from south to east, while blocking all other vehicles. I found a solution, which is to use the function setState
to alter these values and it works, but after that the colours remain the same, not presenting the same behavior as before, despite altering the state to the previous one.
In conclusion, I need to alter the traffic light colours for a limited time and I can't achieve that.
Thanks in advance!
Asked
Active
Viewed 126 times
0
-
1Possible duplicate of [Changing Traffic Light Colour ERROR in Omnet++/Veins, SUMO](https://stackoverflow.com/questions/54992801/changing-traffic-light-colour-error-in-omnet-veins-sumo) – thardes2 Mar 07 '19 at 07:53
-
Your question on https://stackoverflow.com/questions/54992801/changing-traffic-light-colour-error-in-omnet-veins-sumo is still open. Is this a new question? A follow-up? Please add an answer to your old question if you already found the solution to this. – Christoph Sommer Mar 07 '19 at 19:21
-
It is a new question. I've closed the last one – precisoDeTirarDuvidas Mar 08 '19 at 16:27
1 Answers
0
You can use SUMO's netedit to invent a new traffic light plan and set that one temporarily changing back to the old plan using traci.trafficlight.setProgram
or you set a completely new plan using setCompleteRedYellowGreenDefinition
. Please be aware that these are traci functions which may not be implemented in Veins yet.

Michael
- 3,510
- 1
- 11
- 23