![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1597311/image.png)
Can traffic lights change while running the simulation in Scenario Editing mode? How?
7 views (last 30 days)
Show older comments
In Scene Editing mode, I have already created a scene which includes a four-way intersection and traffic signals. I used the signal tool and moved the signal phase to the first one. The traffic lights turn out to be red in left and green in right as you can see in the following figure.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1586116/image.png)
Then I kept the signal phase in the first one and got into the Scenario Editing mode through clicking the mode selection button. I added two vehicles to the scenario together with a man as pedestrian. The vehicles are controlled by setting actions in Logic Editor and the pedestrian is controlled by waypoints.
Something happened which has puzzled me a lot. I found that when I was running the scenario, both the vehicles and pedestrian can move as the way I want, but the traffic lights didn't change at all and kept showing red in left and green in right.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1586121/image.png)
At first I wanted to find a way to make the vehicles recognize and follow the changes of the traffic lights. Then I found it hard to achieve because the RoadRunner hasn't supported this feature by far.
I have no choice but to make the vehicles synchronize with the traffic lights through setting time for vehicles and traffic lights separately. I know how to set the time of the vehicles, but I can't find a way to make the traffic lights change as the signal phases shown in Scene Editing mode while the simulation scenario is running in Scenario Editing mode.
Can someone give me a hand? I highly appreciate it.
0 Comments
Answers (1)
Sai Pavan
on 23 Jan 2024
Hello,
I understand that you want to make the traffic lights change with respect to signal phases in RoadRunner.
The signal tool enables us to change the signal phases of the junctions and also make changes to the signal properties such as signal variant and states. These properties can be accessed by selecting the anchor of each traffic signal pole within the prop assembly after selecting the signal tool. The traffic signal colors can be changed by configuring the colors in each of the red, green and yellow intervals.
Please refer to the below screenshot of the RoadRunner environment showing the appropriate attribute changes made to the traffic signal.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1597311/image.png)
Hope it helps!
0 Comments
See Also
Categories
Find more on Design and Simulate Scenarios in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!