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

Python simGetImages: Attribute 'to_msgpack' missing #3533

Closed
tkazik opened this issue Mar 26, 2021 · 7 comments · Fixed by #3594
Closed

Python simGetImages: Attribute 'to_msgpack' missing #3533

tkazik opened this issue Mar 26, 2021 · 7 comments · Fixed by #3594

Comments

@tkazik
Copy link

tkazik commented Mar 26, 2021

Bug report

  • AirSim Version/#commit: latest / 6d20663
  • UE/Unity version: 4.26.1
  • OS Version: Ubuntu 18.04 and 20.04

What's the issue you encountered?

Running the superbasic tutorial python3 hello_drone.py: The script crashes while getting the images.

airsim_image

Settings

=> default (installed pip install msgpack-rpc-python)

How can the issue be reproduced?

every time on Ubuntu 18.04 and 20.04

Include full error message in text form

    sock.send_message(message, callback)
  File "/home/xxx/anaconda3/envs/myCVLpy3/lib/python3.8/site-packages/msgpackrpc/transport/tcp.py", line 19, in send_message
    self._stream.write(self._packer.pack(message), callback=callback)
  File "msgpack/_packer.pyx", line 284, in msgpack._packer.Packer.pack
  File "msgpack/_packer.pyx", line 290, in msgpack._packer.Packer.pack
  File "msgpack/_packer.pyx", line 287, in msgpack._packer.Packer.pack
  File "msgpack/_packer.pyx", line 263, in msgpack._packer.Packer._pack
  File "msgpack/_packer.pyx", line 263, in msgpack._packer.Packer._pack
  File "msgpack/_packer.pyx", line 263, in msgpack._packer.Packer._pack
  File "msgpack/_packer.pyx", line 234, in msgpack._packer.Packer._pack
  File "msgpack/_packer.pyx", line 277, in msgpack._packer.Packer._pack
  File "/home/xxx/anaconda3/envs/myCVLpy3/lib/python3.8/site-packages/msgpackrpc/transport/tcp.py", line 12, in <lambda>
    self._packer = msgpack.Packer(encoding=encodings[0], default=lambda x: x.to_msgpack())
AttributeError: 'function' object has no attribute 'to_msgpack'

Thx!

@hpsauce82
Copy link

I get the same error on Windows 10 running hello_car.py

@tkazik
Copy link
Author

tkazik commented Mar 30, 2021

This is likely related to an issue with msgpack-rpc-python, which is kind of old and does not work with tornado >= v5 (the current tornado version is 6.1). Probably because the msgpack-rpc-python package is not really maintained anymore, see msgpack-rpc/msgpack-rpc-python#16. Anyone else has another take?

@mmorphew
Copy link

There may also be some issues with certain ImageTypes in AirSim. For example, if you modify the hello_drone.py file to only return ImageType.Scene for each of the four calls, the script runs. It breaks when attempting to get other image types such as ImageType.Segmentation. I am not sure what changes between each ImageType that causes the code to break.

@mmorphew
Copy link

mmorphew commented Apr 1, 2021

The solution suggested in #3553 fixed this error for me. To reiterate that fix, navigate to AirSim/PythonClient/airsim/types.py, and within that file, comment out both the entire _ImageType class, as well as the redefinition of the ImageType class that immediately comes after it. This reverts ImageType to use its first definition, in which each image type maps to an integer. After this step is completed, replace the instances of ImageType referenced in hello_drone.py with their corresponding integers for each ImageRequest. (For example, airsim.ImageRequest("0", 0)) The script should run successfully and output the images to the specified directory in the script. I have tested this with all image types on Ubuntu 20.04 and have been able to get successful outputs for all of them.

@Roopesh-Bharatwaj-K-R
Copy link

Roopesh-Bharatwaj-K-R commented Apr 1, 2021

Hi guys , how you all managed to connect with Python Environment , i tried a lot but i could not able to connect it, any suggestion, thanks .

@ahmed-elsaharti
Copy link
Contributor

@Roopesh-Bharatwaj-K-R This guide could be a good place to start

@ahmed-elsaharti
Copy link
Contributor

Also, can you guys try the solution suggested in this comment to see if its an issue with the python modules installed

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

Successfully merging a pull request may close this issue.

5 participants