Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ptotikj opened this issue Aug 30, 2019 · 2 comments
Closed

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

ptotikj opened this issue Aug 30, 2019 · 2 comments

Comments

@ptotikj
Copy link

ptotikj commented Aug 30, 2019

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.

@rallen10
Copy link

I am facing the exact same problem. Did you ever find a solution?

@ClarkZha
Copy link

I bumped into related image request problem and found this issue page.
It seems that one of the latest update is related to you problem.
Check pull request [#3163].
(Don't know if this is too late as the problem seems to be half a year ago. Hopefully this comment will help developers visiting this page in future.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants