Can traffic lights change while running the simulation in Scenario Editing mode? How?

2 ビュー (過去 30 日間)
伟麟
伟麟 2024 年 1 月 9 日
回答済み: Sai Pavan 2024 年 1 月 23 日
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.
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.
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.

回答 (1 件)

Sai Pavan
Sai Pavan 2024 年 1 月 23 日
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.
Hope it helps!

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by