Closed mtc-20 closed 2 years ago
Tiny update: The scripts work fine on a RaspberryP, so it works for our purpose. So, thanks a lot for this library!
But, I would still like some insight into why it doesn't behave the same way on an Ubuntu workstation, hope somebody could direct me.
Hardware setup
Did you happen to ever make any headway on this? I'm having the same issue on Ubuntu 18.04.
Unfortunately no. Since we wanted very limited functionality, we just went ahead with our own class using threading
and inputs
library.
They work on Raspberry Pi (3 and 4), but not on Jetson Nano or Ubuntu workstations.
Thanks for the quick response. I actually managed to fix this by just excepting KeyErrors in the relevant locations and then next time the button is pressed it gets added appropriately. I started with inputs but reading the gamepad is a blocking call which is causing us all kinds of issues.
We need to read the gamepad to send its state over a network connection and the server is expecting the output at a set rate so blocking reads isn't working. Found a few potential avenues to fix this but if you had any immediate thoughts to share it would be appreciated.
Thanks for the quick response. I actually managed to fix this by just excepting KeyErrors in the relevant locations and then next time the button is pressed it gets added appropriately.
That worked for you? That's good to know! We didn't pursue that approach when we realized that KeyError
s were being raised at too many locations
I started with inputs but reading the gamepad is a blocking call which is causing us all kinds of issues.
Same here, that's why I wanted to use this library
We need to read the gamepad to send its state over a network connection and the server is expecting the output at a set rate so blocking reads isn't working. Found a few potential avenues to fix this but if you had any immediate thoughts to share it would be appreciated.
Sorry, no. The workaround we came up with was to make sure the gamepad
calls from the inputs
library is always on a new thread, so that it doesn't exactly block anything else...
I tried this library on Ubuntu 18.04 and had the same issue. I made Poohl's change and now it is working :) Thank you Poohl!
Hello! I tried using the
Gamepad.py
but kept running into a Key error, any idea how to solve it?We have a Logitech F710 Gamepad, that we'd like to use for event based callbacks, so thought of using this library.
I tried running the
Gamepad.py
on python3 with our controller to find the mappings to make my own class, so started with thePS4
class, ran into a key error, thought it was because I used the wrong class for my gamepad.But after a few trials, found out that the problem wasn't with the Gamepad class. The
Gamepad.py
generates an output for only 2 buttons (R1 and B) and 2 axes, for every other button or axis event, it throws a Key error. I haven't changed anything in theGamepad.py
. Would be great if I could receive some insight into how to solve this issue.Screenshots
Hardware setup
Thanks in advance