class_docstr: BridgeHelper provides methos to ease the co-simulation between sumo and carla.
class_docstr_tok: ["BridgeHelper","provides","methos","to","ease","the","co-simulation","between","sumo","and","carla","."]
docstr: Returns carla traffic light state based on sumo traffic light state.
docstr_tok: ["Returns","carla","traffic","light","state","based","on","sumo","traffic","light","state","."]
code: def get_carla_traffic_light_state(sumo_tl_state):
      """
      Returns carla traffic light state based on sumo traffic light state.
      """
      if (
          sumo_tl_state == SumoSignalState.RED
          or sumo_tl_state == SumoSignalState.RED_YELLOW
      ):
          return carla.TrafficLightState.Red
  
      elif sumo_tl_state == SumoSignalState.YELLOW:
          return carla.TrafficLightState.Yellow
  
      elif (
          sumo_tl_state == SumoSignalState.GREEN
          or sumo_tl_state == SumoSignalState.GREEN_WITHOUT_PRIORITY
      ):
          return carla.TrafficLightState.Green
  
      elif sumo_tl_state == SumoSignalState.OFF:
          return carla.TrafficLightState.Off
  
      else:  # SumoSignalState.GREEN_RIGHT_TURN and SumoSignalState.OFF_BLINKING
          return carla.TrafficLightState.Unknown
  
file_path: carla/Co-Simulation/Sumo/sumo_integration/bridge_helper.py
imports: import json
  import logging
  import math
  import os
  import random
  import carla
  import traci
  from .sumo_simulation import SumoSignalState, SumoVehSignal
label_desc: Use image node_id 9 for calling the BridgeHelper obj's underlying member method code with example usage: obj.get_carla_traffic_light_state(sumo_tl_state) and returns: carla, carla, carla, carla, carla