code: def __init__(self, carla_world, args):
      self.world = carla_world
      self.actor_role_name = args.rolename
      self.dim = (args.width, args.height)
      try:
          self.map = self.world.get_map()
      except RuntimeError as error:
          print("RuntimeError: {}".format(error))
          print(
              "  The server could not send the OpenDRIVE (.xodr) file:"
          )
          print(
              "  Make sure it exists, has the same name of your town, and is correct."
          )
          sys.exit(1)
      self.external_actor = args.externalActor
  
      self.hud = HUD(args.width, args.height, carla_world)
      self.recording_frame_num = 0
      self.recording = False
      self.recording_dir_num = 0
      self.player = None
      self.actors = []
      self.rss_sensor = None
      self.rss_unstructured_scene_visualizer = None
      self.rss_bounding_box_visualizer = None
      self._actor_filter = args.filter
      if not self._actor_filter.startswith("vehicle."):
          print("Error: RSS only supports vehicles as ego.")
          sys.exit(1)
  
      self.restart()
      self.world_tick_id = self.world.on_tick(self.on_world_tick)
  
imports: from __future__ import print_function
  import glob
  import os
  import sys
  import signal
  import carla
  from carla import ColorConverter
  import argparse
  import logging
  import math
  import random
  import weakref
  from rss_sensor import RssSensor
  from rss_visualization import RssUnstructuredSceneVisualizer, RssBoundingBoxVisualizer, RssStateVisualizer
label_desc: Use image node_id 1 to create a new World object from inherited base classes: object with example: obj = World(carla_world, args)