How do I make cars follow traffic signals in RoadRunner?

10 ビュー (過去 30 日間)
Noa Teed
Noa Teed 2023 年 11 月 16 日
コメント済み: Noa Teed 2023 年 11 月 18 日
I'm using a 4-way intersection simulation in RoadRunner. Using the pre-configured light timing, I've gone through and made sure the signal intervals are set to the appropriate colors for each light and saved it. But once I go to run the simulation with several cars, they all just go automatically until a collision occurs. I watched a video online but I don't see any way to add the lights to the 2D logic in the scenario (other than setting them up in the scene) or any kind of "obey lights" attribute on each car.

採用された回答

Pratyush
Pratyush 2023 年 11 月 16 日
Hi Noa,
I understand that you want to know if there are any built-in functionality to make cars obey traffic lights in a Road runner simulation.
In RoadRunner, the pre-configured light timing only affects the visual appearance of the traffic lights in the scene. It doesn't have any built-in functionality to control the behavior of the cars in response to the lights.
To simulate the behavior of cars obeying traffic lights, you would need to implement custom logic in your simulation.
Implement logic for the cars to detect the state of the traffic lights and respond accordingly in a MATLAB script and attach it as a behaviour to your cars.
  1 件のコメント
Noa Teed
Noa Teed 2023 年 11 月 18 日
Thank you for clarifying. Do you have any resources specifically for reading and integrating traffic signals within Simulink? Is it possible to just respond through MATLAB without Simulink specific components?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRoadRunner Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by