code: def test_sensor_transform_on_synchronous_mode(self):
      print(
          "TestSynchronousMode.test_sensor_transform_on_synchronous_mode"
      )
      bp_lib = self.world.get_blueprint_library()
  
      spawn_points = self.world.get_map().get_spawn_points()
      self.assertNotEqual(len(spawn_points), 0)
  
      car_bp = bp_lib.find("vehicle.ford.mustang")
      car = self.world.spawn_actor(car_bp, spawn_points[0])
      # List of sensors that are not events, these are retrieved every frame
      sensor_ids = [
          "sensor.lidar.ray_cast",
          "sensor.lidar.ray_cast_semantic",
          "sensor.other.gnss",
          "sensor.other.radar",
          "sensor.other.imu",
          #            "sensor.camera.rgb",
          #            "sensor.camera.depth",
          #            "sensor.camera.semantic_segmentation"
      ]
      sensor_bps = [bp_lib.find(n) for n in sensor_ids]
      trans = carla.Transform(carla.Location(x=1.6, z=1.7))
      sensors = [
          self.world.spawn_actor(sensor, trans, car)
          for sensor in sensor_bps
      ]
      queues = [Queue()] * len(sensor_bps)
      car.apply_control(carla.VehicleControl(0.75))
      # car.set_autopilot(True)
  
      def sensor_callback(data, name, queue):
          queue.put((data, name))
  
      try:
          for i in range(len(sensors)):
              sensors[i].listen(
                  lambda data, i=i: sensor_callback(
                      data, sensor_ids[i], queues[i]
                  )
              )
          local_frame = 0
          for _ in range(0, 100):
              self.world.tick()
              snapshot_frame = self.world.get_snapshot().frame
              sensors_data = []
  
              try:
                  # Get the data once it's received
                  for queue in queues:
                      sensors_data.append(queue.get(True, 1.0))
              except Empty:
                  print("[Warning] Some sensor data has been missed")
  
              for i in range(len(queues)):
                  self.assertEqual(
                      queues[i].qsize(),
                      0,
                      "\nQueue " + str(sensor_ids[i]) + "oversized",
                  )
  
              # Just in case some sensors do not have the correct transform the same frame
              # they are spawned, like the IMU.
              if local_frame < 1:
                  continue
  
              # All the data has been correclty retrieved
              self.assertEqual(len(sensors_data), len(sensor_bps))
  
              # All the sensor frame number are the same
              for sensor_data in sensors_data:
                  self.assertEqual(sensor_data[0].frame, snapshot_frame)
              # All the sensor transforms match in the snapshot and the callback
              for i in range(len(sensors_data)):
                  self.assertEqual(
                      sensors_data[i][0].transform,
                      sensors[i].get_transform(),
                      "\n\nThe sensor and sensor_data transforms from '"
                      + str(sensors_data[i][1])
                      + "' does not match in the same frame! ("
                      + str(local_frame)
                      + ")\nSensor Data:\n  "
                      + str(sensors_data[i][0].transform)
                      + "\nSensor Transform:\n  "
                      + str(sensors[i].get_transform()),
                  )
              local_frame += 1
  
      finally:
          for sensor in sensors:
              if sensor is not None:
                  sensor.stop()
                  sensor.destroy()
          if car is not None:
              car.destroy()
  
file_path: carla/PythonAPI/test/smoke/test_sync.py
imports: from .None import SyncSmokeTest
  import carla
  import time
label_desc: Use image node_id 3 for calling the TestSynchronousMode obj's underlying member method code with example usage: obj.test_sensor_transform_on_synchronous_mode() without return types