Boomaa23 / open-ds

A reverse-engineered lightweight cross-platform FRC Driver Station
https://boomaa23.github.io/open-ds/
Other
43 stars 8 forks source link

OpenDS on Linux, only one hat is detected on a gamepad #14

Closed jmorris-frc2016 closed 2 years ago

jmorris-frc2016 commented 2 years ago

seems like only the left hat (both x and y) and then depending on the controller z (the triggers) is detected. neither of the axes on the right hat were showing up. thought it was maybe just a graphical glitch before, but had a chance tonight to connect to a robot and confirm it seems to only be the left x and left y that it detects. Note the builtin game controller tester in my distro seems to pick up both.

Boomaa23 commented 2 years ago

Joystick issues are a bit harder for me to fix but I'll try my best. What type of joystick are you using and how is it connected? (USB, bluetooth, etc). How many axes and buttons would you expect to have? Also what version of the linux kernel is your distro running?

jmorris-frc2016 commented 2 years ago

so, ive tried a logitech F310 which is a wired usb gamepad, as well as a ps4 controller via bluetooth, same result for both. running linux kernel 5.10.0-15-amd64. I think both have 5 or 6 axes (not sure if the triggers both map to the z for both controllers), left hat x, left hat y, right hat x, right hat y, and then the triggers. the number of buttons is around 10, but there is also a dpad on both that youd think is buttons but seems to show up differently. more than happy to help debug if you have like a script to list connected devices or something

Boomaa23 commented 2 years ago

Hi @jmorris-frc2016, I have gone around and changed some of the joystick logic so it can be more flexible with what type of inputs it receives (as of c135582a55aeff954c6a1e43274d4b3d23911900). All gamepad/joystick axes should now also be remappable if the default settings aren't correct. Note though that there may be some issues with the D-pad (#15). I will work on making these axis remappings persistent so you don't have to enter them every time. Please let me know if this functionality works on your input devices!

Boomaa23 commented 2 years ago

Going to close this as the bug has been fixed and additional features implemented.

jmorris-frc2016 commented 2 years ago

hey Boomaa, thanks for working on this, i can confirm that for the ps4 controller everything seems to be good now. The Logitech controller i have seems to be behaving a little odd, but i noticed that its behavior is the same in the little control prompt builtin to my distro, (left hat seems to be axes 7 and 8 but only returning the end limits (so -1, 0 or 1). seems for that controller, the hat and the POV are reversed. might just be the mode its in (they have a switch between direct input and xinput i think, but its broken on this one)