bitcraze / crazyflie-clients-python

Host applications and library for Crazyflie written in Python.
Other
306 stars 469 forks source link

Exception in cfclient when connecting a Logitech Gamepad F310 controller #162

Closed boaz001 closed 9 years ago

boaz001 commented 9 years ago

I got an exception when I connect a Logitech Gamepad F310. I put the switch on the back of the controller on D (X didn't work at all). Log of the exception from running python bin/cfclient:

INFO:cfclient.cfclient:Disabling STL printouts
INFO:cfclient.utils.inputreaders:Found readers: ['linuxjsdev', 'pysdl2']
INFO:cfclient.utils.inputreaders:Could not initialize [linuxjsdev]: Only supported on Linux
INFO:cfclient.utils.inputreaders:Successfully initialized [pysdl2]
INFO:cfclient.utils.inputinterfaces:Found interfaces: ['leapmotion', 'zmqpull']
INFO:cfclient.utils.inputinterfaces:Could not initialize [leapmotion]: Leap Motion library probably not installed (No module named Leap)
INFO:cfclient.utils.inputinterfaces:Traceback (most recent call last):
  File "/Users/boaz/code/crazyflie-clients-python/lib/cfclient/utils/inputinterfaces/__init__.py", line 58, in <module>
    module = __import__(interface, globals(), locals(), [interface], -1)
  File "/Users/boaz/code/crazyflie-clients-python/lib/cfclient/utils/inputinterfaces/leapmotion.py", line 42, in <module>
    raise Exception("Leap Motion library probably not installed ({})".format(e))
Exception: Leap Motion library probably not installed (No module named Leap)

INFO:cfclient.utils.inputinterfaces:Could not initialize [zmqpull]: ZMQ library probably not installed (No module named zmq)
INFO:cfclient.utils.inputinterfaces:Traceback (most recent call last):
  File "/Users/boaz/code/crazyflie-clients-python/lib/cfclient/utils/inputinterfaces/__init__.py", line 58, in <module>
    module = __import__(interface, globals(), locals(), [interface], -1)
  File "/Users/boaz/code/crazyflie-clients-python/lib/cfclient/utils/inputinterfaces/zmqpull.py", line 39, in <module>
    raise Exception("ZMQ library probably not installed ({})".format(e))
Exception: ZMQ library probably not installed (No module named zmq)

INFO:cfclient.ui.main:This is a MAC - checking if we can apply Progress Bar Stylesheet for Yosemite Skinny Bars 
INFO:cfclient.ui.main:Found Yosemite:
INFO:cfclient.utils.config:Dist config read from /Users/boaz/code/crazyflie-clients-python/lib/cfclient/configs/config.json
INFO:cfclient.utils.config:Config file read from [/Users/boaz/code/crazyflie-clients-python/lib/../conf/config.json]
INFO:cfclient.utils.input:Using device blacklist [(VirtualBox|VMware)]
INFO:cfclient.utils.inputreaders.pysdl2:Looking for devices
WARNING:cfclient.ui.tabs.GpsTab:GPS tab not enabled since no Pythonbindings for Marble was found
INFO:cfclient.utils.input:Selected MUX: None
INFO:cfclient.ui.main:Input device muxing disabled in config
2015-03-15 21:53:09.030 Python[10976:173462] _createMenuRef called with existing principal MenuRef already associated with menu
2015-03-15 21:53:09.034 Python[10976:173462] (
    0   CoreFoundation                      0x00007fff8d4c966c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8619176e objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8d4c951d +[NSException raise:format:] + 205
    3   AppKit                              0x00007fff80ec095e -[NSCarbonMenuImpl _createMenuRef] + 62
    4   AppKit                              0x00007fff80ec02a8 -[NSCarbonMenuImpl _instantiateCarbonMenu] + 139
    5   AppKit                              0x00007fff80ebeaf2 -[NSApplication finishLaunching] + 947
    6   AppKit                              0x00007fff80ebe3c1 -[NSApplication run] + 128
    7   QtGui                               0x000000010f84ef18 _ZN19QEventDispatcherMac13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 1522
    8   QtCore                              0x00000001104966f1 _ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE + 77
    9   QtCore                              0x0000000110496870 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 370
    10  QtCore                              0x000000011049951f _ZN16QCoreApplication4execEv + 199
    11  QtGui.so                            0x000000010f01dbe2 _ZL23meth_QApplication_exec_P7_objectS0_ + 80
    12  Python                              0x000000010e76a7e6 PyEval_EvalFrameEx + 14392
    13  Python                              0x000000010e76d62e fast_function + 262
    14  Python                              0x000000010e76a400 PyEval_EvalFrameEx + 13394
    15  Python                              0x000000010e766d7a PyEval_EvalCodeEx + 1409
    16  Python                              0x000000010e7667f3 PyEval_EvalCode + 54
    17  Python                              0x000000010e7868a2 run_mod + 53
    18  Python                              0x000000010e786945 PyRun_FileExFlags + 133
    19  Python                              0x000000010e7864e2 PyRun_SimpleFileExFlags + 769
    20  Python                              0x000000010e797c5b Py_Main + 3051
    21  libdyld.dylib                       0x00007fff8dc665c9 start + 1
)
INFO:cfclient.utils.inputreaders.pysdl2:Looking for devices
INFO:cfclient.utils.inputreaders.pysdl2:Looking for devices
INFO:cfclient.utils.inputreaders.pysdl2:Looking for devices
INFO:cfclient.utils.inputreaders.pysdl2:Looking for devices
INFO:cfclient.utils.mux.nomux:Adding device Logitech Dual Action to MUX None
WARNING:cfclient.utils.input:Exception while reading inputdevice: Traceback (most recent call last):
  File "/Users/boaz/code/crazyflie-clients-python/lib/cfclient/utils/input.py", line 393, in read_input
    [roll, pitch, yaw, thrust] = self._selected_mux.read()
  File "/Users/boaz/code/crazyflie-clients-python/lib/cfclient/utils/mux/nomux.py", line 53, in read
    data = self._devs[0].read()
  File "/Users/boaz/code/crazyflie-clients-python/lib/cfclient/utils/inputreaders/__init__.py", line 110, in read
    [axis, buttons] = self._reader.read(self.id)
TypeError: read() takes exactly 1 argument (2 given)

INFO:cflib.crazyflie:Closing link
INFO:cflib.crazyflie:Callback->Disconnected from []
2015-03-15 21:53:13.977 Python[10976:173462] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
INFO:cflib.crazyflie:Closing link
INFO:cflib.crazyflie:Callback->Disconnected from []
INFO:cfclient.utils.config:Config file saved to [/Users/boaz/code/crazyflie-clients-python/lib/../conf/config.json]
Host OS and version of OS: OS X Yosemite 10.10.2

Output from About->Debug:

Cfclient
Cfclient version: 2014.12.3-50-gbe7231d 
System: darwin

Interface status
UsbCdc: No information available
serial: None
radio: Cannot find a Crazyradio Dongle
udp: None

Input readers
PySDL2 (0 devices connected)

Input devices
None

Crazyflie
Connected: None
Firmware: None
Sensors found
Sensors tests
boaz001 commented 9 years ago

Looks like this issue is now fixed by this commit: 2d27e82.