Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behavior of traffic lights on intersections #7738

Closed
dx6nxr opened this issue Jun 3, 2024 · 4 comments
Closed

Weird behavior of traffic lights on intersections #7738

dx6nxr opened this issue Jun 3, 2024 · 4 comments

Comments

@dx6nxr
Copy link

dx6nxr commented Jun 3, 2024

CARLA version: 0.9.15
Platform/OS: Win11
Problem you have experienced: Traffic lights in opposite directions in intersections are not changed to green at the same time, but they kind of change to green in a "circle", instead of changing the traffic lights in opposing directions to green simultaneously.
Steps to reproduce: traffic lights in intersections on any map

image
Example is from the map "Town05". Behavior on the different maps is the same.

I've been trying to find any info if somebody had the same issue, however i couldn't find anything issued about it on gh or any info in carla docs.

Best regards,
Ivan

@GoodarzMehr
Copy link

This is the default behavior.

"The traffic lights in the same group follow a cycle. The first one is set to green while the rest remain frozen in red. The active one spends a few seconds in green, yellow and red, so there is a period of time where all the lights are red. Then, the next traffic light starts its cycle, and the previous one is frozen with the rest."

Source

@dx6nxr
Copy link
Author

dx6nxr commented Jun 4, 2024

Hey @GoodarzMehr ,
thanks for the clarification. So, I guess there is no out-of-the-box way to change them to more "normal" color changing behavior?

Best, Ivan

@GoodarzMehr
Copy link

GoodarzMehr commented Jun 4, 2024

You're welcome. And to answer your question, you can write a code to get the traffic lights at the intersection (using the carla.World.get_traffic_lights_in_junction(junction_id) method) and set their states manually.

@glopezdiest
Copy link
Contributor

Following up on what @GoodarzMehr said, if both traffic lights were green, traffic would have to understand the concept of give way, which isn't a simple logic to design.

Closing this is at has been answered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants