def convert_depth_from_source_to_agent(self, source: carla.Image) -> Union[(DepthData, None)]:
    'Convert CARLA raw depth info to '
    try:
        array = np.frombuffer(source.raw_data, dtype=np.dtype('uint8'))
        array = np.reshape(array, (source.height, source.width, 4))
        array = array[:, :, :3]
        array = array[:, :, ::(- 1)]
        array = png_to_depth(array)
        return DepthData(data=array)
    except:
        return None
Convert CARLA raw depth info to
def convert_depth_from_source_to_agent(self, source: carla.Image) -> Union[(DepthData, None)]:
    ' '
    try:
        array = np.frombuffer(source.raw_data, dtype=np.dtype('uint8'))
        array = np.reshape(array, (source.height, source.width, 4))
        array = array[:, :, :3]
        array = array[:, :, ::(- 1)]
        array = png_to_depth(array)
        return DepthData(data=array)
    except:
        return None