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: Initialization the agent parameters, the local and the global planner.
  
      :param vehicle: actor to apply to agent logic onto
      :param target_speed: speed (in Km/h) at which the vehicle will move
      :param opt_dict: dictionary in case some of its parameters want to be changed.
          This also applies to parameters related to the LocalPlanner.
      :param map_inst: carla.Map instance to avoid the expensive call of getting it.
      :param grp_inst: GlobalRoutePlanner instance to avoid the expensive call of getting it.
code: def __init__(
      self,
      vehicle,
      target_speed=20,
      opt_dict={},
      map_inst=None,
      grp_inst=None,
  ):
      """
      Initialization the agent parameters, the local and the global planner.
  
          :param vehicle: actor to apply to agent logic onto
          :param target_speed: speed (in Km/h) at which the vehicle will move
          :param opt_dict: dictionary in case some of its parameters want to be changed.
              This also applies to parameters related to the LocalPlanner.
          :param map_inst: carla.Map instance to avoid the expensive call of getting it.
          :param grp_inst: GlobalRoutePlanner instance to avoid the expensive call of getting it.
      """
      super().__init__(
          vehicle,
          target_speed,
          opt_dict=opt_dict,
          map_inst=map_inst,
          grp_inst=grp_inst,
      )
  
      self._use_basic_behavior = False  # Whether or not to use the BasicAgent behavior when the constant velocity is down
      self._target_speed = target_speed / 3.6  # [m/s]
      self._current_speed = vehicle.get_velocity().length()  # [m/s]
      self._constant_velocity_stop_time = None
      self._collision_sensor = None
  
      self._restart_time = float(
          "inf"
      )  # Time after collision before the constant velocity behavior starts again
  
      if "restart_time" in opt_dict:
          self._restart_time = opt_dict["restart_time"]
      if "use_basic_behavior" in opt_dict:
          self._use_basic_behavior = opt_dict["use_basic_behavior"]
  
      self.is_constant_velocity_active = True
      self._set_collision_sensor()
      self._set_constant_velocity(target_speed)
  
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 1 to create a new ConstantVelocityAgent object from inherited base classes: BasicAgent with example: obj = ConstantVelocityAgent(vehicle, target_speed, opt_dict, map_inst, grp_inst)