zuoxingdong / dm2gym

Convert DeepMind Control Suite to OpenAI gym environments.
MIT License
83 stars 8 forks source link

Add OpenCV render window mode #2

Closed aaronsnoswell closed 5 years ago

aaronsnoswell commented 5 years ago

This PR adds a workaround to fix #1 by creating an alternate human render window option, based on the python-opencv library.

I've tried to make minimal changes, but I did add some spacing and comments in the render function and constructor to clarify what the new code does.

Looking forward to your comments and/or merging this PR :)

zuoxingdong commented 5 years ago

Hi @aaronsnoswell , thanks a lot for pointing out this problem and for this PR ! It looks great, I just have two tiny discussions:

What do you think ?

aaronsnoswell commented 5 years ago

Hi @zuoxingdong, your suggestions sound good - I'll make both changes and re-submit in the next day or so for re-reivew :)

aaronsnoswell commented 5 years ago

Ok, please see the updated changes - I've broken out a separate OpenCVImageViewer class now, and the option argument is in the render() function. I couldn't put it in the kwargs because that gets passed to the physics render() method :)

zuoxingdong commented 5 years ago

Hi @aaronsnoswell , that looks awesome ! Just one last point about PEP8 coding style, could you remove the additional blank lines particularly in render, this would fit PEP8 and with consistent coding style ?

After this, I think we are ready to merge.

aaronsnoswell commented 5 years ago

Hi @zuoxingdong :) I believe the code was already PEP8 compliant, but I removed the extra whitespace to match the existing coding style. Let me know if there is anything else. Thanks!

zuoxingdong commented 5 years ago

LGTM, thank you very much @aaronsnoswell for this PR ! Let's merge it now.