code: def semantic_lidar_callback(point_cloud, point_list):
      """Prepares a point cloud with semantic segmentation
      colors ready to be consumed by Open3D"""
      data = np.frombuffer(
          point_cloud.raw_data,
          dtype=np.dtype(
              [
                  ("x", np.float32),
                  ("y", np.float32),
                  ("z", np.float32),
                  ("CosAngle", np.float32),
                  ("ObjIdx", np.uint32),
                  ("ObjTag", np.uint32),
              ]
          ),
      )
  
      # We're negating the y to correclty visualize a world that matches
      # what we see in Unreal since Open3D uses a right-handed coordinate system
      points = np.array([data["x"], -data["y"], data["z"]]).T
  
      # # An example of adding some noise to our data if needed:
      # points += np.random.uniform(-0.05, 0.05, size=points.shape)
  
      # Colorize the pointcloud based on the CityScapes color palette
      labels = np.array(data["ObjTag"])
      int_color = LABEL_COLORS[labels]
  
      # # In case you want to make the color intensity depending
      # # of the incident ray angle, you can use:
      # int_color *= np.array(data['CosAngle'])[:, None]
  
      point_list.points = o3d.utility.Vector3dVector(points)
      point_list.colors = o3d.utility.Vector3dVector(int_color)
  
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 2 for calling a global function with example usage: semantic_lidar_callback(point_cloud, point_list) without return types