code: def callback(self, sensor_data, sensor_name=None, queue=None):
      # Compute the total sum of points adding all channels
      total_channel_points = 0
      for i in range(0, sensor_data.channels):
          total_channel_points += sensor_data.get_point_count(i)
  
      # Total points iterating in the LidarMeasurement
      total_detect_points = 0
      for _detection in sensor_data:
          total_detect_points += 1
  
      # Point cloud used with numpy from the raw data
      if self.sensor_type == SensorType.LIDAR:
          points = np.frombuffer(
              sensor_data.raw_data, dtype=np.dtype("f4")
          )
          points = np.reshape(points, (int(points.shape[0] / 4), 4))
          total_np_points = points.shape[0]
          self.curr_det_pts = total_np_points
      elif self.sensor_type == SensorType.SEMLIDAR:
          data = np.frombuffer(
              sensor_data.raw_data,
              dtype=np.dtype(
                  [
                      ("x", np.float32),
                      ("y", np.float32),
                      ("z", np.float32),
                      ("CosAngle", np.float32),
                      ("ObjIdx", np.uint32),
                      ("ObjTag", np.uint32),
                  ]
              ),
          )
          points = np.array([data["x"], data["y"], data["z"]]).T
          total_np_points = points.shape[0]
          self.curr_det_pts = total_np_points
      else:
          self.error = "It should never reach this point"
          return
  
      if total_np_points != total_detect_points:
          self.error = "The number of points of the raw data does not match with the LidarMeasurament array"
  
      if total_channel_points != total_detect_points:
          self.error = "The sum of the points of all channels does not match with the LidarMeasurament array"
  
      # Add option to synchronization queue
      if queue is not None:
          queue.put((sensor_data.frame, sensor_name, self.curr_det_pts))
  
imports: from .None import SyncSmokeTest
  from .None import SmokeTest
  import carla
  import time
  import math
  import numpy
  from enum import Enum
  from queue import Queue
  from queue import Empty
label_desc: Use image node_id 3 for calling the Sensor obj's underlying member method code with example usage: obj.callback(sensor_data, sensor_name, queue) without return types