class_docstr: BasicAgent implements an agent that navigates the scene.
  This agent respects traffic lights and other vehicles, but ignores stop signs.
  It has several functions available to specify the route that the agent must follow,
  as well as to change its parameters in case a different driving mode is desired.
class_docstr_tok: ["BasicAgent","implements","an","agent","that","navigates","the","scene",".","This","agent","respects","traffic","lights","and","other","vehicles",",","but","ignores","stop","signs",".","It","has","several","functions","available","to","specify","the","route","that","the","agent","must","follow",",","as","well","as","to","change","its","parameters","in","case","a","different","driving","mode","is","desired","."]
docstr: Execute one step of navigation.
docstr_tok: ["Execute","one","step","of","navigation","."]
code: def run_step(self):
      """Execute one step of navigation."""
      hazard_detected = False
  
      # Retrieve all relevant actors
      vehicle_list = self._world.get_actors().filter("*vehicle*")
  
      vehicle_speed = get_speed(self._vehicle) / 3.6
  
      # Check for possible vehicle obstacles
      max_vehicle_distance = (
          self._base_vehicle_threshold
          + self._speed_ratio * vehicle_speed
      )
      affected_by_vehicle, _, _ = self._vehicle_obstacle_detected(
          vehicle_list, max_vehicle_distance
      )
      if affected_by_vehicle:
          hazard_detected = True
  
      # Check if the vehicle is affected by a red traffic light
      max_tlight_distance = (
          self._base_tlight_threshold
          + self._speed_ratio * vehicle_speed
      )
      affected_by_tlight, _ = self._affected_by_traffic_light(
          self._lights_list, max_tlight_distance
      )
      if affected_by_tlight:
          hazard_detected = True
  
      control = self._local_planner.run_step()
      if hazard_detected:
          control = self.add_emergency_stop(control)
  
      return control
  
imports: import carla
  from shapely.geometry import Polygon
  from agents.navigation.local_planner import LocalPlanner, RoadOption
  from agents.navigation.global_route_planner import GlobalRoutePlanner
  from agents.tools.misc import get_speed, is_within_distance, get_trafficlight_trigger_location, compute_distance
label_desc: Use image node_id 10 for calling the BasicAgent obj's underlying member method code with example usage: obj.run_step() and returns: control