parameters: (frame)
return_statement: return range_images, camera_projections, range_image_top_pose
docstring: Parse range images and camera projections given a frame.
  
    Args:
       frame: open dataset frame proto
  
    Returns:
       range_images: A dict of {laser_name,
         [range_image_first_return, range_image_second_return]}.
       camera_projections: A dict of {laser_name,
         [camera_projection_from_first_return,
          camera_projection_from_second_return]}.
      range_image_top_pose: range image pixel pose for top lidar.
docstring_summary: Parse range images and camera projections given a frame.
docstring_tokens: Parse range images and camera projections given a frame .
function: def parse_range_image_and_camera_projection(frame):
    """Parse range images and camera projections given a frame.
  
    Args:
       frame: open dataset frame proto
  
    Returns:
       range_images: A dict of {laser_name,
         [range_image_first_return, range_image_second_return]}.
       camera_projections: A dict of {laser_name,
         [camera_projection_from_first_return,
          camera_projection_from_second_return]}.
      range_image_top_pose: range image pixel pose for top lidar.
    """
    range_images = {}
    camera_projections = {}
    range_image_top_pose = None
    for laser in frame.lasers:
      if len(laser.ri_return1.range_image_compressed) > 0:  # pylint: disable=g-explicit-length-test
        range_image_str_tensor = tf.io.decode_compressed(
            laser.ri_return1.range_image_compressed, 'ZLIB')
        ri = dataset_pb2.MatrixFloat()
        ri.ParseFromString(bytearray(range_image_str_tensor.numpy()))
        range_images[laser.name] = [ri]
  
        if laser.name == dataset_pb2.LaserName.TOP:
          range_image_top_pose_str_tensor = tf.io.decode_compressed(
              laser.ri_return1.range_image_pose_compressed, 'ZLIB')
          range_image_top_pose = dataset_pb2.MatrixFloat()
          range_image_top_pose.ParseFromString(
              bytearray(range_image_top_pose_str_tensor.numpy()))
  
        camera_projection_str_tensor = tf.io.decode_compressed(
            laser.ri_return1.camera_projection_compressed, 'ZLIB')
        cp = dataset_pb2.MatrixInt32()
        cp.ParseFromString(bytearray(camera_projection_str_tensor.numpy()))
        camera_projections[laser.name] = [cp]
      if len(laser.ri_return2.range_image_compressed) > 0:  # pylint: disable=g-explicit-length-test
        range_image_str_tensor = tf.io.decode_compressed(
            laser.ri_return2.range_image_compressed, 'ZLIB')
        ri = dataset_pb2.MatrixFloat()
        ri.ParseFromString(bytearray(range_image_str_tensor.numpy()))
        range_images[laser.name].append(ri)
  
        camera_projection_str_tensor = tf.io.decode_compressed(
            laser.ri_return2.camera_projection_compressed, 'ZLIB')
        cp = dataset_pb2.MatrixInt32()
        cp.ParseFromString(bytearray(camera_projection_str_tensor.numpy()))
        camera_projections[laser.name].append(cp)
    return range_images, camera_projections, range_image_top_pose
function_tokens: def parse_range_image_and_camera_projection ( frame ) : range_images = { } camera_projections = { } range_image_top_pose = None for laser in frame . lasers : if len ( laser . ri_return1 . range_image_compressed ) > 0 : # pylint: disable=g-explicit-length-test range_image_str_tensor = tf . io . decode_compressed ( laser . ri_return1 . range_image_compressed , 'ZLIB' ) ri = dataset_pb2 . MatrixFloat ( ) ri . ParseFromString ( bytearray ( range_image_str_tensor . numpy ( ) ) ) range_images [ laser . name ] = [ ri ] if laser . name == dataset_pb2 . LaserName . TOP : range_image_top_pose_str_tensor = tf . io . decode_compressed ( laser . ri_return1 . range_image_pose_compressed , 'ZLIB' ) range_image_top_pose = dataset_pb2 . MatrixFloat ( ) range_image_top_pose . ParseFromString ( bytearray ( range_image_top_pose_str_tensor . numpy ( ) ) ) camera_projection_str_tensor = tf . io . decode_compressed ( laser . ri_return1 . camera_projection_compressed , 'ZLIB' ) cp = dataset_pb2 . MatrixInt32 ( ) cp . ParseFromString ( bytearray ( camera_projection_str_tensor . numpy ( ) ) ) camera_projections [ laser . name ] = [ cp ] if len ( laser . ri_return2 . range_image_compressed ) > 0 : # pylint: disable=g-explicit-length-test range_image_str_tensor = tf . io . decode_compressed ( laser . ri_return2 . range_image_compressed , 'ZLIB' ) ri = dataset_pb2 . MatrixFloat ( ) ri . ParseFromString ( bytearray ( range_image_str_tensor . numpy ( ) ) ) range_images [ laser . name ] . append ( ri ) camera_projection_str_tensor = tf . io . decode_compressed ( laser . ri_return2 . camera_projection_compressed , 'ZLIB' ) cp = dataset_pb2 . MatrixInt32 ( ) cp . ParseFromString ( bytearray ( camera_projection_str_tensor . numpy ( ) ) ) camera_projections [ laser . name ] . append ( cp ) return range_images , camera_projections , range_image_top_pose