Skip to content

ImageRequest pixels_as_float parameter doesn't work (Unity) #2169

Description

@ptotikj

Hi guys,

I am trying two days in a row to find out the problem.
It seems although I am setting pixels_as_float to True, my ImageResponse is still uint8 type.

responses = client.simGetImages([airsim.ImageRequest(camera_name=1, image_type=airsim.ImageType.DepthPerspective, pixels_as_float=True, compress=False)])

Here is the response that I have saved in a .txt file:

<ImageResponse> {
    'camera_name': '1',
    'camera_orientation': <Quaternionr> {   'w_val': 0.9937143921852112,
    'x_val': 0.0016330804210156202,
    'y_val': 2.0414589016581886e-05,
    'z_val': 0.1119329035282135},
    'camera_position': <Vector3r> {   'x_val': -219.2003173828125,
    'y_val': 188.4754180908203,
    'z_val': -342.4938049316406},
    'compress': False,
    'height': 256,
    'image_data_float': [   0.0],
    'image_data_uint8': b'!"&\xff'
                        b'\x1f %\xff'
                        b'\x1b\x1c \xff'
                        b'\x1b\x1c \xff'
                            ..........................
                           ............................
                        b'\xb9\xc2\xdd\xff'
                        b'\xb7\xbf\xdb\xff'
                        b'\xb4\xbd\xd8\xff'
                        b'\xb3\xbc\xd7\xff'
                        b'\xb4\xbc\xd8\xff',
    'image_type': 2,
    'message': 'success',
    'pixels_as_float': False,
    'time_stamp': 1567163881748,
    'width': 384}

As you can see neither pixels_as_float, nor image_data_float are populated.

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