code: def main(arg):
      """Main function of the script"""
      client = carla.Client(arg.host, arg.port)
      client.set_timeout(2.0)
      world = client.get_world()
  
      try:
          original_settings = world.get_settings()
          settings = world.get_settings()
          traffic_manager = client.get_trafficmanager(8000)
          traffic_manager.set_synchronous_mode(True)
  
          delta = 0.05
  
          settings.fixed_delta_seconds = delta
          settings.synchronous_mode = True
          settings.no_rendering_mode = arg.no_rendering
          world.apply_settings(settings)
  
          blueprint_library = world.get_blueprint_library()
          vehicle_bp = blueprint_library.filter(arg.filter)[0]
          vehicle_transform = random.choice(
              world.get_map().get_spawn_points()
          )
          vehicle = world.spawn_actor(vehicle_bp, vehicle_transform)
          vehicle.set_autopilot(arg.no_autopilot)
  
          lidar_bp = generate_lidar_bp(
              arg, world, blueprint_library, delta
          )
  
          user_offset = carla.Location(arg.x, arg.y, arg.z)
          lidar_transform = carla.Transform(
              carla.Location(x=-0.5, z=1.8) + user_offset
          )
  
          lidar = world.spawn_actor(
              lidar_bp, lidar_transform, attach_to=vehicle
          )
  
          point_list = o3d.geometry.PointCloud()
          if arg.semantic:
              lidar.listen(
                  lambda data: semantic_lidar_callback(data, point_list)
              )
          else:
              lidar.listen(
                  lambda data: lidar_callback(data, point_list)
              )
  
          vis = o3d.visualization.Visualizer()
          vis.create_window(
              window_name="Carla Lidar",
              width=960,
              height=540,
              left=480,
              top=270,
          )
          vis.get_render_option().background_color = [0.05, 0.05, 0.05]
          vis.get_render_option().point_size = 1
          vis.get_render_option().show_coordinate_frame = True
  
          if arg.show_axis:
              add_open3d_axis(vis)
  
          frame = 0
          dt0 = datetime.now()
          while True:
              if frame == 2:
                  vis.add_geometry(point_list)
              vis.update_geometry(point_list)
  
              vis.poll_events()
              vis.update_renderer()
              # # This can fix Open3D jittering issues:
              time.sleep(0.005)
              world.tick()
  
              process_time = datetime.now() - dt0
              sys.stdout.write(
                  "\r"
                  + "FPS: "
                  + str(1.0 / process_time.total_seconds())
              )
              sys.stdout.flush()
              dt0 = datetime.now()
              frame += 1
  
      finally:
          world.apply_settings(original_settings)
          traffic_manager.set_synchronous_mode(False)
  
          vehicle.destroy()
          lidar.destroy()
          vis.destroy_window()
  
file_path: carla/PythonAPI/examples/open3d_lidar.py
imports: import glob
  import os
  import sys
  import argparse
  import time
  from datetime import datetime
  import random
  import numpy
  from matplotlib import cm
  import open3d
  import carla
label_desc: Use image node_id 5 for calling a global function with example usage: main(arg) without return types