marsauto / europilot

A toolkit for controlling Euro Truck Simulator 2 with python to develop self-driving algorithms.
MIT License
1.52k stars 188 forks source link

Unable to create LinuxVirtualJoystick instance on Mac OS Sierra #13

Closed aryarohit07 closed 6 years ago

aryarohit07 commented 6 years ago

Hi, I was trying to use this awesome project on Mac OS Sierra. While following 05.inference, I got stuck here.


NameError                                 Traceback (most recent call last)
<ipython-input-12-2280f39a9193> in <module>()
      3 box = Box(x1, y1, x2, y2)
      4 
----> 5 joy = LinuxVirtualJoystick()

~/tensorflow/lib/python3.6/site-packages/europilot-0.0.1-py3.6.egg/europilot/joystick.py in __init__(self, name, bustype, vendor, product, version, events)
    210             events = (
    211                 # EV_KEY
--> 212                 uinput.BTN_TRIGGER,
    213                 uinput.BTN_THUMB,
    214                 uinput.BTN_THUMB2,

NameError: name 'uinput' is not defined

I went through the source code and found that uinput is imported only for linux. I tried installing python-uinput but looks like it is not supported on Mac.

Is there anything which I am missing? How should I create VirtualJoystick on Mac?

daftshady commented 6 years ago

uinput is only for linux. Virtual joystick in osx is not supported yet. I think osx should be removed from supported os until we implement keyboard and mouse control.