parameters: (arg)
docstring: Main function of the script
docstring_summary: Main function of the script
docstring_tokens: Main function of the script
function: def main(arg):
      """Main function of the script"""
      client = carla.Client(arg.host, arg.port)
      client.set_timeout(30.0)
      world = client.get_world()
      pre_settings = world.get_settings()
      world = client.load_world("Town03")
  
      try:
          # Setting output temporal folder
          output_path = os.path.dirname(os.path.realpath(__file__))
          output_path = os.path.join(output_path, "_sensors") + os.path.sep
          if not os.path.exists(output_path):
              os.mkdir(output_path)
  
          test_list = [
              SensorScenarioTester(SpawnAllRaycastSensors(client, world), output_path),
              SensorScenarioTester(SpawnLidarNoDropff(client, world), output_path),
              SensorScenarioTester(SpawnLidarWithDropff(client, world), output_path),
              SensorScenarioTester(SpawnSemanticLidar(client, world), output_path),
              SensorScenarioTester(SpawnRadar(client, world), output_path)
          ]
  
          repetitions = 10
          for item in test_list:
              print("--------------------------------------------------------------")
              out = item.test_scenario(repetitions)
              print(out)
  
          print("--------------------------------------------------------------")
  
          # Remove all the output files
          #shutil.rmtree(path)
  
      finally:
          world.apply_settings(pre_settings)
function_tokens: def main ( arg ) : client = carla . Client ( arg . host , arg . port ) client . set_timeout ( 30.0 ) world = client . get_world ( ) pre_settings = world . get_settings ( ) world = client . load_world ( "Town03" ) try : # Setting output temporal folder output_path = os . path . dirname ( os . path . realpath ( __file__ ) ) output_path = os . path . join ( output_path , "_sensors" ) + os . path . sep if not os . path . exists ( output_path ) : os . mkdir ( output_path ) test_list = [ SensorScenarioTester ( SpawnAllRaycastSensors ( client , world ) , output_path ) , SensorScenarioTester ( SpawnLidarNoDropff ( client , world ) , output_path ) , SensorScenarioTester ( SpawnLidarWithDropff ( client , world ) , output_path ) , SensorScenarioTester ( SpawnSemanticLidar ( client , world ) , output_path ) , SensorScenarioTester ( SpawnRadar ( client , world ) , output_path ) ] repetitions = 10 for item in test_list : print ( "--------------------------------------------------------------" ) out = item . test_scenario ( repetitions ) print ( out ) print ( "--------------------------------------------------------------" ) # Remove all the output files #shutil.rmtree(path) finally : world . apply_settings ( pre_settings )