Skip to content

image_data_float always returns an empty image (i.e. list composed of [0.0]) #2875

Description

@rallen10

This seems to be a persistent, unaddressed problem based on other issues dating back more than a year (#2089, #2169, #2665, #1840). The only difference for me is that 1. I am running in Unity, and 2. the image is always empty, therefore the workaround to discard image and grab the next one if it is empty doesn't work for me.

To reproduce:

import airsim
import numpy as np
client = airsim.MultirotorClient(timeout_value = 7200)
client.confirmConnection()
while True:
        response = client.simGetImages([airsim.ImageRequest("1", airsim.ImageType.DepthPerspective, pixels_as_float=True, compress=False)])[0]
        img1d = np.array(response.image_data_float, dtype=np.float)
        if len(img1d) != response.height * response.width:
            print('empty or bad image. Retrying...')
        else:
            print('properly formatted image!')
            break

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions