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

Issue with PS4 DualShock Controller being recognized? #9

Open notyahir opened 2 years ago

notyahir commented 2 years ago

Hello! I am from Team 4787, currently trying to run this cool DriverStation alternative on my Mac but I have ran into the issue of the controller being recognized. As of right now, I know that Xbox 360 controllers aren't able to run on Macs anymore so I have decided to test with a PS4 controller, however, I have ran into an issue where the OpenDS doesn't recognize the PS4 controller and is at index -1. I'm not exactly sure why this is happening but when connecting to my robot, I am getting voltage readings and it is showing that the robot is connected.

JNativeHook: Global keyboard and mouse hooking for Java.
Copyright (C) 2006-2015 Alexander Barker.  All Rights Received.
https://github.com/kwhat/jnativehook/

JNativeHook is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

JNativeHook is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: arraycopy: source index -1 out of bounds for object array[10]
    at java.base/java.lang.System.arraycopy(Native Method)
    at java.base/java.util.Vector.insertElementAt(Vector.java:597)
    at java.desktop/javax.swing.DefaultListModel.add(DefaultListModel.java:474)
    at com.boomaa.opends.usb.ControlDevices.findAll(ControlDevices.java:35)
    at com.boomaa.opends.display.DisplayEndpoint.main(DisplayEndpoint.java:152)

I am on MacOS Monterey: 12.2.1 and I am running OpenDS: V0.2.2

Screen Shot 2022-02-24 at 4 36 24 PM
Boomaa23 commented 2 years ago

Hi! MacOS is a bit tricky for me because I don't have reliable access to a mac for testing. I will look into it as soon as I can though!

Boomaa23 commented 2 years ago

Hi @notyahir! I have fixed some macOS joystick/gamepad issues as of 4d5c2a99c0eec30f76b1372631461b8de20c4e81. Please let me know if this fixes your problem. I think it should but am not 100% confident.