简体   繁体   中英

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. 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. Also, you can alter the following function of BasicAgent in order to customize the actors affected by traffic lights.

def _affected_by_traffic_light(self, lights_list=None, max_distance=None):

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM