Closed NnaYelsel closed 1 day ago
Hi, we are going to check the traffic lights controllers
Hi, I can not reproduce the problem. When I set the new values, the traffic lights are using the new times. But the red light is a bit special. Think in a junction with 4 traffic lights and two directions (a typical cross).
Each group run a cycle that goes from green state, to yellow state and ends with the red state. So using the default times, the group1 is
Then what happens is that the cycle for the group1 ends, and the next group starts a new cycle. That means that this group1 will remain in red state while the group2 is doing the cycle (that means group1 will be in red for 15 seconds). Then, when group2 ends the complete cycle (10 seconds in green, 3 seconds in yellow and 2 seconds in red), the group1 will start a new cycle of green + yellow + red, and so on. That means, that the group1 traffic lights will be in red (2 seconds during its cycle, and 15 seconds during the cycle of the other group) 17 seconds.
That is the normal behavior. Is that what you see?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@bernatx Hi, You mentioned the traffic lights should work in pair at crossings, but in my simulation, only 1 of 4 lights is green at any time, the opposite light is still red. What could be wrong here? I'm using the default timings for res/yellow/green lights.
I am experiencing the same behavior in CARLA 0.9.15.
Hi, as mentioned in this issue, There's only one green traffic light active at the same time for each traffic light crossing.
@DnDare Hello. Then how can I accurately measure the time it takes for the red light to change?
Hi, the calculations you've made for 1 group traffic lights are correct, the full cicle lasts 15 seconds, But when there are more groups included, these times are added, as you mention at https://github.com/carla-simulator/carla/issues/7625#issuecomment-2124120231 A single traffic light takes 15 seconds to make a full cicle, 10 green, 3 yellow, 2 red, then moves to a second traffic light, that starts with green light
In Town10HD_Opt there are 3 different junctions or crossings with trafficlights, the simplest takes 30 seconds for a whole loop, it's a simple junction of 2 trafficlights
A second junction combines 3 trafficLights, the whole loop takes 45 seconds
A third crossing combines 4 trafficLights, it takes 1 minute,
You can review the information on trafficlights here.
If you want to get the timing for each phase, get_green_time, get_yellow_time, get_red_time
I hope this helps you.
CARLA version: 13 Platform/OS: Windows
Problem you have experienced: Change the time of the red lights doens't work
What you expected to happen: I used the information of ticket : https://github.com/carla-simulator/carla/issues/515 in order to modify the time of green, red and yellow lights.
Steps to reproduce:
for actors_ in listactor: if isinstance(actors, carla.TrafficLight): actors_.setstate(carla.TrafficLightState.Red) world.tick() actors.set_redtime(1.0) world.tick() actors.setstate(carla.TrafficLightState.Green) world.tick() actors.set_greentime(3.0) world.tick() print(actors.get_greentime()) print(actors.get_redtime()) actors.setstate(carla.TrafficLightState.Yellow) world.tick() actors.set_yellowtime(0.1) world.tick() print(actors.get_yellow_time())
I didn't find any bad coding in github nevertheless, all my red lights stay during nearly 10s whatever I do.
Best regards