[英]Making some traffic hazard in Carla simulator
In Carla simulator I can make some traffic using generate_traffic.py But I want to make some cars or pedestrians ignoring traffic lights.在 Carla 模拟器中,我可以使用 generate_traffic.py 进行一些交通,但我想让一些汽车或行人忽略交通信号灯。 In this case what code should I change?
在这种情况下,我应该更改什么代码?
If you are using any class derived from BasicAgent (PythonAPI\carla\agents\navigation\basic_agent.py)
to control the generated actors, then you can pass ignore_traffic_lights = True
to opt_dict
constructor parameter.如果您使用从
BasicAgent (PythonAPI\carla\agents\navigation\basic_agent.py)
派生的任何 class 来控制生成的 actor,那么您可以将ignore_traffic_lights = True
传递给opt_dict
构造函数参数。 Also, you can alter the following function of BasicAgent
in order to customize the actors affected by traffic lights.此外,您可以更改 BasicAgent 的以下
BasicAgent
以自定义受红绿灯影响的参与者。
def _affected_by_traffic_light(self, lights_list=None, max_distance=None):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.