class_docstr: CarlaSimulation is responsible for the management of the carla simulation.
class_docstr_tok: ["CarlaSimulation","is","responsible","for","the","management","of","the","carla","simulation","."]
docstr: Spawns a new actor.
  
      :param blueprint: blueprint of the actor to be spawned.
      :param transform: transform where the actor will be spawned.
      :return: actor id if the actor is successfully spawned. Otherwise, INVALID_ACTOR_ID.
docstr_tok: ["Spawns","a","new","actor",".",":","param","blueprint",":","blueprint","of","the","actor","to","be","spawned",".",":","param","transform",":","transform","where","the","actor","will","be","spawned",".",":","return",":","actor","id","if","the","actor","is","successfully","spawned",".","Otherwise",",","INVALID_ACTOR_ID","."]
code: def spawn_actor(self, blueprint, transform):
      """
      Spawns a new actor.
  
          :param blueprint: blueprint of the actor to be spawned.
          :param transform: transform where the actor will be spawned.
          :return: actor id if the actor is successfully spawned. Otherwise, INVALID_ACTOR_ID.
      """
      transform = carla.Transform(
          transform.location + carla.Location(0, 0, SPAWN_OFFSET_Z),
          transform.rotation,
      )
  
      batch = [
          carla.command.SpawnActor(blueprint, transform).then(
              carla.command.SetSimulatePhysics(
                  carla.command.FutureActor, False
              )
          )
      ]
      response = self.client.apply_batch_sync(batch, False)[0]
      if response.error:
          logging.error("Spawn carla actor failed. %s", response.error)
          return INVALID_ACTOR_ID
  
      return response.actor_id
  
file_path: carla/Co-Simulation/Sumo/sumo_integration/carla_simulation.py
imports: import logging
  import carla
  from .constants import INVALID_ACTOR_ID, SPAWN_OFFSET_Z
label_desc: Use image node_id 7 for calling the CarlaSimulation obj's underlying member method code with example usage: obj.spawn_actor(blueprint, transform) and returns: response, INVALID_ACTOR_ID