evoggy / crazyflie-pc-client

Other
0 stars 1 forks source link

TypeError: native Qt signal is not callable #66

Closed evoggy closed 10 years ago

evoggy commented 10 years ago

When using the latest version of the PC client, the following error is triggered when pushing any of the buttons of my PS3-like joystick (axis inputs work OK):

#!python

Error reading from input device

Traceback (most recent call last):
  File "./crazyflie/crazyflie-pc-client/lib/cfclient/utils/input.py", line 267, in readInput
    self.rp_trim_updated.call(self._trim_roll, self._trim_pitch)
  File "./crazyflie/crazyflie-pc-client/lib/cflib/utils/callbacks.py", line 56, in call
    cb(*args)
TypeError: native Qt signal is not callable

cfclient-2013.4.2 version is working OK (all joystick inputs). I suspect that the error appeared after the "Removed QT dependency from headless client and input layer": (I do not reproduce the error if I update the repository back to Rev 184).

The configuration is Xubuntu 13.04 (all dependencies updated). Same behavior when using the Bitcraze VM.


evoggy commented 10 years ago

Fixed in pull request #24 and commit a824de1.


Original Comment By: Marcus Eliasson

evoggy commented 10 years ago

Hi!

Thanks for reporting this. Yes, it's certainly from removing the QT dependencies, after that commit there shouldn't be any QT dependence in the input layer. I was probably sloppy when testing it :-/

If you have fixed it and would like to contribute then create a pull request and we will review and pull the code into our repo: https://confluence.atlassian.com/display/BITBUCKET/Work+with+pull+requests


Original Comment By: Marcus Eliasson

evoggy commented 10 years ago

cflib.utils.callbacks triggers the error when trying to 'call' a Qt signal. It works OK when using the signal emit() method instead.

Furthermore, the registered signal ends up calling the cfclient.utils.input set_trim() method. The call fails because the method does not exist (I suspect that it refers to _update_trim() method.

I am fairly noob in using version control systems (I am just an amateur programmer), but I am really excited to collaborate in your (amazing) project. I have fixed both issues in my local copy but I ignore how to file a "pull request" to your repository: do not hesitate to point me to your preferred way of collaboration ;-)


Original Comment By:

evoggy commented 10 years ago

Among the callbacks registered for self.rp_trim_updated there is a PyQt4.QtCore.pyqtBoundSignal. This object is not callable. Instead you may use its method emit(*args)

Althoug my experience with PyQt4 is zero (or nothing), I suspect that the PyQt4 architecture is not based on callbacks, but on signals & slots.


Original Comment By: