class_docstr: ConstantVelocityAgent implements an agent that navigates the scene at a fixed velocity.
  This agent will fail if asked to perform turns that are impossible are the desired speed.
  This includes lane changes. When a collision is detected, the constant velocity will stop,
  wait for a bit, and then start again.
docstr: Execute one step of navigation.
code: def run_step(self):
      """Execute one step of navigation."""
      if not self.is_constant_velocity_active:
          if (
              self._world.get_snapshot().timestamp.elapsed_seconds
              - self._constant_velocity_stop_time
              > self._restart_time
          ):
              self.restart_constant_velocity()
              self.is_constant_velocity_active = True
          elif self._use_basic_behavior:
              return super(ConstantVelocityAgent, self).run_step()
          else:
              return carla.VehicleControl()
  
      hazard_detected = False
  
      # Retrieve all relevant actors
      actor_list = self._world.get_actors()
      vehicle_list = actor_list.filter("*vehicle*")
      lights_list = actor_list.filter("*traffic_light*")
  
      vehicle_speed = self._vehicle.get_velocity().length()
  
      max_vehicle_distance = (
          self._base_vehicle_threshold + vehicle_speed
      )
      (
          affected_by_vehicle,
          adversary,
          _,
      ) = self._vehicle_obstacle_detected(
          vehicle_list, max_vehicle_distance
      )
      if affected_by_vehicle:
          vehicle_velocity = self._vehicle.get_velocity()
          if vehicle_velocity.length() == 0:
              hazard_speed = 0
          else:
              hazard_speed = (
                  vehicle_velocity.dot(adversary.get_velocity())
                  / vehicle_velocity.length()
              )
          hazard_detected = True
  
      # Check if the vehicle is affected by a red traffic light
      max_tlight_distance = (
          self._base_tlight_threshold + 0.3 * vehicle_speed
      )
      affected_by_tlight, _ = self._affected_by_traffic_light(
          lights_list, max_tlight_distance
      )
      if affected_by_tlight:
          hazard_speed = 0
          hazard_detected = True
  
      # The longitudinal PID is overwritten by the constant velocity but it is
      # still useful to apply it so that the vehicle isn't moving with static wheels
      control = self._local_planner.run_step()
      if hazard_detected:
          self._set_constant_velocity(hazard_speed)
      else:
          self._set_constant_velocity(self._target_speed)
  
      return control
  
file_path: carla/PythonAPI/carla/agents/navigation/constant_velocity_agent.py
imports: import carla
  from agents.navigation.basic_agent import BasicAgent
label_desc: Use image node_id 6 for calling the ConstantVelocityAgent obj's underlying member method code with example usage: obj.run_step() and returns: control, super, carla