def remove_all_actors(self): """ Remove all actors """ for i, _ in enumerate(self.other_actors): if self.other_actors[i] is not None: if CarlaActorPool.actor_id_exists(self.other_actors[i].id): CarlaActorPool.remove_actor_by_id(self.other_actors[i].id) self.other_actors[i] = None self.other_actors = []
def remove_all_actors(self): """ Remove all actors """ for i, _ in enumerate(self.other_actors): if self.other_actors[i] is not None: # print("removed other actor position: {}, {}, {}".format(self.other_actors[i].get_location().x, # self.other_actors[i].get_location().y, # self.other_actors[i].get_location().z)) if CarlaActorPool.actor_id_exists(self.other_actors[i].id): CarlaActorPool.remove_actor_by_id(self.other_actors[i].id) self.other_actors[i] = None self.other_actors = []